/* ==========================================================================
   Efe Çavuşoğlu — personal site
   Design language: art deco poster hall. Warm paper, brass engraving,
   deep Rapture teal. Each app gets its own poster color.
   --------------------------------------------------------------------------
   Palette rule: brass draws the architecture (rules, ticks, frames).
   Each app section overrides --a / --a-tint with its own identity.
   ========================================================================== */

:root{
  --paper:   #F4EDDF;   /* base — warm gallery paper */
  --paper-2: #ECE2CB;   /* raised panel */
  --ink:     #2B2416;   /* near-black warm brown */
  --dim:     #6E6250;   /* secondary text */
  --rule:    #D9CCAC;   /* hairlines */
  --brass:   #A87C2A;   /* engraved metal — structure, ticks */
  --gold:    #C99B3F;   /* brighter brass, hovers */
  --teal:    #14555A;   /* Rapture ocean — footer, deep accents */
  --red:     #C7402D;   /* poster red — sparing */

  /* per-app accent, overridden on each .app-- modifier */
  --a: var(--brass);
  --a-tint: var(--paper-2);

  --display: 'Limelight', 'Futura', 'Century Gothic', serif;
  --body:    'Josefin Sans', 'Futura', 'Trebuchet MS', sans-serif;

  --gut: clamp(20px, 5vw, 48px);
  --max: 1180px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

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

html{
  scroll-behavior: smooth;
  scroll-padding-top: 84px;   /* clears the fixed top bar on anchor jumps */
  -webkit-text-size-adjust: 100%;
}

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img{ max-width: 100%; display: block; }
ul, ol, dl, dd{ margin: 0; padding: 0; list-style: none; }
p{ margin: 0; }
h1, h2, h3{ margin: 0; font-weight: 400; }

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

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

.skip{
  position: fixed;
  top: 8px; left: 8px;
  z-index: 99;
  padding: 10px 16px;
  background: var(--teal);
  color: var(--paper);
  font-size: 13px;
  letter-spacing: .08em;
  transform: translateY(-200%);
}
.skip:focus{ transform: none; }

.shell{
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gut);
}

/* ── Type primitives ─────────────────────────────────────────────────── */

.eyebrow{
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--brass);
}
/* deco diamond before every eyebrow */
.eyebrow::before{
  content: "";
  width: 8px; height: 8px;
  background: var(--brass);
  transform: rotate(45deg);
  flex: none;
}

/* Tick scale — brass engraving. Minor ticks every 11px, major every 66px. */
.scale{
  height: 16px;
  border-bottom: 2px solid var(--brass);
  background-image:
    repeating-linear-gradient(90deg, var(--brass) 0 1px, transparent 1px 66px),
    repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 11px);
  background-size: 100% 13px, 100% 6px;
  background-position: left bottom, left bottom;
  background-repeat: no-repeat;
  transform-origin: left center;
}

/* ── Top bar — spans the content column, items evenly distributed ────── */
.topbar{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.topbar__inner{
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 44px);
  padding-block: 11px;
}
/* Rule is drawn inside the gutter so it starts exactly where the hero name
   does, rather than running the full bleed of the bar. */
.topbar__inner::after{
  content: "";
  position: absolute;
  left: var(--gut); right: var(--gut); bottom: 0;
  height: 1px;
  background: var(--rule);
}

/* Every section is always listed — no hover-to-discover. The nav takes the
   remaining width and spreads its five stops across it. */
.topnav{
  flex: 1;
  display: flex;
  justify-content: space-between;
}

.topnav__link{
  position: relative;
  display: block;
  padding: 7px 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--dim);
  transition: color .22s var(--ease);
}
/* brass underline wipes in on hover, red locks in on the active section */
.topnav__link::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s var(--ease), background-color .28s var(--ease);
}
.topnav__link:hover{ color: var(--ink); }
.topnav__link:hover::after{ transform: scaleX(1); }
.topnav__link.is-active{ color: var(--ink); }
.topnav__link.is-active::after{ transform: scaleX(1); background: var(--red); }

/* Narrow screens: type tightens so all five stops still fit on one line. */
/* CV is a separate page, not a section — brass rule marks it as an exit. */
.topnav__link--cv{
  padding-inline: 9px;
  border: 1px solid var(--rule);
  color: var(--brass);
}
.topnav__link--cv:hover{ color: var(--ink); border-color: var(--brass); }

@media (max-width: 620px){
  .topbar__inner{ gap: 12px; padding-block: 8px; }
  .topnav__link{ font-size: 10px; letter-spacing: .1em; }
  .topnav__link--cv{ padding-inline: 6px; }
  .theme-toggle{ width: 32px; height: 32px; }
}
@media (max-width: 480px){
  .topbar__inner{ gap: 8px; }
  .topnav__link{ font-size: 9px; letter-spacing: .04em; }
  .topnav__link--cv{ padding-inline: 5px; }
}
/* Six stops no longer fit on one line — Top is implied by the logo-less
   masthead below, so it drops out rather than squeezing the rest. */
@media (max-width: 400px){
  .topnav__link[href="#top"]{ display: none; }
}

/* Deco divider between sections — rule, diamond, rule */
.divider{
  display: flex;
  align-items: center;
  gap: 18px;
}
.divider::before,
.divider::after{
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.divider span{
  width: 9px; height: 9px;
  border: 1px solid var(--brass);
  transform: rotate(45deg);
  flex: none;
}

/* ── Gauge rail ──────────────────────────────────────────────────────── */

/* A gauge, not a menu: how far the visitor has got through knowing me.
   Needs clear space beside the 1180px shell, so it starts at 1280px. */

.rail{ display: none; }

@media (min-width: 1280px){
  .rail{
    display: flex;
    align-items: center;
    gap: 13px;
    position: fixed;
    top: 50%;
    left: 22px;
    transform: translateY(-50%);
    z-index: 20;
  }

  .rail__track{
    position: relative;
    display: block;
    flex: none;
    width: 2px;
    height: min(44vh, 300px);
    background: var(--rule);
  }
  .rail__fill{
    position: absolute;
    top: 0; left: 0;
    display: block;
    width: 2px;
    height: 0;
    background: var(--brass);
    transition: height .18s linear;
  }
  /* travelling diamond marks the needle position */
  .rail__fill::after{
    content: "";
    position: absolute;
    left: 50%; bottom: 0;
    width: 9px; height: 9px;
    background: var(--red);
    transform: translate(-50%, 50%) rotate(45deg);
  }

  .rail__readout{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 40px;
  }
  .rail__pct{
    font-family: var(--display);
    font-size: 15px;
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  /* stage name runs vertically — deco, and keeps the rail narrow */
  .rail__stage{
    writing-mode: vertical-rl;
    max-height: min(30vh, 210px);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--dim);
    transition: color .3s var(--ease);
  }

  /* The rail is fixed, so the teal footer eventually scrolls underneath it.
     Ink-on-teal measures 1.8:1 — invisible. JS flags the overlap and the
     gauge inverts to the footer's own paper-and-gold palette. */
  .rail__pct,
  .rail__track,
  .rail__fill,
  .rail__fill::after{
    transition: color .3s var(--ease), background-color .3s var(--ease);
  }
  .rail.is-over-dark .rail__pct{ color: #F4EDDF; }
  .rail.is-over-dark .rail__stage{ color: rgba(244, 237, 223, .8); }
  .rail.is-over-dark .rail__track{ background: rgba(244, 237, 223, .3); }
  .rail.is-over-dark .rail__fill{ background: var(--gold); }
  .rail.is-over-dark .rail__fill::after{ background: var(--gold); }
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero{
  position: relative;
  min-height: min(78svh, 700px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(56px, 10vh, 104px) clamp(40px, 6vh, 64px);
}

/* sunburst — faint gold rays fanning up from beneath the name */
.hero::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-conic-gradient(from -32deg at 18% 78%,
      rgba(168,124,42,.10) 0deg 2deg,
      transparent 2deg 9deg);
  -webkit-mask-image: radial-gradient(90% 80% at 18% 78%, #000 0%, transparent 62%);
  mask-image: radial-gradient(90% 80% at 18% 78%, #000 0%, transparent 62%);
  pointer-events: none;
}

.hero__meta{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--dim);
}

.dot{
  width: 8px; height: 8px;
  background: var(--red);
  transform: rotate(45deg);
}

.hero__name{
  margin-top: clamp(22px, 4vh, 38px);
  font-family: var(--display);
  font-size: clamp(2.3rem, 7.6vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: .015em;
  text-transform: uppercase;
  color: var(--ink);
  /* letterpress offset, poster-style */
  text-shadow: 0.045em 0.045em 0 rgba(201,155,63,.55);
}
.hero__name span{ display: block; }

.hero__lede{
  margin-top: clamp(24px, 3.6vh, 34px);
  max-width: 36ch;
  font-size: clamp(1.2rem, 2.7vw, 1.6rem);
  line-height: 1.5;
  color: var(--dim);
}
.hero__lede b{ color: var(--teal); font-weight: 700; }

.hero .scale{ margin-top: clamp(26px, 4vh, 40px); }

.links{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.link{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px 10px;
  border: 1px solid var(--ink);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--brass); /* deco double frame */
  background: var(--paper);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  transition: background-color .22s var(--ease), color .22s var(--ease), transform .22s var(--ease);
}
.link__ico{ width: 15px; height: 15px; fill: currentColor; flex: none; }

a.link:hover{
  background: var(--teal);
  border-color: var(--teal);
  color: var(--paper);
  transform: translateY(-2px);
}

.link--pending{ opacity: .45; cursor: default; }
.link__soon{
  padding: 2px 7px 1px;
  border: 1px solid var(--brass);
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--brass);
}

/* ── Sections ────────────────────────────────────────────────────────── */

.section{ padding-block: clamp(48px, 8vh, 84px); }

.shead{ margin-bottom: clamp(26px, 4.5vh, 40px); }
.shead__title{
  margin-top: 18px;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4.6vw, 3rem);
  line-height: 1.12;
  text-transform: uppercase;
  letter-spacing: .01em;
}

/* ── App panels — each one a poster in its own color ─────────────────── */

/* Accents lifted from each app's own design tokens
   (FigdexTokens.swift, EthoTokens.swift, DesignSystem.swift). */
.app--figdex       { --a: #1E3A5F; --a-deep: #0D1B2A; --a-tint: #F7EFC8; --a-pop: #FFD700; } /* navy + LEGO yellow */
.app--myetho       { --a: #C2551A; --a-deep: #7E3610; --a-tint: #FAE3D2; --a-pop: #FF7A35; } /* Etho orange */
.app--portfoliolab { --a: #2E6FAE; --a-deep: #1A4F7C; --a-tint: #DEEBF6; --a-pop: #5BA8E0; } /* market blue */

.app{
  display: grid;
  gap: clamp(30px, 5vw, 54px);
  padding: clamp(24px, 4vw, 44px);
  margin-bottom: clamp(20px, 3vh, 32px);
  background: var(--a-tint);
  border: 1px solid var(--a);
  box-shadow: inset 0 0 0 4px var(--a-tint), inset 0 0 0 5px var(--a); /* double frame */
}
.app:last-child{ margin-bottom: 0; }

@media (min-width: 900px){
  .app{
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    align-items: start;
  }
}

.app__head{
  display: flex;
  align-items: center;
  gap: 16px;
}
.app__icon{
  width: 64px; height: 64px;
  border-radius: 15px;
  border: 1px solid var(--a);
  background: var(--paper);
  flex: none;
}
.app__name{
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--a-deep);
}
.app__kicker{
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--a);
}

.app__desc{
  margin-top: 22px;
  color: var(--ink);
  max-width: 46ch;
}

.tags{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.tags li{
  padding: 6px 11px 5px;
  border: 1px solid var(--a);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--a-deep);
  background: var(--paper);
}

/* Status badge. Same box whether it's a beta note or a live store link. */
.badge{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 10px 15px 9px;
  background: var(--a-deep);
  color: var(--paper);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: background-color .22s var(--ease);
}
.badge__dot{
  width: 6px; height: 6px;
  background: var(--a-pop, var(--gold));
  transform: rotate(45deg);
  flex: none;
}
a.badge:hover{ background: var(--a); }

/* ── Phone mockups ───────────────────────────────────────────────────── */

.app__shots{
  display: flex;
  gap: clamp(12px, 2.4vw, 22px);
  /* mobile: swipeable row that bleeds to the panel edge */
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-inline: calc(clamp(24px, 4vw, 44px) * -1);
  padding-inline: clamp(24px, 4vw, 44px);
  padding-block: 4px 12px;
  scrollbar-width: none;
}
.app__shots::-webkit-scrollbar{ display: none; }

.phone{
  flex: 0 0 min(58vw, 232px);
  scroll-snap-align: center;
  position: relative;
  aspect-ratio: 390 / 844;
  padding: 6px;
  border-radius: 30px;
  border: 1px solid var(--a-deep);
  background: linear-gradient(160deg, #3A3226, #191510);
  box-shadow: 0 20px 40px -24px rgba(43,36,22,.55);
  transition: transform .4s var(--ease);
}
.phone img{
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 24px;
  background: #101418;
}
/* (screenshots carry their own status bar + Dynamic Island) */

@media (min-width: 900px){
  .app__shots{
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
    justify-content: flex-end;
    padding-block: 0 44px;
  }
  .phone{ flex: 0 1 214px; }
  /* Stepped stagger — reads as a diagonal, not a random fan. */
  .phone:nth-child(2){ transform: translateY(22px); }
  .phone:nth-child(3){ transform: translateY(44px); }

  .app__shots:hover .phone:nth-child(1){ transform: translateY(-6px); }
  .app__shots:hover .phone:nth-child(2){ transform: translateY(16px); }
  .app__shots:hover .phone:nth-child(3){ transform: translateY(38px); }
}

/* ── About ───────────────────────────────────────────────────────────── */

.about{
  display: grid;
  gap: clamp(28px, 4vw, 48px);
}
/* Portrait and prose share the top row; the facts ledger spans the full width
   beneath them. Two columns instead of three means the prose keeps a readable
   measure at every width — the old third column squeezed it to ~41ch. */
@media (min-width: 820px){
  .about{
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
  }
  .portrait    { grid-column: 1; grid-row: 1; max-width: 220px; }
  .about__prose{ grid-column: 2; grid-row: 1; }
  .facts       { grid-column: 1 / -1; grid-row: 2; }
}

/* Portrait — framed like the deco link buttons: hairline plus a brass offset
   rule, so it reads as part of the same engraved system, not a pasted photo. */
.portrait{
  margin: 0;
  position: relative;
  align-self: start;
  max-width: 300px;
}
.portrait img{
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--ink);
  /* deco double frame, matching .link */
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--brass);
  filter: saturate(.92);
}
@media (max-width: 859px){
  .portrait{ max-width: 220px; }
}

.about__prose{
  display: grid;
  gap: 18px;
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--ink);
  max-width: 54ch;
}
.about__prose strong{ color: var(--teal); font-weight: 700; }

/* Inline prose links (e.g. the CV reference). Teal + brass underline so they
   read as clickable — .facts__of would make them dimmer than the surrounding
   text, which is backwards for a link. */
.about__prose a{
  color: var(--teal);
  font-weight: 600;
  border-bottom: 1px solid var(--brass);
  padding-bottom: 1px;
  transition: color .22s var(--ease), border-color .22s var(--ease);
}
.about__prose a:hover{ color: var(--brass); border-color: var(--ink); }

/* Ledger of facts. Full width under the portrait and prose, so it splits into
   columns rather than stretching seven rows across the whole measure. */
.facts{
  border-top: 2px solid var(--brass);
  font-size: 14.5px;
}
/* Multi-column rather than a grid: grid rows stretch to the tallest cell, which
   left three lines of dead space under short entries like Role. Columns let
   each row keep its natural height and pack tight. */
@media (min-width: 820px){
  .facts{
    columns: 2;
    column-gap: clamp(32px, 5vw, 64px);
  }
  .facts > div{ break-inside: avoid; }
}
.facts > div{
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
}
.facts dt{
  color: var(--brass);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 11.5px;
  padding-top: 3px;
}
.facts dd{ color: var(--ink); font-weight: 600; }
.facts__of{ color: var(--dim); font-weight: 400; }

/* ── Stack ───────────────────────────────────────────────────────────── */

.stack{
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 2px solid var(--brass);
  border-bottom: 2px solid var(--brass);
}
.stack li{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px clamp(14px, 2.4vw, 24px);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink);
  flex: 1 1 auto;
  white-space: nowrap;
}
/* deco diamond in front of every entry */
.stack li::before{
  content: "";
  width: 6px; height: 6px;
  background: var(--brass);
  transform: rotate(45deg);
  flex: none;
}

/* languages get their own quieter line */
.stack--lang{ border-top: 0; }
.stack--lang li{ padding-block: 13px; }
.stack--lang li::before{ background: var(--teal); }
.stack__note{
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* ── Footer — down into the ocean ────────────────────────────────────── */

.footer{
  margin-top: clamp(24px, 4vh, 48px);
  padding-block: clamp(44px, 7vh, 72px) 32px;
  background: var(--teal);
  color: var(--paper);
  border-top: 6px double var(--gold);

  /* Closing plate. Also the page's scroll runway: without it #contact is the
     last thing on the page and clamps to the bottom, landing on the same
     screen as #stack. Content spreads to fill, so this reads as a deliberate
     panel rather than dead space. */
  min-height: min(100svh, 700px);
  display: flex;
  flex-direction: column;
}
.footer > .shell{
  flex: 1;
  display: flex;
  flex-direction: column;
}
.footer__grid{ margin-block: auto; }   /* centred between the scale and the baseline */

.footer .scale{
  border-bottom-color: var(--gold);
  background-image:
    repeating-linear-gradient(90deg, var(--gold) 0 1px, transparent 1px 66px),
    repeating-linear-gradient(90deg, rgba(244,237,223,.35) 0 1px, transparent 1px 11px);
}

.footer .eyebrow{ color: var(--gold); }
.footer .eyebrow::before{ background: var(--gold); }

.footer__grid{
  display: grid;
  gap: 34px;
  padding-top: clamp(30px, 5vh, 48px);
}
@media (min-width: 720px){
  .footer__grid{
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
}

.footer__mail{
  display: inline-block;
  margin-top: 18px;
  font-family: var(--display);
  font-size: clamp(1.25rem, 4vw, 2.1rem);
  line-height: 1.15;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 5px;
  transition: color .22s var(--ease), border-color .22s var(--ease);
  overflow-wrap: anywhere;
}
.footer__mail:hover{ color: var(--gold); }

.footer__phone{
  margin-top: 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .08em;
}
.footer__phone a{
  border-bottom: 1px solid rgba(201,155,63,.45);
  padding-bottom: 2px;
  transition: color .22s var(--ease), border-color .22s var(--ease);
}
.footer__phone a:hover{ color: var(--gold); border-color: var(--gold); }

.footer__loc{
  margin-top: 16px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(244,237,223,.72);
}

.footer__links{
  display: grid;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(244,237,223,.72);
}
.footer__links a{ transition: color .22s var(--ease); }
.footer__links a:hover{ color: var(--gold); }
.footer__pending{ opacity: .5; }

.footer__base{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  margin-top: clamp(34px, 5vh, 56px);
  padding-top: 20px;
  border-top: 1px solid rgba(244,237,223,.25);
  font-size: 12.5px;
  letter-spacing: .1em;
  color: rgba(244,237,223,.6);
}

/* ── Motion ──────────────────────────────────────────────────────────── */

/* Scroll reveals. Scoped to .js so the page is fully readable without JS. */
.js [data-reveal]{
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js [data-reveal].is-in{ opacity: 1; transform: none; }

/* Hero load sequence — one orchestrated moment, then the page settles. */
.js [data-load]{
  opacity: 0;
  animation: rise .8s var(--ease) forwards;
  animation-delay: calc(var(--d, 0) * 90ms + 60ms);
}
.js .scale[data-load]{ animation-name: draw; animation-duration: 1s; }

@keyframes rise{
  from{ opacity: 0; transform: translateY(18px); }
  to{ opacity: 1; transform: none; }
}
@keyframes draw{
  from{ opacity: 0; transform: scaleX(0); }
  to{ opacity: 1; transform: scaleX(1); }
}

/* ── Dark mode — the poster hall at night ────────────────────────────── */
/* Two triggers, same look: an explicit choice via the toggle
   (html[data-theme]) always wins; otherwise the system setting decides. */

:root[data-theme="dark"]{
  --paper:   #171310;
  --paper-2: #201A14;
  --ink:     #EDE4D3;
  --dim:     #A69880;
  --rule:    #383021;
  --brass:   #B08434;
  --gold:    #D2A648;
  --red:     #D4553F;
}
html[data-theme="dark"] .app--figdex       { --a: #3A5E8C; --a-deep: #F5CE3E; --a-tint: #131E2C; }
html[data-theme="dark"] .app--myetho       { --a: #B85A24; --a-deep: #FF9A5C; --a-tint: #241510; }
html[data-theme="dark"] .app--portfoliolab { --a: #3A6E9E; --a-deep: #8CC0EE; --a-tint: #0F1C29; }
html[data-theme="dark"] .badge{ color: #171310; font-weight: 700; }
html[data-theme="dark"] .badge__dot{ background: currentColor; }
html[data-theme="dark"] .stack--lang li::before{ background: #2E8C94; }
html[data-theme="dark"] :focus-visible{ outline-color: var(--gold); }
html[data-theme="dark"] .hero__lede b,
html[data-theme="dark"] .about__prose a,
html[data-theme="dark"] .about__prose strong{ color: #52B0BC; }
html[data-theme="dark"] .hero::before{
  background:
    repeating-conic-gradient(from -32deg at 18% 78%,
      rgba(176,132,52,.14) 0deg 2deg,
      transparent 2deg 9deg);
}
html[data-theme="dark"] .phone{ box-shadow: 0 20px 40px -22px rgba(0,0,0,.85); }

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --paper:   #171310;
    --paper-2: #201A14;
    --ink:     #EDE4D3;
    --dim:     #A69880;
    --rule:    #383021;
    --brass:   #B08434;
    --gold:    #D2A648;
    --red:     #D4553F;
  }
  html:not([data-theme="light"]) .app--figdex       { --a: #3A5E8C; --a-deep: #F5CE3E; --a-tint: #131E2C; }
  html:not([data-theme="light"]) .app--myetho       { --a: #B85A24; --a-deep: #FF9A5C; --a-tint: #241510; }
  html:not([data-theme="light"]) .app--portfoliolab { --a: #3A6E9E; --a-deep: #8CC0EE; --a-tint: #0F1C29; }
  html:not([data-theme="light"]) .badge{ color: #171310; font-weight: 700; }
  html:not([data-theme="light"]) .badge__dot{ background: currentColor; }
  html:not([data-theme="light"]) .stack--lang li::before{ background: #2E8C94; }
  html:not([data-theme="light"]) :focus-visible{ outline-color: var(--gold); }
  html:not([data-theme="light"]) .hero__lede b,
  html:not([data-theme="light"]) .about__prose a,
  html:not([data-theme="light"]) .about__prose strong{ color: #52B0BC; }
  html:not([data-theme="light"]) .hero::before{
    background:
      repeating-conic-gradient(from -32deg at 18% 78%,
        rgba(176,132,52,.14) 0deg 2deg,
        transparent 2deg 9deg);
  }
  html:not([data-theme="light"]) .phone{ box-shadow: 0 20px 40px -22px rgba(0,0,0,.85); }
}

/* Theme toggle — deco framed button; moon in light mode, sun in dark */
.theme-toggle{
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ink);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--brass);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .22s var(--ease), color .22s var(--ease);
}
.theme-toggle:hover{ background: var(--teal); border-color: var(--teal); color: #F4EDDF; }
.theme-toggle__sun{ display: none; }
html[data-theme="dark"] .theme-toggle__sun{ display: block; }
html[data-theme="dark"] .theme-toggle__moon{ display: none; }
@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]) .theme-toggle__sun{ display: block; }
  html:not([data-theme="light"]) .theme-toggle__moon{ display: none; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .js [data-reveal],
  .js [data-load]{
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
  .phone,
  .app__shots:hover .phone:nth-child(1),
  .app__shots:hover .phone:nth-child(2),
  .app__shots:hover .phone:nth-child(3){ transition: none; }
  *{ scroll-behavior: auto !important; }
}
