/* ==========================================================================
   savvy.dev — static site styles
   Mobile-first. 390px matches the Mobile design, >=1200px matches the Desktop
   design; everything in between interpolates with clamp().
   ========================================================================== */

/* --- tokens --------------------------------------------------------------- */
/* Everything colour-related is a custom property. `:root` is the light theme;
   `html[data-theme="dark"]` further down redefines the same names. Nothing
   below the token blocks hard-codes a colour, so a theme is a token swap. */
:root {
  color-scheme: light;

  /* palette */
  --paper:        #faf9f5;
  --ink:          #1a1917;
  --ink-hover:    #2a2825;
  --secondary:    #6b6760;
  --muted:        #a29d94;
  --accent:       #d97757;
  --accent-soft:  #d9775755;
  --warm:         #f1e6d3;
  --white:        #ffffff;   /* raised surface: tiles, ghost-button hover */
  --card-bg:      #ffffff;   /* screenshot card; in light the inline --tint wins */

  --rule:            rgba(26, 25, 23, .1);
  --hairline:        rgba(26, 25, 23, .08);
  --hairline-strong: rgba(26, 25, 23, .16);
  --sk:              rgba(26, 25, 23, .07);
  --sk-strong:       rgba(26, 25, 23, .12);
  --dash:            rgba(26, 25, 23, .2);
  --on-dark-rule:    rgba(250, 249, 245, .12);
  --notch:           var(--ink);
  --lang-sep:        rgba(26, 25, 23, .25);

  /* dotted grid + dot field (split into channels so the canvas can read them) */
  --dot-rgb:    26 25 23;
  --dot-a:      .14;
  --accent-rgb: 217 119 87;
  --ink-rgb:    26 25 23;

  /* component colours */
  --btn-shadow:         0 1px 2px rgba(26, 25, 23, .12);
  --btn-shadow-hover:   0 12px 28px -8px rgba(26, 25, 23, .35);
  --ghost-border:       rgba(26, 25, 23, .18);
  --ghost-border-hover: rgba(26, 25, 23, .35);
  --ghost-bg-hover:     var(--white);
  --ghost-shadow-hover: 0 12px 28px -10px rgba(26, 25, 23, .25);
  --pill-border:        rgba(26, 25, 23, .14);
  --pill-border-hover:  rgba(26, 25, 23, .35);
  --pill-bg-hover:      rgba(255, 255, 255, .6);
  --card-shadow:        0 30px 60px -24px rgba(26, 25, 23, .28), 0 2px 6px rgba(26, 25, 23, .06);
  --card-shadow-hover:  0 40px 70px -24px rgba(26, 25, 23, .34), 0 2px 6px rgba(26, 25, 23, .06);
  --tile-shadow:        0 30px 50px -20px rgba(26, 25, 23, .28);
  --tile-border:        var(--hairline);
  --eyebrow-dot-glow:   none;

  /* cursor spotlight (weaker in light: the paper is already bright) */
  --spot-glow:   rgba(217, 119, 87, .08);
  --spot-edge-a: rgba(26, 25, 23, .35);
  --spot-edge-b: rgba(217, 119, 87, .35);

  /* footer: a dark block in light, part of the page in dark */
  --footer-bg:           var(--ink);
  --footer-fg:           var(--paper);
  --footer-top:          transparent;
  --footer-rule:         var(--on-dark-rule);
  --footer-border:       rgba(250, 249, 245, .18);
  --footer-border-hover: rgba(250, 249, 245, .5);
  --footer-hover-bg:     rgba(250, 249, 245, .08);
  --wordmark-base:       #f3ede4;

  /* type */
  --font-body:  "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  /* motion */
  --ease: cubic-bezier(.22, 1, .36, 1);

  /* layout */
  --gutter: 20px;
  --shell: 1200px;

  /* fluid type: min at 390px viewport, max at 1240px viewport */
  --fs-logo:      clamp(22px, 21.08px + 0.24vw, 26px);
  --fs-h1:        clamp(46px, 26.73px + 4.94vw, 88px);
  --fs-lede:      clamp(17px, 15.17px + 0.47vw, 21px);
  --fs-eyebrow:   clamp(12px, 11.54px + 0.12vw, 13px);
  --fs-section:   clamp(36px, 32.33px + 0.94vw, 44px);
  --fs-note:      clamp(13px, 12.54px + 0.12vw, 14px);
  --fs-index:     clamp(16px, 15.08px + 0.24vw, 18px);
  --fs-name:      clamp(34px, 27.58px + 1.65vw, 48px);
  --fs-tagline:   clamp(17px, 15.62px + 0.35vw, 20px);
  --fs-desc:      clamp(15px, 14.54px + 0.12vw, 16px);
  --fs-meta:      clamp(12px, 11.54px + 0.12vw, 13px);
  --fs-about:     clamp(22px, 18.33px + 0.94vw, 30px);
  --fs-wordmark:  clamp(44px, 34.82px + 2.35vw, 64px);
  --fs-clock:     clamp(24px, 23.08px + 0.24vw, 26px);
  --fs-marquee:   clamp(22px, 20.16px + 0.47vw, 26px);
  --fs-status:    clamp(14px, 13.54px + 0.12vw, 15px);
  --fs-legal:     clamp(12px, 11.54px + 0.12vw, 13px);

  /* fluid spacing */
  --nav-h:        clamp(64px, 52.98px + 2.82vw, 88px);
  --hero-pt:      clamp(48px, 14.97px + 8.47vw, 120px);
  --hero-pb:      clamp(64px, 29.13px + 8.94vw, 140px);
  --row-py:       clamp(56px, 33.98px + 5.65vw, 104px);
  --about-pt:     clamp(72px, 40.80px + 8.00vw, 140px);
  --about-pb:     clamp(88px, 54.96px + 8.47vw, 160px);
  --marquee-gap:  clamp(36px, 26.82px + 2.35vw, 56px);
}

/* Dark theme. Stricter than light: no ambient glows, only the dotted grid.
   `data-theme` is written by theme-init.js before the first paint. */
html[data-theme="dark"] {
  color-scheme: dark;

  --paper:        #0b0b0a;
  --ink:          #f3f0ea;
  --ink-hover:    #ffffff;
  --secondary:    #a09b93;
  --muted:        #6e6a64;
  --warm:         #2a201c;
  --white:        #121211;   /* tiles */
  --card-bg:      #141413;

  --rule:            rgba(243, 240, 234, .1);
  --hairline:        rgba(243, 240, 234, .08);
  --hairline-strong: rgba(243, 240, 234, .16);
  --sk:              rgba(243, 240, 234, .08);
  --sk-strong:       rgba(243, 240, 234, .14);
  --dash:            rgba(243, 240, 234, .2);
  --notch:           #000000;
  --lang-sep:        #3a3835;

  --dot-rgb: 243 240 234;
  --dot-a:   .16;
  --ink-rgb: 243 240 234;

  --btn-shadow:         none;
  --btn-shadow-hover:   0 16px 36px -12px rgba(243, 240, 234, .35);
  --ghost-border:       rgba(243, 240, 234, .16);
  --ghost-border-hover: rgba(243, 240, 234, .4);
  --ghost-bg-hover:     rgba(243, 240, 234, .05);
  --ghost-shadow-hover: none;
  --pill-border:        rgba(243, 240, 234, .16);
  --pill-border-hover:  rgba(243, 240, 234, .4);
  --pill-bg-hover:      rgba(243, 240, 234, .05);
  --card-shadow:        0 30px 60px -24px rgba(0, 0, 0, .8);
  --card-shadow-hover:  0 40px 70px -24px rgba(0, 0, 0, .9);
  --tile-shadow:        none;
  --tile-border:        rgba(243, 240, 234, .1);
  --eyebrow-dot-glow:   0 0 12px var(--accent);

  --spot-glow:   rgba(217, 119, 87, .16);
  --spot-edge-a: rgba(243, 240, 234, .55);
  --spot-edge-b: rgba(217, 119, 87, .35);

  --footer-bg:           transparent;
  --footer-fg:           var(--ink);
  --footer-top:          var(--rule);
  --footer-rule:         var(--rule);
  --footer-border:       rgba(243, 240, 234, .16);
  --footer-border-hover: rgba(243, 240, 234, .4);
  --footer-hover-bg:     rgba(243, 240, 234, .06);
  --wordmark-base:       #f3f0ea;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Dotted grid behind the whole page, in both themes. Negative z-index puts it
   above the page background and below every bit of content. When the cursor
   effects are running, the dot-field canvas replaces it (see .fx-dots). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgb(var(--dot-rgb) / var(--dot-a)) 1px, transparent 1.4px);
  background-size: 28px 28px;
  background-position: 14px 14px;
}
html[data-fx="on"] body::before { display: none; }

h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

img, svg { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.serif { font-family: var(--font-serif); }
em.serif { font-style: italic; font-weight: 400; }
.accent { color: var(--accent); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: var(--paper); }

.shell {
  width: min(var(--shell), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

/* visibility helpers ------------------------------------------------------- */
.only-lg, .only-lg-br { display: none; }
@media (min-width: 1000px) {
  .only-sm { display: none; }
  .only-lg { display: inline; }
  .only-lg-br { display: inline; }
}

/* --- keyframes ------------------------------------------------------------ */
@keyframes rise    { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes drift   { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(-40px, 30px) scale(1.08); } 100% { transform: translate(0,0) scale(1); } }
@keyframes floatA  { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-18px) rotate(-4deg); } }
@keyframes floatB  { 0%,100% { transform: translateY(0) rotate(4deg); }  50% { transform: translateY(-26px) rotate(7deg); } }
@keyframes floatC  { 0%,100% { transform: translateY(0) rotate(10deg); } 50% { transform: translateY(-14px) rotate(6deg); } }
@keyframes shimmer { 0% { background-position: 200% 50%; } 100% { background-position: -200% 50%; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes spin    { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse   { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .35; } }

/* --- shared components ---------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: var(--btn-shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .25s ease, border-color .25s ease;
  cursor: pointer;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-shadow-hover);
  color: var(--paper);
  background: var(--ink-hover);
}
.btn:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ghost-border);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--ghost-bg-hover);
  color: var(--ink);
  border-color: var(--ghost-border-hover);
  box-shadow: var(--ghost-shadow-hover);
}
.btn svg { flex: none; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  transition: gap .3s var(--ease), color .25s ease;
}
.link-arrow:hover { gap: 14px; color: var(--accent); }
.link-arrow svg { flex: none; }

@media (min-width: 1000px) {
  .btn { height: 52px; }
}

/* --- ambient glow --------------------------------------------------------- */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: drift 14s ease-in-out infinite;
}
.glow--a {
  top: -140px;
  left: 30%;
  width: clamp(360px, 44.4vw, 640px);
  aspect-ratio: 1;
  background: var(--accent-soft);
  opacity: .5;
}
.glow--b { display: none; }

/* The dark theme is stricter: no ambient glows at all, only the dotted grid. */
html[data-theme="dark"] .glow { display: none; }

@media (min-width: 1000px) {
  .glow--a { top: -120px; left: 50%; opacity: .55; }
  .glow--b {
    display: block;
    top: 260px;
    left: 73%;
    width: clamp(300px, 29.2vw, 420px);
    aspect-ratio: 1;
    background: var(--warm);
    opacity: .8;
    animation-delay: -6s;
  }
}

/* --- top (nav + hero) ----------------------------------------------------- */
.top {
  position: relative;
  overflow: clip;
}

.hero-in {
  opacity: 0;
  animation: rise 1.1s var(--ease) forwards;
}
.d1 { animation-delay: .05s; }
.d2 { animation-delay: .18s; }
.d3 { animation-delay: .32s; }
.d4 { animation-delay: .46s; }
.d5 { animation-delay: .60s; }

/* nav */
.nav { position: relative; z-index: 2; }
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--nav-h);
}
.nav__logo {
  font-size: var(--fs-logo);
  letter-spacing: -0.01em;
  line-height: 1;
}
.nav__right {
  display: flex;
  align-items: center;
  gap: 16px;
}
@media (min-width: 1000px) { .nav__right { gap: 36px; } }
.nav-link {
  display: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
  transition: color .25s ease;
}
.nav-link:hover { color: var(--ink); }
.nav__pill {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color .25s ease, background .25s ease, color .25s ease;
}
.nav__pill:hover {
  border-color: var(--pill-border-hover);
  background: var(--pill-bg-hover);
  color: var(--ink);
}
.lang {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 4px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--muted);
  cursor: pointer;
}
.lang__opt { transition: color .25s ease; }
.lang__opt[data-active] { color: var(--ink); }
.lang__sep { color: var(--lang-sep); font-weight: 400; }
.lang:hover .lang__opt:not([data-active]) { color: var(--secondary); }
.lang:focus-visible { outline-offset: 4px; border-radius: 6px; }

/* theme toggle: same weight as the language switch next to it */
.theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 999px;
  color: var(--muted);
  transition: color .25s ease, background .25s ease;
}
.theme:hover { color: var(--ink); background: var(--pill-bg-hover); }
.theme:focus-visible { outline-offset: 2px; border-radius: 999px; }
.theme svg { width: 18px; height: 18px; }
/* Show the icon for the theme the button switches TO. */
.theme__sun { display: none; }
html[data-theme="dark"] .theme__moon { display: none; }
html[data-theme="dark"] .theme__sun { display: block; }

@media (min-width: 1000px) {
  .nav-link { display: inline; }
  .nav__pill { height: 38px; padding: 0 16px; }
}

/* hero */
.hero { position: relative; z-index: 1; }
/* Russian headline is three short lines on desktop; cap it a notch below the English size. */
@media (min-width: 1000px) {
  html[lang="ru"] .hero__title { font-size: min(var(--fs-h1), 80px); }
}
.hero__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: var(--hero-pt) 0 var(--hero-pb);
}
.hero__copy {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 16.33px + 0.94vw, 28px);
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--secondary);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero__eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--eyebrow-dot-glow);
  flex: none;
}
.hero__title {
  font-size: var(--fs-h1);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 600;
  text-wrap: pretty;
}
/* Flashlight headline (cursor effect C). The stack holds the real <h1> plus an
   aria-hidden copy masked to a beam at --mx/--my, which the rAF loop writes.
   Light: the beam tints the letters accent. Dark: the <h1> becomes an outline
   and the beam is the only place the letters are solid.
   With the effects off, the copy is not rendered at all. */
.hero__title-stack { position: relative; }
.hero__title--lit {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  color: var(--accent);
  -webkit-mask-image: radial-gradient(200px circle at var(--mx, -900px) var(--my, -900px), #000 0%, rgba(0, 0, 0, .6) 45%, transparent 75%);
          mask-image: radial-gradient(200px circle at var(--mx, -900px) var(--my, -900px), #000 0%, rgba(0, 0, 0, .6) 45%, transparent 75%);
}
html[data-fx="on"] .hero__title--lit { display: block; }
html[data-fx="on"] .hero__title--lit .accent { color: var(--accent); }

html[data-theme="dark"][data-fx="on"] .hero__title:not(.hero__title--lit),
html[data-theme="dark"][data-fx="on"] .hero__title:not(.hero__title--lit) .accent {
  color: transparent;
  -webkit-text-stroke: 1px var(--hairline-strong);
}
html[data-theme="dark"][data-fx="on"] .hero__title--lit { color: var(--ink); }

.hero__lede {
  font-size: var(--fs-lede);
  line-height: 1.5;
  color: var(--secondary);
  font-weight: 400;
  text-wrap: pretty;
}
.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin-top: 6px;
}

/* floating tiles */
.hero__tiles {
  position: relative;
  height: 150px;
  width: 100%;
  max-width: 350px;
  margin-top: 24px;
}
.tile {
  position: absolute;
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: var(--white);
  border: 1px solid var(--tile-border);
  box-shadow: var(--tile-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.tile svg { width: 38px; height: 38px; }
/* Percentages so the trio still fits when the container is narrower than the
   350px it has at 390px viewport; they resolve to 8 / 132 / 256px there. */
.tile--a { left: 2.3%;   top: 30px; animation: floatA 7s ease-in-out infinite; }
.tile--b { left: 37.7%;  top: 10px; animation: floatB 9s ease-in-out infinite; background: var(--accent); border-color: transparent; color: var(--paper); }
.tile--c { right: 2.9%;  top: 40px; animation: floatC 8s ease-in-out infinite; background: var(--ink);    border-color: transparent; color: var(--paper); }

@media (min-width: 1000px) {
  .hero__inner {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
  }
  .hero__copy { width: 760px; max-width: 760px; flex: 0 1 760px; }
  .hero__lede { max-width: 560px; }
  .hero__title { line-height: 1; letter-spacing: -0.035em; }
  .hero__actions {
    flex-direction: row;
    align-items: center;
    gap: 28px;
    margin-top: 12px;
  }
  .hero__tiles {
    flex: 0 0 auto;
    width: 380px;
    max-width: none;
    height: 400px;
    margin-top: 0;
  }
  .tile { width: 132px; height: 132px; border-radius: 32px; }
  .tile svg { width: 56px; height: 56px; }
  .tile--a { left: 30px;  top: 40px; }
  .tile--b { left: 200px; top: 120px; }
  .tile--c { left: 70px;  right: auto; top: 250px; }
}

/* --- scroll reveal -------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
[data-reveal][data-shown] { opacity: 1; transform: none; }

/* --- projects ------------------------------------------------------------- */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}
.section-title {
  font-size: var(--fs-section);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.section-note {
  font-size: var(--fs-note);
  color: var(--secondary);
  font-weight: 500;
}
@media (min-width: 1000px) {
  .section-head {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 28px;
  }
}

.noscript-note {
  padding: 40px 0;
  font-size: var(--fs-desc);
  color: var(--secondary);
  max-width: 46ch;
}

/* The back cards of a stack lean past the container edge; at narrow desktop
   widths that would poke outside the viewport, so clip horizontally only —
   the toss animation still needs to overflow downwards. */
.projects {
  position: relative;
  overflow-x: clip;
  overflow-y: visible;
}

.project-list { display: flex; flex-direction: column; }

.project {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: var(--row-py) 0;
  border-bottom: 1px solid var(--rule);
}

.project__media {
  order: -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.project__text {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 10.33px + 0.94vw, 22px);
}
.project__index {
  font-size: var(--fs-index);
  color: var(--muted);
  font-style: italic;
  line-height: 1;
}
.project__name {
  font-size: var(--fs-name);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.project__tagline {
  font-size: var(--fs-tagline);
  line-height: 1.4;
  color: var(--ink);
  font-weight: 500;
}
.project__desc {
  font-size: var(--fs-desc);
  line-height: 1.6;
  color: var(--secondary);
  text-wrap: pretty;
}
.project__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(14px, 12.16px + 0.47vw, 18px);
  font-size: var(--fs-meta);
  color: var(--muted);
  font-weight: 500;
}
.project__meta .meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.project__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 8px;
}
.project__actions .link-arrow { align-self: flex-start; margin-top: 4px; }

@media (min-width: 1000px) {
  .project {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 80px;
    /* Pulled 40px wider than the shell with matching padding, so the cursor
       spotlight has a rounded shape to sit in (design/Dark.dc.html). The
       section clips horizontally, so this never adds a scrollbar. */
    margin: 0 -40px;
    padding: var(--row-py) 40px;
    border-radius: 24px;
  }
  .project--flip { flex-direction: row-reverse; }
  .project__media { order: 0; flex: 0 1 560px; min-width: 0; }
  .project__text { flex: 0 1 480px; max-width: 480px; }
  .project__actions {
    flex-direction: row;
    align-items: center;
    gap: 28px;
    margin-top: 10px;
  }
  .project__actions .btn { justify-content: flex-start; }
  .project__actions .link-arrow { align-self: auto; margin-top: 0; }
}

/* --- card stack ----------------------------------------------------------- */
.stack {
  position: relative;
  display: block;
  width: 100%;
  max-width: 318px;
  aspect-ratio: 318 / 210;
  margin-top: 24px;
  background: none;
  border: 0;
  text-align: left;
  /* stack geometry (mobile) */
  --flip: 1;
  --x1: 14px;  --y1: -12px; --r1: 2deg;
  --x2: 28px;  --y2: -24px; --r2: 4deg;
  --lx: -28px; --ly: 48px;  --lr: -8deg;
  --card-radius: 14px;
}
.stack:focus-visible { outline-offset: 8px; }

.stack[data-shape="mobile"] { aspect-ratio: 318 / 400; --phone-radius: 22px; }
.stack[data-shape="mixed"]  { aspect-ratio: 318 / 380; --phone-radius: 20px; }

@media (min-width: 700px) {
  .stack { max-width: 560px; aspect-ratio: 560 / 360; --card-radius: 20px; }
  .stack[data-shape="mobile"] { aspect-ratio: 560 / 480; --phone-radius: 30px; }
  .stack[data-shape="mixed"]  { aspect-ratio: 560 / 440; --phone-radius: 26px; }
}
@media (min-width: 1000px) {
  .stack {
    margin-top: 0;
    --x1: 30px;  --y1: -22px; --r1: 2.5deg;
    --x2: 60px;  --y2: -44px; --r2: 5deg;
    --lx: -48px; --ly: 72px;  --lr: -9deg;
  }
  .project--flip .stack { --flip: -1; }
}

.card {
  position: absolute;
  inset: 0;
  margin: auto;                 /* centred inside the stack box */
  width: 100%;
  max-height: 100%;
  aspect-ratio: 560 / 360;
  border-radius: var(--card-radius);
  background: var(--tint, var(--card-bg));
  border: 1px solid var(--hairline);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transform-origin: 50% 60%;
  transition: transform .75s var(--ease), opacity .45s ease, box-shadow .45s ease;
  will-change: transform;
}

/* Dark cards are one surface colour; the per-card light tints do not apply. */
html[data-theme="dark"] .card { background: var(--card-bg); }

.card--mobile {
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 9 / 19.5;
  border-radius: var(--phone-radius, 26px);
}
.card[data-pos="0"] { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
.card[data-pos="1"] {
  transform: translate(calc(var(--x1) * var(--flip)), var(--y1)) rotate(calc(var(--r1) * var(--flip))) scale(.96);
  opacity: .95;
}
.card[data-pos="2"] {
  transform: translate(calc(var(--x2) * var(--flip)), var(--y2)) rotate(calc(var(--r2) * var(--flip))) scale(.92);
  opacity: .85;
}
/* any deeper card sits behind the third slot, invisible */
.card[data-deep] {
  transform: translate(calc(var(--x2) * var(--flip)), var(--y2)) rotate(calc(var(--r2) * var(--flip))) scale(.9);
  opacity: 0;
}
.card[data-leaving] {
  transform: translate(calc(var(--lx) * var(--flip)), var(--ly)) rotate(calc(var(--lr) * var(--flip))) scale(.9);
  opacity: .55;
}

.stack:hover .card[data-pos="0"]:not([data-leaving]),
.stack:focus-visible .card[data-pos="0"]:not([data-leaving]) {
  box-shadow: var(--card-shadow-hover);
}

.project__counter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.project__counter svg { flex: none; }

/* real screenshots ---------------------------------------------------------- */
.shot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* skeleton "app window" placeholder ---------------------------------------- */
.shot {
  --tb-h: clamp(28px, 10.56%, 38px);
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}
.shot__bar {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.25%, 7px);
  height: var(--tb-h);
  flex: none;
  padding: 0 clamp(12px, 2.86%, 16px);
  border-bottom: 1px solid var(--hairline);
}
.shot__dot {
  display: block;
  width: clamp(8px, 2.08%, 11px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sk-strong);
  flex: none;
}
.shot__chip {
  display: block;
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px dashed var(--dash);
}
.shot__body {
  display: flex;
  gap: clamp(10px, 3.05%, 16px);
  padding: clamp(12px, 3.21%, 18px);
  height: calc(100% - var(--tb-h));
}
.shot__side {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 3.5%, 10px);
  width: 24.8%;
  flex: none;
  height: 100%;
}
.shot__main {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 4.2%, 12px);
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}
.sk { display: block; background: var(--sk); border-radius: 6px; flex: none; }
.shot__side .sk { height: clamp(9px, 4.2%, 12px); }
.shot__side .sk:nth-child(1) { width: 80%; }
.shot__side .sk:nth-child(2) { width: 60%; }
.shot__side .sk:nth-child(3) { width: 70%; }
.shot__side .sk:nth-child(4) { width: 50%; }
.shot__side .sk:nth-child(5) { width: 65%; display: none; }
.shot__head { height: clamp(16px, 9.5%, 26px); width: 55%; background: var(--sk-strong); }
.shot__block {
  height: clamp(84px, 52.8%, 150px);
  width: 100%;
  border-radius: 8px;
  background: var(--block, rgba(217, 119, 87, .16));
}
.shot__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 3.13%, 12px);
  height: clamp(30px, 19.3%, 56px);
  flex: none;
}
.shot__grid .sk { height: 100%; border-radius: 6px; }

@media (min-width: 700px) {
  .shot__chip { font-size: 11px; padding: 4px 10px; }
  .shot__side .sk:nth-child(5) { display: block; }
  .shot__block { border-radius: 12px; }
  .shot__grid .sk { border-radius: 10px; }
}

/* skeleton phone placeholder ---------------------------------------------- */
.shot--phone {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5.5%;
  padding: 13% 7% 5%;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}
.shot__notch {
  position: absolute;
  top: 3.2%;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 4.2%;
  border-radius: 999px;
  background: var(--notch);
  opacity: .85;
}
.shot--phone .shot__chip {
  margin: 0 auto;
  font-size: 8px;
  padding: 3px 7px;
}
.shot__phead {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.shot__ptitle { height: 8%; width: 46%; background: var(--sk-strong); }
.shot__pdot { width: 11%; aspect-ratio: 1; border-radius: 50%; }
.shot--phone .shot__block {
  height: auto;
  flex: 0 0 26%;
  width: 100%;
  border-radius: 10px;
  background: var(--block);
}
.shot__rows {
  display: flex;
  flex-direction: column;
  gap: 4.5%;
  flex: 1 1 auto;
  min-height: 0;
}
.shot__row {
  display: flex;
  align-items: center;
  gap: 5%;
}
.shot__row .sk:last-child { flex: 1 1 auto; height: 6px; }
.shot__row:nth-child(2) .sk:last-child { width: 70%; flex: none; }
.shot__row:nth-child(4) .sk:last-child { width: 55%; flex: none; }
.shot__ricon { width: 12%; aspect-ratio: 1; border-radius: 30%; flex: none; }
.shot__tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10%;
  padding-top: 4%;
  border-top: 1px solid var(--hairline);
}
.shot__tabs .sk { aspect-ratio: 1; border-radius: 30%; width: 60%; margin: 0 auto; }

@media (min-width: 700px) {
  .shot--phone .shot__chip { font-size: 9px; padding: 4px 9px; }
  .shot__row .sk:last-child { height: 9px; }
  .shot--phone .shot__block { border-radius: 14px; }
}

/* "coming soon" actions: visible, not clickable ---------------------------- */
a[data-soon] { cursor: default; }
a[data-soon].btn { opacity: .55; }
a[data-soon].btn:hover { transform: none; box-shadow: var(--btn-shadow); background: var(--ink); }
a[data-soon].btn-ghost:hover { background: transparent; border-color: var(--ghost-border); box-shadow: none; }
a[data-soon].link-arrow { opacity: .55; }
a[data-soon].link-arrow:hover { gap: 8px; color: var(--ink); }

/* --- about ---------------------------------------------------------------- */
.about { padding: var(--about-pt) 0 var(--about-pb); position: relative; }
.about__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.about__text {
  font-size: var(--fs-about);
  line-height: 1.4;
  letter-spacing: -0.01em;
  font-weight: 500;
  text-wrap: pretty;
}
@media (min-width: 1000px) {
  .about__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
  }
  .about__title { flex: 0 0 300px; width: 300px; }
  .about__text { flex: 0 1 720px; width: 720px; line-height: 1.35; letter-spacing: -0.015em; }
}

/* --- footer --------------------------------------------------------------- */
.footer {
  position: relative;
  background: var(--footer-bg);
  color: var(--footer-fg);
  border-top: 1px solid var(--footer-top);
  overflow: hidden;
}
.footer a { color: var(--footer-fg); }
.glow--footer {
  top: -200px;
  left: 41%;
  width: clamp(420px, 41.7vw, 600px);
  aspect-ratio: 1;
  background: var(--accent);
  opacity: .16;
  animation-duration: 18s;
}
@media (min-width: 1000px) {
  .glow--footer { top: -260px; left: 68%; }
}

.footer__top {
  position: relative;
  z-index: 1;
  padding: clamp(56px, 48.66px + 1.88vw, 72px) 0 0;
  display: flex;
  flex-direction: column;
  gap: clamp(36px, 30.49px + 1.41vw, 48px);
}
.footer__hail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer__hail-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}
.wordmark {
  font-family: var(--font-serif);
  font-size: var(--fs-wordmark);
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, var(--wordmark-base) 0%, var(--wordmark-base) 35%, var(--accent) 50%, var(--wordmark-base) 65%, var(--wordmark-base) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}
.mail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--footer-border);
  color: var(--footer-fg);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .3s ease, transform .35s var(--ease), border-color .3s ease;
}
.mail:hover {
  background: var(--footer-hover-bg);
  border-color: var(--footer-border-hover);
  transform: translateY(-2px);
  color: var(--footer-fg);
}
.mail svg { flex: none; }

.totop {
  position: relative;
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--footer-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--footer-fg);
  transition: border-color .3s ease;
}
.totop:hover { border-color: var(--footer-border-hover); }
.totop .ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: spin 18s linear infinite;
}
.totop:hover .ring { animation-duration: 6s; }
.totop .ring text {
  fill: var(--muted);
  font-size: 10.5px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 2.4px;
}
.totop__arrow { width: 16px; height: 16px; }

@media (min-width: 1000px) {
  .footer__hail-left { flex-direction: row; align-items: center; gap: 32px; }
  .totop { width: 88px; height: 88px; }
  .totop__arrow { width: 18px; height: 18px; }
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 20px;
  padding-top: clamp(28px, 24.33px + 0.94vw, 36px);
  border-top: 1px solid var(--footer-rule);
}
.footer__col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.footer__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--secondary);
  line-height: 1.4;
}
.footer__list { display: flex; flex-direction: column; gap: 10px; }
.foot-link {
  display: inline-block;
  color: var(--muted);
  font-size: 15px;
  transition: color .25s ease, padding-left .3s var(--ease);
}
.foot-link:hover { color: var(--footer-fg); padding-left: 6px; }

.clock { display: flex; align-items: center; gap: 10px; }
.clock__dot { position: relative; width: 8px; height: 8px; display: inline-block; flex: none; }
.clock__dot span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
.clock__time {
  font-family: var(--font-serif);
  font-size: var(--fs-clock);
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.footer__status { font-size: var(--fs-status); color: var(--muted); line-height: 1.5; }
.footer__status-name { color: var(--footer-fg); font-size: clamp(16px, 15.08px + 0.24vw, 17px); }

@media (min-width: 1000px) {
  .footer__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; }
  .footer__col { gap: 12px; }
  .footer__list { gap: 12px; }
}

/* marquee */
.marquee {
  position: relative;
  z-index: 1;
  margin-top: clamp(40px, 36.33px + 0.94vw, 48px);
  padding: clamp(14px, 13.08px + 0.24vw, 16px) 0;
  border-top: 1px solid var(--footer-rule);
  overflow: hidden;
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  font-family: var(--font-serif);
  font-size: var(--fs-marquee);
  font-style: italic;
  color: var(--footer-fg);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--marquee-gap);
  margin-right: var(--marquee-gap);
  line-height: 1.3;
}
.marquee__item svg {
  width: clamp(14px, 13.08px + 0.24vw, 16px);
  height: clamp(14px, 13.08px + 0.24vw, 16px);
  flex: none;
  animation: spin 8s linear infinite;
}

.footer__legal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 0 28px;
  font-size: var(--fs-legal);
  color: var(--secondary);
}
@media (min-width: 1000px) {
  .footer__legal {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 0 28px;
  }
}

/* --- cursor effects ------------------------------------------------------- */
/* Everything here needs html[data-fx="on"], which cursor.js sets only on a
   device with a fine pointer and hover, and only when the visitor has not
   asked for reduced motion. Without it the page looks and behaves as before. */

/* a. dot field — a fixed canvas that replaces the static dotted grid */
.fx-dots {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* b. ring cursor. The native cursor goes away; the ring and dot are inert, so
      clicks (the card stacks especially) still land on the real elements. */
html[data-fx="on"], html[data-fx="on"] * { cursor: none !important; }
html[data-fx="on"] input,
html[data-fx="on"] textarea,
html[data-fx="on"] select { cursor: auto !important; }

.fx-dot, .fx-ring {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.fx-dot {
  z-index: 9999;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--accent);
}
.fx-ring {
  z-index: 9998;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 999px;
  border: 1px solid rgb(var(--ink-rgb) / .7);
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease),
              border-radius .35s var(--ease), border-color .3s ease, background .3s ease,
              opacity .2s ease;
}
.fx-dot[data-visible], .fx-ring[data-visible] { opacity: 1; }
.fx-ring[data-mode="link"] {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-color: var(--accent);
  background: rgb(var(--accent-rgb) / .08);
}
.fx-ring[data-mode="magnet"] {
  border-color: rgb(var(--ink-rgb) / .35);
  background: rgb(var(--ink-rgb) / .04);
}
/* magnets lean toward the pointer; the inline transform springs back on leave */
html[data-fx="on"] .stack { transition: transform .45s var(--ease); }

/* c. + d. spotlight: a glow that follows the pointer plus a lit 1px edge, on
      every project row, the front card of each stack and the hero tiles. */
html[data-fx="on"] .project { position: relative; }
html[data-fx="on"] .project,
html[data-fx="on"] .tile,
html[data-fx="on"] .card[data-pos="0"] { isolation: isolate; }

html[data-fx="on"] .project::before,
html[data-fx="on"] .tile::before,
html[data-fx="on"] .card[data-pos="0"]::before,
html[data-fx="on"] .project::after,
html[data-fx="on"] .tile::after,
html[data-fx="on"] .card[data-pos="0"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .45s ease;
}
html[data-fx="on"] .project::before,
html[data-fx="on"] .tile::before,
html[data-fx="on"] .card[data-pos="0"]::before {
  z-index: 1;
  background: radial-gradient(420px circle at var(--mx, -900px) var(--my, -900px), var(--spot-glow), transparent 60%);
}
html[data-fx="on"] .project::after,
html[data-fx="on"] .tile::after,
html[data-fx="on"] .card[data-pos="0"]::after {
  z-index: 2;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx, -900px) var(--my, -900px), var(--spot-edge-a), var(--spot-edge-b) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
}
html[data-fx="on"] .project:hover::before,
html[data-fx="on"] .project:hover::after,
html[data-fx="on"] .tile:hover::before,
html[data-fx="on"] .tile:hover::after,
html[data-fx="on"] .stack:hover .card[data-pos="0"]::before,
html[data-fx="on"] .stack:hover .card[data-pos="0"]::after { opacity: 1; }

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

  .glow,
  .tile,
  .wordmark,
  .marquee__track,
  .marquee__item svg,
  .totop .ring,
  .clock__dot span {
    animation: none !important;
  }

  .hero-in { opacity: 1; animation: none !important; }

  [data-reveal] { opacity: 1; transform: none; transition: none; }

  .card { transition: opacity .2s linear; }
  .card[data-leaving] { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0; }

  .btn, .btn:hover,
  .mail, .mail:hover { transform: none; transition: background .2s ease, border-color .2s ease, color .2s ease; }

  .link-arrow, .foot-link { transition: color .2s ease; }
  .link-arrow:hover { gap: 8px; }
  .foot-link:hover { padding-left: 0; }
}
