/* ==========================================================================
   Scrollivo — Digital Studio
   styles.css : tokens, base, layout, components
   (media queries live in responsive.css)

   REBUILT FILE — the original styles.css from this project's first build
   could not be located on disk and was never captured in full in the chat
   history used to reconstruct this project, so this is a fresh, from-scratch
   implementation matching the design language established by the rest of the
   codebase (sections.css, founders.js, three-background.js): purple/white
   brand system (#651FFF / #ffffff), circular-reveal intro with an O.o mark
   that FLIPs into the nav, custom cursor, reveal-on-scroll utility class.
   Re-check against the live site once you compare with any older backup.
   ========================================================================== */

/* ---------- Tokens ---------------------------------------------------- */
:root {
  --bg: #651FFF;
  --accent: #ffffff;
  --accent-ink: #651FFF;

  --fg: #ffffff;
  --fg-muted: rgba(255, 255, 255, 0.72);
  --fg-faint: rgba(255, 255, 255, 0.5);

  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.4);

  --bg-raised: rgba(255, 255, 255, 0.04);
  --bg-soft: rgba(255, 255, 255, 0.07);
  --bg-deep: rgba(0, 0, 0, 0.18);

  --shell: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- Reset -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -50px; left: 1rem; z-index: 999;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.75rem 1.25rem; border-radius: var(--r-sm);
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

/* ---------- Scroll locks --------------------------------------------------
   Three independent owners can each demand a locked scroll: the intro cover
   (is-locked), the mobile menu (menu-open), and the founder CV view
   (cv-open). None of them should clobber another, so each gets its own
   class and the rule below just unions them. */
body.is-locked,
body.menu-open,
body.cv-open { overflow: hidden; height: 100%; }
html:has(body.is-locked),
html:has(body.menu-open),
html:has(body.cv-open) { overflow: hidden; }

/* ---------- Layout shell -------------------------------------------------- */
.shell {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main { position: relative; z-index: 1; }

.section {
  position: relative;
  padding-block: clamp(4rem, 10vw, 8rem);
}
.section__head { max-width: 60ch; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section__index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--fg-faint);
  margin-bottom: 0.75rem;
}
.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 0.75rem;
}
.section__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.section__lead {
  margin-top: 1rem;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--fg-muted);
  max-width: 52ch;
}

/* ---------- Buttons -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.35s var(--ease), background-color 0.3s var(--ease),
              color 0.3s var(--ease);
}
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { transform: translateY(-2px); }
.btn__icon { width: 15px; height: 15px; transition: transform 0.3s var(--ease); }
.btn:hover .btn__icon { transform: translateX(3px); }

/* ---------- Header / nav --------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;
  padding-block: 1.25rem;
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 1.5px;
  margin-inline: auto;
  background: var(--fg);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
body.menu-open .nav-toggle__bar:first-child { transform: translateY(3.25px) rotate(45deg); }
body.menu-open .nav-toggle__bar:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}
.nav__link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--fg-muted);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--fg);
  transition: right 0.35s var(--ease);
}
.nav__link:hover, .nav__link:focus-visible { color: var(--fg); }
.nav__link:hover::after, .nav__link:focus-visible::after { right: 0; }

/* Brand lockup — sized in em so intro-logo ↔ nav-brand can share one FLIP
   transform. Stays static in the header (no float/spin/pupils here). */
.brand { display: inline-flex; }
.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: 16px; /* base unit the FLIP math scales from */
  color: var(--fg);
}
.mark--nav { font-size: 15px; }
.mark__symbol { width: 2.2em; height: auto; overflow: visible; }
.mark__word {
  font-weight: 700;
  font-size: 0.85em;
  letter-spacing: 0.02em;
}
.mark--nav .mark__word { display: none; }
@media (min-width: 560px) {
  .mark--nav .mark__word { display: inline; font-size: 0.62em; }
}
.mark__pupil { transition: none; }
.mark--nav .mark__pupil,
.mark--static .mark__pupil { display: none; }

/* ---------- Hero ------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  overflow: clip;
}
.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-orb {
  position: absolute;
  top: 50%; right: 8%;
  width: min(46vw, 620px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.55), rgba(255,255,255,0.05) 60%);
  filter: blur(2px);
  opacity: 0.5;
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero__inner { position: relative; z-index: 1; }
.hero__title {
  margin-top: 0.75rem;
  font-size: clamp(2.75rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line__inner { display: block; }

.hero__foot {
  margin-top: clamp(2rem, 5vw, 3rem);
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  flex-wrap: wrap;
}
.hero__supporting { max-width: 42ch; color: var(--fg-muted); }

.hero__scroll {
  margin-top: clamp(3rem, 8vw, 5rem);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.hero__scroll-line { width: 28px; height: 1px; background: var(--line-strong); }

/* ---------- About ------------------------------------------------------------ */
.about__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); }
.about__lead { font-size: clamp(1.15rem, 2vw, 1.5rem); }
.about__text { margin-top: 1.25rem; color: var(--fg-muted); max-width: 60ch; }
.about__details {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: grid;
  gap: 1rem;
  max-width: 32rem;
}
.about__detail {
  display: flex;
  justify-content: space-between;
  padding-block: 0.85rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}
.about__detail dt { color: var(--fg-faint); }

/* ---------- Services --------------------------------------------------------- */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.service {
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
}
.service__title { font-size: 1.35rem; font-weight: 700; }
.service__text { margin-top: 0.85rem; color: var(--fg-muted); }

/* ---------- Featured work (Our Work) ------------------------------------------ */
.projects { display: grid; gap: clamp(2.5rem, 6vw, 5rem); }
.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.project__frame {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-deep);
}
.project__frame img { width: 100%; height: auto; }
.project__name { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; }
.project__text { margin-top: 0.75rem; color: var(--fg-muted); max-width: 48ch; }
.project__link {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

/* ---------- Skills marquee ---------------------------------------------------- */
.marquee {
  margin-block: clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.marquee__track {
  display: flex;
  gap: 3rem;
  padding-block: 1rem;
  white-space: nowrap;
  animation: marquee 22s linear infinite;
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee__item {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.skill-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}
.skill {
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: center;
  font-weight: 600;
}

/* ---------- Process ------------------------------------------------------------ */
.process {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.process__step {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-faint);
}
.process__title { margin-top: 0.9rem; font-size: 1.25rem; font-weight: 700; }
.process__text { margin-top: 0.5rem; color: var(--fg-muted); }

/* ---------- Contact -------------------------------------------------------------- */
.contact__title {
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.98;
  text-transform: uppercase;
}
.contact__title .line { display: block; overflow: hidden; }
.contact__title .line__inner { display: block; }
.contact__intro { margin-top: 1.5rem; max-width: 48ch; color: var(--fg-muted); }
.contact__links {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.contact__links a {
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 600;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.contact__links a:hover { background: var(--fg); color: var(--accent-ink); }
.contact__empty { margin-top: 1.5rem; color: var(--fg-faint); }

/* ---------- Footer ------------------------------------------------------------ */
.site-footer { padding-block: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--line); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.site-footer__name { font-weight: 700; }
.site-footer__role { color: var(--fg-faint); font-size: 0.85rem; }
.site-footer__note { color: var(--fg-muted); font-size: 0.9rem; }
.site-footer__meta { display: flex; align-items: center; gap: 1.5rem; color: var(--fg-faint); font-size: 0.85rem; }
.to-top { display: inline-flex; align-items: center; gap: 0.4rem; }
.to-top svg { width: 14px; height: 14px; }

/* ---------- Cursor -------------------------------------------------------------- */
.cursor { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.cursor__dot, .cursor__ring { position: fixed; top: 0; left: 0; border-radius: 50%; }
.cursor__dot { width: 6px; height: 6px; background: var(--fg); transform: translate(-50%, -50%); }
.cursor__ring {
  width: 34px; height: 34px; border: 1px solid var(--line-strong);
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), border-color 0.25s var(--ease);
}
.cursor__label { display: none; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Grain ---------------------------------------------------------------- */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.03; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Reveal-on-scroll utility --------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .marquee__track { animation: none; }
}
