/* ============================================================
   Eqnity — portfolio
   Black theme · Space Grotesk + JetBrains Mono
   ============================================================ */

:root {
  --bg: #050505;
  --bg-soft: #0a0a0a;
  --fg: #ededed;
  --muted: #8f8f8f;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #ccff1e;
  --accent-dim: rgba(204, 255, 30, 0.1);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

::selection {
  background: var(--accent);
  color: #050505;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #222;
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.mono {
  font-family: var(--mono);
}

/* Film grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Cursor spotlight */
#spotlight {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 50%),
    rgba(204, 255, 30, 0.05), transparent 65%);
}

/* ============================================================
   Continue gate ("You sure wanna continue?")
   ============================================================ */
#gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 20px;
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0.45s;
}

#gate.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.04);
}

.gate-inner {
  text-align: center;
  animation: gateIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes gateIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
  }
}

.gate-q {
  font-size: clamp(1.3rem, 4.5vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.gate-btns {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.gate-btn {
  min-width: 150px;
  padding: 14px 30px;
  font-size: 0.95rem;
  border-radius: 100px;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.gate-btn:active {
  transform: scale(0.97);
  -webkit-tap-highlight-color: transparent;
}

.gate-yes {
  background: var(--accent);
  color: #050505;
}

.gate-yes:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(204, 255, 30, 0.25);
}

.gate-no {
  border: 1px solid var(--line);
  color: var(--muted);
}

.gate-no:hover {
  border-color: var(--fg);
  color: var(--fg);
  transform: translateY(-2px);
}

.gate-msg {
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--accent);
  min-height: 1.4em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.gate-msg.show {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Loading overlay
   ============================================================ */
#intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}

#intro.done {
  transform: translateY(-101%);
}

.intro-inner {
  text-align: center;
  width: min(520px, 86vw);
}

/* letters blur + scale in, one beat each */
.intro-word {
  font-size: clamp(3rem, 11vw, 6.5rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  min-height: 1.1em;
  text-transform: uppercase;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-word span {
  display: inline-block;
  opacity: 0;
  animation: introLetter 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-word span:nth-child(1) { animation-delay: 0.05s; }
.intro-word span:nth-child(2) { animation-delay: 0.15s; }
.intro-word span:nth-child(3) { animation-delay: 0.25s; }
.intro-word span:nth-child(4) { animation-delay: 0.35s; }
.intro-word span:nth-child(5) { animation-delay: 0.45s; }
.intro-word span:nth-child(6) { animation-delay: 0.55s; }

.intro-word::after {
  content: "_";
  color: var(--accent);
  animation: blink 0.9s steps(1) infinite;
}

@keyframes introLetter {
  from {
    opacity: 0;
    transform: translateY(26px) scale(1.3);
    filter: blur(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.intro-meta {
  margin-top: 30px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

.intro-status {
  font-size: 0.68rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 64px;
  text-align: left;
}

.intro-status::after {
  content: "_";
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}

.intro-bar {
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.intro-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  animation: introFill 1s 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-pct {
  font-size: 0.72rem;
  color: var(--accent);
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@keyframes introFill {
  to { width: 100%; }
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 60px);
  opacity: 0;
}

body.ready .site-header {
  animation: fadeDown 0.8s 0.35s ease forwards;
}

.logo {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.logo-caret {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 40px);
  font-size: 0.9rem;
}

.site-nav a {
  position: relative;
  opacity: 0.8;
  transition: color 0.25s ease, opacity 0.25s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.site-nav a:hover {
  color: var(--fg);
  opacity: 1;
}

.site-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.site-nav .nav-cta {
  border: 1px solid var(--line);
  padding: 8px 18px;
  border-radius: 100px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.site-nav .nav-cta::after {
  display: none;
}

.site-nav .nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 80px;
  overflow: hidden;
}

/* subtle grid */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, black 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, black 20%, transparent 75%);
}

.hero-glow {
  position: absolute;
  width: 900px;
  height: 500px;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(204, 255, 30, 0.09), transparent);
  filter: blur(10px);
  animation: pulse 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
  opacity: 0;
}

body.ready .eyebrow {
  animation: heroFade 0.9s 0.5s ease forwards;
}

.hero-title {
  position: relative;
  font-size: clamp(4rem, 17vw, 16rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  user-select: none;
}

.hero-title .line {
  display: inline-block;
  color: var(--fg);
}

.hero-title .outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--fg);
}

.hero-title .line:first-child {
  opacity: 0;
  transform: translateY(60px) rotate(3deg);
}

.hero-title .line:last-child {
  opacity: 0;
  transform: translateY(60px) rotate(-3deg);
}

body.ready .hero-title .line:first-child {
  animation: titleIn 1s 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.ready .hero-title .line:last-child {
  animation: titleIn 1s 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes titleIn {
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes heroFade {
  to { opacity: 1; }
}

.roles {
  margin-top: 26px;
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  color: var(--muted);
  opacity: 0;
}

body.ready .roles {
  animation: heroFade 0.9s 0.85s ease forwards;
}

.typed {
  color: var(--accent);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: blink 0.9s steps(1) infinite;
}

.hero-cta {
  display: flex;
  gap: 14px;
  margin-top: 38px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
}

body.ready .hero-cta {
  animation: heroFade 0.9s 1.05s ease forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn svg {
  transition: transform 0.25s ease;
}

.btn:hover svg {
  transform: translate(2px, -2px);
}

.btn-primary {
  background: var(--accent);
  color: #050505;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(204, 255, 30, 0.25);
}

.btn-ghost {
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}

.scroll-hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.68rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  transition: color 0.25s ease;
}

body.ready .scroll-hint {
  animation: heroFade 1s 1.45s ease forwards;
}

.scroll-hint:hover {
  color: var(--accent);
}

.scroll-line {
  width: 1px;
  height: 46px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: "";
  position: absolute;
  top: -50%;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--accent);
  animation: scrollDrop 1.8s ease-in-out infinite;
}

@keyframes scrollDrop {
  0% { top: -50%; }
  60%, 100% { top: 110%; }
}

/* ============================================================
   Marquee
   ============================================================ */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  overflow: hidden;
  white-space: nowrap;
  background: var(--bg-soft);
}

.marquee-track {
  display: inline-flex;
  animation: marquee 26s linear infinite;
}

.marquee-group {
  display: inline-flex;
  align-items: center;
  gap: 40px;
  padding-right: 40px;
}

.marquee span {
  font-size: clamp(1rem, 2.4vw, 1.6rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.marquee i {
  font-style: normal;
  color: var(--accent);
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: clamp(80px, 12vh, 150px) clamp(20px, 6vw, 90px);
  max-width: 1500px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.78rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}

.section-title {
  font-size: clamp(2rem, 5.5vw, 4.2rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  max-width: 16em;
}

.section-title em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--fg);
}

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 60px);
  max-width: 900px;
  margin-bottom: 44px;
}

.about-grid p {
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}

.about-grid p:first-child {
  color: var(--fg);
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-list li {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--muted);
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.tag-list li:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ============================================================
   Services / cards grid
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 26px;
  background: var(--bg-soft);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), var(--accent-dim), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(204, 255, 30, 0.45);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  color: var(--accent);
  transition: transform 0.35s ease;
}

.card:hover .card-icon {
  transform: rotate(-6deg) scale(1.06);
}

.card-icon svg {
  width: 26px;
  height: 26px;
}

.card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.card p {
  color: var(--muted);
  font-size: 0.92rem;
}

.card-tag {
  display: inline-block;
  margin-top: 18px;
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 14px;
  width: 100%;
}

.more-link {
  margin-top: 46px;
  font-size: 0.85rem;
  color: var(--muted);
}

.more-link a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

.more-link a:hover {
  border-color: var(--accent);
}

/* ============================================================
   Contact
   ============================================================ */
.contact {
  position: relative;
}

.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 500px at 80% 30%, rgba(204, 255, 30, 0.06), transparent 65%);
  pointer-events: none;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  max-width: 820px;
  margin: 30px 0 22px;
}

.contact-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  background: var(--bg-soft);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  background: rgba(204, 255, 30, 0.04);
}

.contact-card-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--fg);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.contact-card:hover .contact-card-icon {
  color: var(--accent);
  border-color: var(--accent);
}

.contact-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.contact-card-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.contact-card-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.contact-card-arrow {
  font-size: 1.2rem;
  color: var(--muted);
  transition: transform 0.3s ease, color 0.3s ease;
}

.contact-card:hover .contact-card-arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

.contact-note {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px clamp(20px, 6vw, 90px);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1500px;
  margin: 0 auto;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 22px;
  align-items: center;
}

.footer-links a,
.link-btn {
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.25s ease;
}

.footer-links a:hover,
.link-btn:hover {
  color: var(--accent);
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translate(-50%, 80px);
  z-index: 300;
  background: var(--fg);
  color: #050505;
  font-size: 0.82rem;
  padding: 12px 22px;
  border-radius: 100px;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast .toast-accent {
  color: #050505;
  font-weight: 600;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .intro-meta {
    gap: 10px;
  }

  .site-nav a:not(.nav-cta) {
    display: none;
  }

  .scroll-hint {
    display: none;
  }

  .site-footer p {
    order: 3;
    width: 100%;
    text-align: center;
  }

  .hero-title .outline {
    -webkit-text-stroke-width: 1.5px;
  }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  #intro {
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}