/* Tokens: mirror the variables in design/CachAI Landing Page.pen */
:root {
  --bg: #0b0b0b;
  --bg-raised: #0e0e0e;
  --surface: #141414;
  --line: #262626;
  --text: #ffffff;
  --muted: #8c8c8c;
  --dim: #6b6b6b;
  --orange: #e95509;

  --font-display: "Poppins", system-ui, sans-serif;
  --font-sans: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  --gutter: 120px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, p, blockquote, figure, ol { margin: 0; }

/* Masthead: nav + hero over the background constellation */
.masthead { position: relative; overflow: hidden; }
.top-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.top-network .edge { stroke: rgba(255, 255, 255, 0.14); stroke-width: 1; }
.top-network .edge--hub { stroke: rgba(233, 85, 9, 0.6); }
.top-network .cursor-link { stroke: rgba(255, 255, 255, 0.55); stroke-width: 1; }
.top-network .cursor-link--orange { stroke: rgba(233, 85, 9, 0.75); }
.top-network .cursor-dot { fill: var(--orange); }
.top-network .cursor-ring { fill: none; stroke: var(--orange); stroke-width: 1.5; } /* touch screens: a pulse that invites a tap */
/* Fade the network into the next section */
.masthead::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 220px;
  background: linear-gradient(180deg, rgba(11, 11, 11, 0), var(--bg));
  pointer-events: none;
  z-index: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 28px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); box-shadow: 0 8px 32px rgba(233, 85, 9, 0.35); }
}
.btn:focus-visible, .chip:focus-visible, .lockup:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.btn--lg { padding: 20px 32px; font-size: 17px; }
.btn__arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Nav */
.nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px var(--gutter);
  /* Frosted bar that separates the nav from the network behind it */
  background: rgba(11, 11, 11, 0.07);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.lockup { display: inline-flex; align-items: center; }
.lockup__wordmark { width: 123px; }
.lockup--sm .lockup__wordmark { width: 97px; }

/* Shared section rhythm */
.hero, main > section { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance; /* even lines, no single word left on the last one */
}

/* Hero: sized at 75% of the design so nav + hero fit on one screen.
   The art and headline also shrink with viewport height on short screens. */
.hero { gap: 36px; padding: 30px var(--gutter) 120px; }
.hero__art { position: relative; width: clamp(280px, calc((100svh - 460px) * 1.65), 570px); }
.hero__art img { position: relative; width: 100%; }
/* Wide, soft glow around the icon, drawn above the network lines */
.hero__art::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 133%;
  height: 190%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(233, 85, 9, 0.15), rgba(233, 85, 9, 0.04) 50%, rgba(233, 85, 9, 0));
  pointer-events: none;
}
.hero__copy { position: relative; display: flex; flex-direction: column; align-items: center; gap: 21px; }
/* Darkens the network only behind the text so it stays readable */
.hero__copy::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1200px, 120%);
  height: 175%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(11, 11, 11, 0.9), rgba(11, 11, 11, 0.6) 50%, rgba(11, 11, 11, 0));
  z-index: -1;
  pointer-events: none;
}
.hero__title {
  max-width: 1000px;
  text-wrap: balance;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, min(5vw, 7svh), 63px);
  line-height: 1;
  letter-spacing: -0.038em;
}
.hero__line { display: block; } /* one sentence per line */
.hero__sub { max-width: 560px; color: var(--muted); font-size: 16px; line-height: 1.55; text-wrap: balance; }
.btn--hero { padding: 14px 24px; gap: 8px; font-size: 15px; }
.btn--hero .btn__arrow { width: 16px; height: 16px; }

/* Why */
.why { gap: 48px; padding: 140px var(--gutter); border-top: 1px solid var(--line); background: var(--bg); }
.why__title { max-width: 1010px; }
/* The SVG has 80px of bleed on each side so its glow can fade out; the box keeps the 1000×220 footprint. */
.why__art { position: relative; width: 1000px; max-width: 100%; aspect-ratio: 1000 / 220; }
.why__art img,
.why__art svg { position: absolute; left: -8%; top: -36.3636%; width: 116%; height: auto; max-width: none; }
.why__art svg { overflow: visible; } /* the mouse glow can extend past the diagram */
.why__art svg.is-portrait { left: 0; top: 0; width: 100%; }
.why__closer { color: var(--orange); font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 24px; }


/* Quote + attention map */
.quote {
  gap: 40px;
  padding: 140px 220px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.quote__text {
  max-width: 1000px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.031em;
}
.quote__text { text-wrap: balance; }
.attention { position: relative; padding-top: 110px; }
.attention__arcs { position: absolute; inset: 0 0 auto 0; width: 100%; height: 110px; overflow: visible; }
.attention__tokens { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.token {
  --fill: var(--surface);
  --edge: #282828; /* white at 12% over the background */
  padding: 7px 14px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
}
.token .glow-text { --base: #bdbdbd; }
.token--hot { --fill: #1d110b; --edge: #6f2c0a; --edge-hot: var(--text); } /* orange at 8% and 45% */
.token--hot .glow-text { --base: var(--orange); --hot: var(--text); }

/* Founder */
.founder { padding: 0 var(--gutter) 140px; background: var(--bg); }
.founder__inner {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-top: 56px;
  border-top: 1px solid var(--line);
}
.founder__node { position: relative; width: 360px; max-width: 100%; }
.founder__net { display: block; width: 100%; height: auto; overflow: visible; } /* inlined by main.js */
.founder__avatar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px; /* centred without a transform, which would break the fixed background */
  border-radius: 50%;
  /* The photo covers the padding box, so this only paints the ring: orange, white under the spotlight */
  border: 1.5px solid transparent;
  background: radial-gradient(circle var(--glow-r) at var(--mx) var(--my), var(--text) 0 87%, var(--orange) 89%) border-box;
  object-fit: cover;
}
.founder__name { display: flex; flex-direction: column; gap: 6px; }
.founder__title { font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.founder__links { display: flex; gap: 12px; }
.chip {
  --fill: var(--bg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}
.chip .chip__arrow {
  --base: var(--muted);
  width: 16px;
  height: 16px;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
}
/* Hovered: the whole chip turns orange (the cursor spotlight switches off meanwhile, see main.js) */
/* Touch screens get the same look while a finger is on the chip (hover would stick after a tap) */
@media (hover: hover) {
  .chip:hover { --edge: var(--orange); --edge-hot: var(--orange); }
  .chip:hover .glow-text,
  .chip:hover .glow-fill { --base: var(--orange); --hot: var(--orange); }
}
.chip:active { --edge: var(--orange); --edge-hot: var(--orange); }
.chip:active .glow-text,
.chip:active .glow-fill { --base: var(--orange); --hot: var(--orange); }
/* While the pointer is over text, the links don't react to the spotlight */
.glow-on-text .chip { --glow-r: 1px; }

/* Final CTA: glow continues into the footer */
.cta {
  gap: 32px;
  padding: 96px 80px 140px;
  overflow: hidden;
  border-top: 1px solid rgba(233, 85, 9, 0.5);
  background:
    radial-gradient(50% 260px at 50% 811px, rgba(233, 85, 9, 0.25) 0%, rgba(233, 85, 9, 0.04) 45%, rgba(233, 85, 9, 0) 100%),
    var(--bg-raised);
}
.cta__network {
  position: absolute;
  left: 50%;
  top: 0;
  width: max(1440px, 100%);
  max-width: none;
  transform: translateX(-50%);
  pointer-events: none;
}
.cta > :not(.cta__network) { position: relative; }
.cta__icon { width: 65px; }
.cta__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 3.8vw, 54px);
  letter-spacing: -0.034em;
  line-height: 1.1;
  max-width: 1100px;
  text-wrap: balance;
}
/* Break after "pasión." so each rhyme ends a line; each half still wraps on its own when narrow */
.cta__line { display: inline-block; }
/* Phones show a short version of the title (see the 640px breakpoint) */
.cta__short { display: none; }

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 0 var(--gutter) 56px;
  background:
    radial-gradient(50% 260px at 50% calc(100% + 100px), rgba(233, 85, 9, 0.25) 0%, rgba(233, 85, 9, 0.04) 45%, rgba(233, 85, 9, 0) 100%),
    var(--bg-raised);
}
.footer__divider { width: 1200px; }
.footer__copy { color: var(--text); font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px; }

/* Cursor spotlight: follows the mouse between the header and the footer divider (main.js).
   No visible halo; what it covers swaps colour: white/grey turns orange, orange turns white.
   The edge is about 1px, so no blended (tan or salmon) colour shows between the two. */
@property --base { syntax: "<color>"; inherits: true; initial-value: #ffffff; }
@property --hot { syntax: "<color>"; inherits: true; initial-value: #e95509; }
@property --edge { syntax: "<color>"; inherits: true; initial-value: #262626; }
@property --edge-hot { syntax: "<color>"; inherits: true; initial-value: #e95509; }
:root {
  --mx: -9999px;
  --my: -9999px;
  --glow-r: 1px;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10M7 17 17 7'/%3E%3C/svg%3E");
}
.glow-text,
.glow-fill {
  --base: var(--text);
  --hot: var(--orange);
  background-image: radial-gradient(circle var(--glow-r) at var(--mx) var(--my), var(--hot) 0 87%, var(--base) 89%); /* --mx/--my: set per element by main.js */
  transition: --base 0.2s ease, --hot 0.2s ease;
}
.glow-text {
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.glow-text--orange { --base: var(--orange); --hot: var(--text); }
.glow-text--muted { --base: var(--muted); }
/* Outline that follows the spotlight: a fill on the padding box over a gradient on the border box */
.glow-border {
  /* --edge and --edge-hot default to the line colour and orange (see @property above) */
  border: 1px solid transparent;
  background:
    linear-gradient(var(--fill), var(--fill)) padding-box,
    radial-gradient(circle var(--glow-r) at var(--mx) var(--my), var(--edge-hot) 0 87%, var(--edge) 89%) border-box;
  transition: --edge 0.2s ease, --edge-hot 0.2s ease;
}

/* Tablet */
@media (max-width: 1024px) {
  :root { --gutter: 48px; }
  /* The English phrase has 12 tokens: keep it on one line by scaling the tokens with the width */
  .attention--long .attention__tokens { flex-wrap: nowrap; gap: min(14px, 1.1vw); }
  .attention--long .token { font-size: min(13px, 1.5vw); padding: 0.5em 0.7em; letter-spacing: 0; }
  .quote { padding: 120px var(--gutter); }
  .why, .hero { padding-bottom: 120px; }
}

/* Phone */
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .nav { padding: 20px var(--gutter); }
  .lockup__wordmark { width: 100px; }
  .hero { gap: 32px; padding: 24px var(--gutter) 96px; }
  .hero__line + .hero__line { margin-top: 0.6em; } /* each sentence wraps here, so set them apart */
  .why { gap: 32px; padding: 96px var(--gutter); }
  .why__closer { font-size: 20px; }
  /* Vertical diagram, drawn by main.js; the horizontal image is hidden until it's swapped */
  .why__art { width: min(240px, 100%); aspect-ratio: 240 / 300; }
  .why__art img { display: none; }
  .quote { gap: 32px; padding: 96px var(--gutter); }
  .br-wide { display: none; }
  /* The phrase stays on one line: tokens scale with the screen width, arcs get shorter */
  .attention { padding-top: 64px; }
  .attention__arcs { height: 64px; }
  .attention__tokens { flex-wrap: nowrap; gap: 1.2vw; }
  .token { padding: 0.5em 0.6em; border-radius: 6px; font-size: 2.6vw; letter-spacing: 0; }
  .attention--long .attention__tokens { gap: 0.8vw; }
  .attention--long .token { padding: 0.45em; font-size: 2.1vw; }
  .founder { padding: 0 var(--gutter) 96px; }
  .founder__inner { padding-top: 40px; }
  .cta { padding: 72px var(--gutter) 104px; gap: 24px; }
  .cta__long { display: none; }
  .cta__short { display: inline-block; }
  .cta__title { line-height: 1.25; } /* the title wraps to several lines here; 1.1 felt cramped */
  .footer { gap: 32px; padding: 0 var(--gutter) 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .glow-text, .glow-fill, .glow-border { transition: none; }
}
