@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #050b16;
  --surface: #0a1424;
  --surface-2: #0e1b2f;
  --line: #1c2c44;
  --text: #eef4fa;
  --muted: #a3b4c9;
  --accent: #5ce1f5;
  --accent-ink: #03202a;
  --wa: #25d366;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(20px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: calc(1240px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.sr-defs { position: absolute; }
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Navigation */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.nav.is-stuck {
  background: rgb(5 11 22 / .82);
  border-color: var(--line);
  backdrop-filter: blur(14px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: calc(1240px + 2 * var(--gutter));
  margin-inline: auto; padding: 16px var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 36px; height: 22px; fill: var(--accent); }
.brand-name { font-size: .95rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; }
.brand-name b { font-weight: 700; }
.nav-links { display: flex; gap: clamp(16px, 3vw, 32px); font-size: .95rem; }
.nav-links a { padding: 6px 0; color: var(--muted); text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: var(--text); }

/* Hero */
.hero {
  position: relative;
  display: flex; align-items: center;
  min-height: 100svh;
  padding-block: 112px 72px;
  background:
    radial-gradient(62% 70% at 0 0, #04193a 0, transparent 72%),
    linear-gradient(100deg, #020c1c, #01050c 72%);
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; container-type: size; }
.hero-stage {
  --px: 0px; --py: 0px;
  position: absolute; top: 50%; right: 0;
  width: max(100cqw, 179.2cqh);
  aspect-ratio: 1376 / 768;
  transform: translate(var(--px), calc(-50% + var(--py))) scale(1.03);
  transform-origin: 72% 50%;
  will-change: transform;
}
.hero-stage img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-stage::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgb(92 225 245 / .2) 1px, transparent 1.5px);
  background-size: 11px 11px;
  -webkit-mask-image: radial-gradient(38% 72% at 72% 48%, #000 35%, transparent);
  mask-image: radial-gradient(38% 72% at 72% 48%, #000 35%, transparent);
}
/* Same place and size as the sphere in hero.webp: centred at 1000,385, 600px box */
.hero-sphere {
  position: absolute; left: 50.87%; top: 11.07%;
  width: 43.6%; aspect-ratio: 1;
  animation: sphere-in 1.6s var(--ease) both;
}
.hero-fade {
  position: absolute; inset: auto 0 0; height: 18%;
  background: linear-gradient(to bottom, transparent, var(--bg));
}

.hero-content { position: relative; }
.hero-content > * { max-width: 590px; }
.hero-logo {
  width: 92px; height: auto; margin-bottom: 26px;
  fill: var(--accent);
  overflow: visible;
  animation: logo-glow 1.4s 1s ease-out both;
}
.chev-l { animation: chev-l .9s .15s var(--ease) both; }
.chev-r { animation: chev-r .9s .15s var(--ease) both; }
.logo-l { animation: draw-l .7s .1s var(--ease) both; }

.hero-code {
  display: flex; align-items: center; gap: 8px;
  min-height: 1.6em; margin-bottom: 16px;
  color: var(--accent);
  font: 400 clamp(.62rem, 3.1vw, .875rem)/1.6 var(--mono);
  white-space: nowrap;
}
.hero-code code { font: inherit; }
.prompt { opacity: .55; }
.caret {
  width: .55em; height: 1.15em; margin-left: -4px;
  background: var(--accent);
  animation: blink 1.05s steps(2) infinite;
}
h1 {
  font: 650 clamp(2.45rem, 4.6vw, 3.9rem)/1.04 var(--display);
  letter-spacing: -.025em;
  text-wrap: balance;
}
h1 em { color: var(--accent); font-style: normal; }
.hero-sub { max-width: 540px; margin-top: 22px; color: var(--muted); font-size: clamp(1.05rem, 1.5vw, 1.2rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.rise { animation: rise .8s var(--d, 0s) var(--ease) both; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 12px 24px;
  border: 1px solid transparent; border-radius: 10px;
  font-weight: 600; text-decoration: none;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s, box-shadow .2s;
}
.btn svg { width: 19px; height: 19px; fill: currentColor; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { box-shadow: 0 8px 30px rgb(92 225 245 / .28); }
.btn-ghost { border-color: #2d4364; color: var(--text); background: rgb(14 27 47 / .55); }
.btn-ghost:hover { border-color: var(--accent); }

/* Sections */
.section { padding-block: clamp(72px, 10vw, 128px); }
.section-head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 72px); }
.kicker { color: var(--accent); font: 500 .8125rem/1.5 var(--mono); }
h2 {
  margin-top: 10px;
  font: 650 clamp(2rem, 4.2vw, 3.25rem)/1.08 var(--display);
  letter-spacing: -.02em;
  text-wrap: balance;
}
h3 { font: 620 clamp(1.45rem, 2.4vw, 1.9rem)/1.15 var(--display); letter-spacing: -.012em; }
.section-sub { margin-top: 14px; color: var(--muted); font-size: 1.125rem; }

/* Projects */
.projects { display: grid; gap: clamp(56px, 8vw, 104px); }
.project {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(28px, 5vw, 72px);
}
.project:nth-child(even) { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
.project:nth-child(even) .frame { order: 2; }
.project-info > * + * { margin-top: 12px; }
.project-info p:not(.kicker) { color: var(--muted); }
.frame {
  display: block; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgb(0 0 0 / .4);
  transition: transform .45s var(--ease), border-color .3s;
}
.frame:hover { transform: translateY(-5px); border-color: #3a6a84; }
.frame-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.frame-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2d4364; }
.frame-bar span { margin-left: 10px; color: var(--muted); font: 400 .75rem/1.4 var(--mono); }
.frame img { width: 100%; }
.link {
  display: inline-block; margin-top: 18px !important;
  color: var(--text); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px;
  overflow-wrap: anywhere;
}
.link:hover { color: var(--accent); }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column;
  padding: clamp(26px, 3vw, 36px);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden;
}
.plan > * { position: relative; }
.plan-featured { background: var(--surface-2); border-color: var(--accent); }
.plan-tag {
  display: inline-block; margin-bottom: 14px;
  padding: 3px 10px; border-radius: 6px;
  background: rgb(92 225 245 / .12);
  color: var(--accent); font: 500 .75rem/1.6 var(--mono);
}
.plan-line {
  position: absolute !important; top: 10px; right: 0;
  width: 46%; height: 50px;
  fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke;
  opacity: .45;
}
.plan-line path { vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; }
.js .plan-featured:not(.in) .plan-line path { stroke-dashoffset: 1; }
.plan-line path { transition: stroke-dashoffset 1.8s .25s ease-out; }
.plan-desc { margin-top: 10px; color: var(--muted); }
.price { margin-top: 18px; color: var(--muted); }
.price strong {
  color: var(--text);
  font: 650 clamp(2.5rem, 4vw, 3.25rem)/1.1 var(--display);
  letter-spacing: -.025em;
}
.price-text strong { font-size: clamp(2rem, 3.2vw, 2.6rem); line-height: 1.38; }
.price-from { display: block; }
.price-monthly { margin-top: 4px; color: var(--accent); font-weight: 500; }
.plan-list { display: grid; gap: 10px; margin: 24px 0 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.plan-list li { position: relative; padding-left: 26px; }
.plan-list li::before {
  content: ""; position: absolute; left: 3px; top: .42em;
  width: 11px; height: 6px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.plan-list b { font-weight: 600; }
.plan-terms { display: block; color: var(--accent); font-size: .875rem; text-underline-offset: 3px; }
.plan .btn { margin-top: auto; width: 100%; }

/* Contact */
.contact { padding-bottom: clamp(56px, 8vw, 96px); }
.contact-card {
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(48px, 7vw, 88px) 24px;
  text-align: center;
  background: radial-gradient(70% 90% at 50% 0, #10283d 0, var(--surface) 70%);
  border: 1px solid var(--line); border-radius: 20px;
}
.contact-logo { width: 72px; height: 44px; margin-bottom: 18px; fill: var(--accent); filter: drop-shadow(0 0 14px rgb(92 225 245 / .45)); }
.contact-card h2 { margin-top: 0; }
.contact-card p { margin: 12px 0 28px; color: var(--muted); font-size: 1.125rem; }

/* Footer */
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-block: 28px 96px;
  color: var(--muted); font-size: .9rem;
}
.footer .brand-name { color: var(--text); font-size: .85rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* WhatsApp */
.wa-float {
  position: fixed; z-index: 30;
  right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  display: grid; place-items: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--wa); color: #fff;
  box-shadow: 0 8px 26px rgb(0 0 0 / .45);
  transition: transform .2s var(--ease);
  animation: wa-in .5s 1.3s var(--ease) both;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 32px; height: 32px; fill: currentColor; }
.wa-float::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--wa);
  animation: wa-ring 2.4s 2s ease-out 3;
  opacity: 0;
}

/* Scroll reveal, only applied when JS can undo it */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.plans .plan:nth-child(2) { transition-delay: .1s; }
.plans .plan:nth-child(3) { transition-delay: .2s; }
.plans .plan:nth-child(4) { transition-delay: .3s; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes sphere-in { from { opacity: 0; } }
@keyframes chev-l { from { opacity: 0; transform: translateX(60px); } }
@keyframes chev-r { from { opacity: 0; transform: translateX(-60px); } }
@keyframes draw-l { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes logo-glow {
  0% { filter: drop-shadow(0 0 0 rgb(92 225 245 / 0)); }
  45% { filter: drop-shadow(0 0 20px rgb(92 225 245 / .95)); }
  100% { filter: drop-shadow(0 0 9px rgb(92 225 245 / .5)); }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes wa-in { from { opacity: 0; transform: scale(.5); } }
@keyframes wa-ring { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.55); } }

/* Narrow desktops: nudge the sphere right so it clears the headline */
@media (max-width: 1599px) {
  .hero-stage { right: -6cqw; width: max(106cqw, 179.2cqh); }
}
@media (max-width: 1360px) {
  .hero-stage { right: -10cqw; width: max(110cqw, 179.2cqh); }
  .hero-content > * { max-width: 520px; }
}

/* Align each row across the three plans */
@media (min-width: 861px) {
  .plan { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; }
  .plan-head { align-self: end; }
}
@media (max-width: 1180px) {
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1181px) {
  .price-text strong { font-size: clamp(1.7rem, 2.35vw, 2.6rem); white-space: nowrap; }
}

/* Stack hero: text on top, sphere underneath */
@media (max-width: 1100px), (max-aspect-ratio: 5/4) {
  .hero { align-items: flex-start; padding-block: 100px min(76vw, 360px); }
  .hero-stage {
    --w: min(190vw, 860px);
    top: auto; right: auto;
    bottom: calc(var(--w) * -.06);
    left: calc(50% - var(--w) * .727);
    width: var(--w);
    transform: translate(var(--px), var(--py));
    --fade-y: linear-gradient(to bottom, transparent 4%, #000 26%);
    --fade-x: linear-gradient(to right, transparent, #000 14%, #000 92%, transparent);
    -webkit-mask-image: var(--fade-y), var(--fade-x);
    mask-image: var(--fade-y), var(--fade-x);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
  }
  .hero-fade { height: 10%; }
  .hero-content > * { max-width: 680px; }
}

@media (max-width: 860px) {
  .plans { grid-template-columns: 1fr; }
  .plan-featured { order: -1; }
  .project, .project:nth-child(even) { grid-template-columns: 1fr; }
  .project:nth-child(even) .frame { order: 0; }
  .plans .plan { transition-delay: 0s; }
}

@media (max-width: 560px) {
  .nav-contact, .nav-guide { display: none; }
  .brand-name { font-size: .85rem; }
  .brand-mark { width: 31px; height: 19px; }
  .hero-logo { width: 72px; margin-bottom: 20px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .wa-float { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-logo { filter: drop-shadow(0 0 9px rgb(92 225 245 / .5)); }
  .caret { display: none; }
  .js .reveal { opacity: 1; transform: none; }
  .js .plan-featured:not(.in) .plan-line path { stroke-dashoffset: 0; }
  .wa-float::after { display: none; }
}
