/* ============================================================
   BILLY — Digital Marketing Portfolio
   Design system + components
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --bg:            #06080C;
  --bg-2:          #0A0E15;
  --surface:       #10151F;
  --surface-2:     #161C29;
  --line:          rgba(255,255,255,.08);
  --line-strong:   rgba(255,255,255,.16);

  --text:          #EAF0F7;
  --text-dim:      #9BA8BC;
  --text-faint:    #64728A;

  --teal:          #2DD4BF;
  --teal-deep:     #0E7C6E;
  --violet:        #8B5CF6;
  --amber:         #FBBF24;

  /* RGB triplet for scrims/overlays — flips with the theme */
  --shade:         6, 8, 12;
  --ink:           #04211D;          /* text on gradient fills */
  --glow-a:        .34;              /* ambient blob opacity */
  --glow-b:        .30;
  --glow-c:        .22;
  --grain-o:       .035;
  --hair:          rgba(255,255,255,.05);
  --sh:            0,0,0;
  --sh-o:          .5;

  --grad: linear-gradient(120deg, var(--teal) 0%, #38BDF8 45%, var(--violet) 100%);
  --grad-soft: linear-gradient(120deg, rgba(45,212,191,.18), rgba(139,92,246,.18));

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --maxw: 1240px;
  --pad: clamp(20px, 5vw, 64px);

  /* Motion curves — Emil Kowalski's recommended set */
  --ease-out:    cubic-bezier(.23, 1, .32, 1);      /* enter / respond */
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);     /* on-screen movement */
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);      /* iOS drawer */
  --ease:        cubic-bezier(.4, 0, .2, 1);        /* hover / colour */

  /* Durations */
  --t-press:  100ms;
  --t-hover:  180ms;
  --t-pop:    220ms;
  --t-sheet:  340ms;
}

/* ---------- Light theme ---------- */
[data-theme="light"] {
  color-scheme: light;

  --bg:            #F5F7FA;
  --bg-2:          #FFFFFF;
  --surface:       #FFFFFF;
  --surface-2:     #EEF1F6;
  --line:          rgba(12,17,25,.10);
  --line-strong:   rgba(12,17,25,.18);

  --text:          #0C1119;
  --text-dim:      #4B5768;
  --text-faint:    #6E7A8C;

  --teal:          #0D9488;
  --teal-deep:     #0F766E;
  --violet:        #7C3AED;
  --amber:         #B45309;

  --shade:         255, 255, 255;
  --ink:           #FFFFFF;
  --glow-a:        .16;
  --glow-b:        .14;
  --glow-c:        .12;
  --grain-o:       .018;
  --hair:          rgba(12,17,25,.04);
  --sh:            12,17,25;
  --sh-o:          .10;

  --grad: linear-gradient(120deg, #0D9488 0%, #0284C7 45%, #7C3AED 100%);
  --grad-soft: linear-gradient(120deg, rgba(13,148,136,.12), rgba(124,58,237,.12));
}

/* Follow the OS when the visitor hasn't chosen yet */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg:#F5F7FA; --bg-2:#FFFFFF; --surface:#FFFFFF; --surface-2:#EEF1F6;
    --line:rgba(12,17,25,.10); --line-strong:rgba(12,17,25,.18);
    --text:#0C1119; --text-dim:#4B5768; --text-faint:#6E7A8C;
    --teal:#0D9488; --teal-deep:#0F766E; --violet:#7C3AED; --amber:#B45309;
    --shade:255,255,255; --ink:#FFFFFF;
    --glow-a:.16; --glow-b:.14; --glow-c:.12; --grain-o:.018;
    --hair:rgba(12,17,25,.04); --sh:12,17,25; --sh-o:.10;
    --grad: linear-gradient(120deg,#0D9488 0%,#0284C7 45%,#7C3AED 100%);
    --grad-soft: linear-gradient(120deg, rgba(13,148,136,.12), rgba(124,58,237,.12));
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
ul, ol { list-style: none; }

::selection { background: var(--teal); color: var(--ink); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ---------- Ambient background ---------- */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.ambient span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
  animation: drift 26s var(--ease) infinite alternate;
}
.ambient span:nth-child(1){ width:46vw; height:46vw; left:-12vw; top:-10vw; background: radial-gradient(circle, rgba(45,212,191,var(--glow-a)), transparent 68%); }
.ambient span:nth-child(2){ width:42vw; height:42vw; right:-10vw; top:14vh; background: radial-gradient(circle, rgba(139,92,246,var(--glow-b)), transparent 68%); animation-delay:-8s; }
.ambient span:nth-child(3){ width:38vw; height:38vw; left:24vw; bottom:-14vw; background: radial-gradient(circle, rgba(56,189,248,var(--glow-c)), transparent 68%); animation-delay:-15s; }
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(6vw,-5vh,0) scale(1.18); }
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: var(--grain-o);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Cursor ---------- */
.cursor-glow {
  position: fixed; width: 380px; height: 380px; border-radius: 50%; z-index: 2;
  pointer-events: none; transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(45,212,191,.10), transparent 62%);
  transition: opacity .4s; opacity: 0;
}
@media (hover:hover) and (min-width: 1024px) { .cursor-glow { opacity: 1; } }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
main { position: relative; z-index: 3; }
section { position: relative; padding-block: clamp(72px, 11vw, 140px); }

/* ---------- Type ---------- */
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -.03em; }
h1 { font-size: clamp(2.6rem, 7.2vw, 5.4rem); }
h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.7rem); letter-spacing: -.02em; }
h4 { font-size: 1.05rem; letter-spacing: -.01em; }
p { color: var(--text-dim); }
.lead { font-size: clamp(1.02rem, 1.6vw, 1.24rem); color: var(--text-dim); max-width: 62ch; }

.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .74rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 20px;
}
.eyebrow::before { content:''; width: 28px; height: 1px; background: var(--teal); opacity: .6; }

.sec-head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 68px); }
.sec-head p { margin-top: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 30px; border-radius: 100px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; position: relative;
  /* Magnet offset (--bx/--by from JS) composes with press scale (--bs) */
  transform: translate3d(var(--bx, 0px), var(--by, 0px), 0) scale(var(--bs, 1));
  transition: transform var(--t-hover) var(--ease-out),
              box-shadow var(--t-hover) var(--ease-out),
              background var(--t-hover) var(--ease),
              border-color var(--t-hover) var(--ease),
              color var(--t-hover) var(--ease);
}
.btn:active { --bs: .97; transition-duration: var(--t-press); }
.btn svg { width: 17px; height: 17px; transition: transform .3s var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }

.btn-primary { background: var(--grad); color: var(--ink); font-weight: 700; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(45,212,191,var(--glow-a)); }

.btn-ghost { border-color: var(--line-strong); color: var(--text); background: var(--hair); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); --by: -3px; background: rgba(45,212,191,.06); }

.btn-sm { padding: 11px 22px; font-size: .87rem; }

/* ---------- Header ---------- */
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background var(--t-sheet) var(--ease), backdrop-filter var(--t-sheet) var(--ease), border-color var(--t-sheet) var(--ease);
  border-bottom: 1px solid transparent; padding-block: 14px;
}
.site-head.scrolled {
  background: rgba(var(--shade), .82); backdrop-filter: blur(18px) saturate(150%);
  border-bottom-color: var(--line);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 800; font-size: 1.06rem; letter-spacing: -.02em; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--grad);
  display: grid; place-items: center; color: var(--ink); font-weight: 800; font-size: .95rem;
  box-shadow: 0 6px 20px rgba(45,212,191,.28);
}
.logo small { display: block; font-family: var(--font-body); font-size: .66rem; font-weight: 500; color: var(--text-faint); letter-spacing: .08em; text-transform: uppercase; margin-top: 1px; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 9px 16px; border-radius: 100px; font-size: .9rem; font-weight: 500;
  color: var(--text-dim); transition: color .25s, background .25s; position: relative;
}
.nav a:hover { color: var(--text); background: var(--hair); }
.nav a.active { color: var(--teal); background: rgba(45,212,191,.1); }

.head-cta { display: flex; align-items: center; gap: 12px; }

.burger { display: none; width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line-strong); place-items: center; }
.burger span { display: block; width: 17px; height: 1.5px; background: var(--text); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s; }
.burger span + span { margin-top: 4px; }
.burger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.mobile-nav {
  position: fixed; inset: 0; z-index: 99; background: rgba(var(--shade), .97); backdrop-filter: blur(20px);
  display: grid; place-content: center; gap: 6px; text-align: center;
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
}
.mobile-nav.open { opacity: 1; visibility: visible; }
.mobile-nav a {
  font-family: var(--font-display); font-size: clamp(1.8rem,7vw,2.6rem); font-weight: 700;
  padding: 10px 0; color: var(--text-dim); transition: color .25s, transform .35s var(--ease-out), opacity .35s;
  transform: translateY(18px); opacity: 0;
}
.mobile-nav.open a { transform: none; opacity: 1; }
.mobile-nav.open a:nth-child(1){transition-delay:.05s}
.mobile-nav.open a:nth-child(2){transition-delay:.1s}
.mobile-nav.open a:nth-child(3){transition-delay:.15s}
.mobile-nav.open a:nth-child(4){transition-delay:.2s}
.mobile-nav.open a:nth-child(5){transition-delay:.25s}
.mobile-nav a:hover, .mobile-nav a.active { color: var(--teal); }

@media (max-width: 940px) {
  .nav, .head-cta .btn { display: none; }
  .burger { display: grid; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(140px, 20vh, 200px); padding-bottom: clamp(60px, 9vw, 110px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; } }

.badge {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 16px; border-radius: 100px;
  background: rgba(45,212,191,.09); border: 1px solid rgba(45,212,191,.24);
  font-size: .8rem; font-weight: 600; color: var(--teal); margin-bottom: 26px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); position: relative; }
.dot::after { content:''; position:absolute; inset:0; border-radius:50%; background: var(--teal); animation: ping 2s var(--ease) infinite; }
@keyframes ping { 0%{transform:scale(1);opacity:.8} 100%{transform:scale(3);opacity:0} }

.hero h1 { margin-bottom: 24px; }
.hero .lead { margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }

.hero-stats { display: grid; grid-template-columns: repeat(3, auto); gap: clamp(24px,4vw,52px); justify-content: start; }
@media (max-width:520px){ .hero-stats { grid-template-columns: repeat(2,1fr); } }
.stat .num { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: clamp(1.8rem,3.4vw,2.5rem); font-weight: 800; letter-spacing: -.03em; }
.stat .lbl { font-size: .76rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .12em; font-weight: 600; margin-top: 2px; }

.hero-visual { position: relative; }
.portrait-frame {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  border: 1px solid var(--line-strong); aspect-ratio: 4/5;
  background: var(--surface);
  box-shadow: 0 40px 90px rgba(var(--sh), calc(var(--sh-o) * 1.20));
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait-frame::after {
  content:''; position:absolute; inset:0;
  background: linear-gradient(to top, rgba(var(--shade), .88) 4%, transparent 48%);
}
.portrait-tag {
  position: absolute; left: 20px; right: 20px; bottom: 20px; z-index: 2;
  background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: 16px 18px;
}
.portrait-tag strong { display:block; font-family: var(--font-display); font-size: 1rem; }
.portrait-tag span { font-size: .8rem; color: var(--text-faint); }

.float-card {
  position: absolute; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(16px);
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: 13px 17px;
  box-shadow: 0 18px 44px rgba(var(--sh), calc(var(--sh-o) * 1.00)); animation: bob 5s var(--ease) infinite alternate;
}
.float-card .k { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.float-card .v { font-size: .72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em; }
.fc-1 { top: 9%; left: -6%; }
.fc-2 { bottom: 22%; right: -7%; animation-delay: -2.5s; }
@media (max-width: 940px){ .fc-1{left:2%} .fc-2{right:2%} }
@keyframes bob { from{transform:translateY(0)} to{transform:translateY(-14px)} }

/* ---------- Marquee ---------- */
.marquee-band { border-block: 1px solid var(--line); padding-block: 22px; overflow: hidden; background: var(--hair); }
.marquee { display: flex; gap: 0; width: max-content; animation: slide 38s linear infinite; }
.marquee:hover { animation-play-state: paused; }
.marquee span {
  padding-inline: 30px; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(.95rem,1.6vw,1.2rem); color: var(--text-faint); white-space: nowrap;
  display: flex; align-items: center; gap: 30px;
}
.marquee span::after { content:''; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); opacity: .5; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(160deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(24px,3vw,34px);
  position: relative; overflow: hidden;
  transition: transform .45s var(--ease-out), border-color .35s, box-shadow .45s;
}
.card::before {
  content:''; position: absolute; inset: 0; opacity: 0; transition: opacity .4s;
  background: radial-gradient(600px circle at var(--mx,50%) var(--my,0%), rgba(45,212,191,.09), transparent 42%);
  pointer-events: none;
}
.card:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: 0 26px 60px rgba(var(--sh), calc(var(--sh-o) * 0.92)); }
.card:hover::before { opacity: 1; }

.card-icon {
  width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid rgba(45,212,191,.2); margin-bottom: 22px;
  font-size: 1.3rem;
}
.card h3 { margin-bottom: 12px; }
.card p { font-size: .94rem; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(288px,1fr)); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px,1fr)); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 18px; }

/* ---------- Work / gallery ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.filter {
  padding: 9px 20px; border-radius: 100px; border: 1px solid var(--line-strong);
  font-size: .87rem; font-weight: 600; color: var(--text-dim);
  transition: color var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease), background var(--t-hover) var(--ease), transform var(--t-press) var(--ease-out);
}
.filter:active { transform: scale(.97); }
.filter:hover { color: var(--text); border-color: var(--text-faint); }
.filter.active { background: var(--grad); color: var(--ink); border-color: transparent; }

.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(266px,1fr)); gap: 18px; }
.work-item {
  position: relative; border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); aspect-ratio: 1;
  transition: transform var(--t-pop) var(--ease-out), border-color var(--t-hover) var(--ease), box-shadow var(--t-pop) var(--ease-out);
}
.work-item.wide { grid-column: span 2; aspect-ratio: 2/1; }
@media (max-width: 620px){ .work-item.wide { grid-column: span 1; aspect-ratio: 1; } }
.work-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.work-item:hover { transform: translateY(-5px); border-color: rgba(45,212,191,.4); box-shadow: 0 24px 56px rgba(var(--sh), calc(var(--sh-o) * 1.00)); }
.work-item:hover img { transform: scale(1.07); }
.work-meta {
  position: absolute; inset: auto 0 0 0; padding: 20px;
  background: linear-gradient(to top, rgba(var(--shade), .95), transparent);
  transform: translateY(12px); opacity: 0; transition: transform var(--t-pop) var(--ease-out), opacity var(--t-pop) var(--ease-out);
}
.work-item:hover .work-meta { transform: none; opacity: 1; }
.work-meta strong { display: block; font-family: var(--font-display); font-size: .98rem; }
.work-meta span { font-size: .77rem; color: var(--teal); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.work-item.hide { display: none; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(var(--shade), .96); backdrop-filter: blur(14px);
  display: grid; place-items: center; padding: 5vw;
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: var(--r); box-shadow: 0 30px 80px rgba(var(--sh), calc(var(--sh-o) * 1.40)); transform: scale(.94); transition: transform var(--t-sheet) var(--ease-out); }
.lightbox.open img { transform: none; }
.lb-cap { text-align: center; margin-top: 20px; font-family: var(--font-display); font-weight: 600; }
.lb-cap span { display:block; font-family: var(--font-body); font-size:.85rem; color: var(--text-faint); font-weight:400; margin-top:4px; }
.lb-close { position: absolute; top: 26px; right: 26px; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 1.3rem; transition: background var(--t-hover) var(--ease), transform var(--t-pop) var(--ease-out); }
.lb-close:hover { background: rgba(255,255,255,.08); transform: rotate(90deg); }
.lb-nav { position:absolute; top:50%; transform:translateY(-50%); width:52px; height:52px; border-radius:50%; border:1px solid var(--line-strong); display:grid; place-items:center; font-size:1.4rem; transition:all .25s; }
.lb-nav:hover { background: rgba(255,255,255,.08); border-color: var(--teal); }
.lb-prev { left: 2vw; } .lb-next { right: 2vw; }
@media (max-width:700px){ .lb-nav{ display:none; } }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content:''; position:absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--teal), var(--violet), transparent); opacity: .45; }
.tl-item { position: relative; padding-bottom: 42px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content:''; position:absolute; left: -34px; top: 7px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--teal); box-shadow: 0 0 0 5px rgba(45,212,191,.1);
}
.tl-item.current::before { background: var(--teal); }
.tl-date { font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: 7px; }
.tl-item h3 { margin-bottom: 4px; }
.tl-org { font-size: .92rem; color: var(--text-faint); margin-bottom: 14px; font-weight: 500; }
.tl-list li { position: relative; padding-left: 20px; margin-bottom: 8px; font-size: .93rem; color: var(--text-dim); }
.tl-list li::before { content:''; position: absolute; left: 0; top: 10px; width: 6px; height: 1.5px; background: var(--teal); opacity: .8; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.tag { font-size: .73rem; font-weight: 600; padding: 5px 12px; border-radius: 100px; background: var(--hair); border: 1px solid var(--line); color: var(--text-dim); }

/* ---------- Skill bars ---------- */
.skill-row { margin-bottom: 20px; }
.skill-top { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: .9rem; font-weight: 600; }
.skill-top em { font-style: normal; color: var(--teal); font-family: var(--font-display); }
.skill-track { height: 5px; border-radius: 100px; background: var(--line); overflow: hidden; }
.skill-fill {
  height: 100%; width: 100%; border-radius: 100px; background: var(--grad);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 900ms var(--ease-out);
}

/* ---------- Resources / products ---------- */
.product-card { display: flex; flex-direction: column; gap: 18px; }
.product-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pill {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 13px; border-radius: 100px; white-space: nowrap;
}
.pill.live   { background: rgba(45,212,191,.13); color: var(--teal); border: 1px solid rgba(45,212,191,.3); }
.pill.beta   { background: rgba(251,191,36,.12); color: var(--amber); border: 1px solid rgba(251,191,36,.3); }
.pill.soon   { background: rgba(139,92,246,.13); color: #A78BFA; border: 1px solid rgba(139,92,246,.3); }
.feature-list li { position: relative; padding-left: 24px; font-size: .9rem; color: var(--text-dim); margin-bottom: 9px; }
.feature-list li::before { content:'>'; position: absolute; left: 0; color: var(--teal); font-weight: 700; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px,4vw,56px); }
@media (max-width: 880px){ .contact-grid { grid-template-columns: 1fr; } }
.contact-line { display: flex; gap: 16px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact-line:last-child { border-bottom: none; }
.contact-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid rgba(45,212,191,.2); flex-shrink: 0; }
.contact-line .lbl { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-faint); font-weight: 600; }
.contact-line .val { font-weight: 600; font-size: .98rem; word-break: break-word; }
.contact-line a.val:hover { color: var(--teal); }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 8px; color: var(--text-dim); letter-spacing: .02em; }
.field input, .field textarea, .field select {
  width: 100%; padding: 14px 17px; border-radius: var(--r-sm);
  background: var(--hair); border: 1px solid var(--line-strong);
  transition: border-color .28s, background .28s, box-shadow .28s; font-size: .95rem;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--teal); background: rgba(45,212,191,.05);
  box-shadow: 0 0 0 3px rgba(45,212,191,.1);
}
.field textarea { resize: vertical; min-height: 130px; }
.field select option { background: var(--surface); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width:560px){ .form-row { grid-template-columns: 1fr; } }

/* ---------- CTA band ---------- */
.cta-band {
  border-radius: var(--r-xl); padding: clamp(36px,6vw,72px); text-align: center;
  background: linear-gradient(150deg, rgba(45,212,191,.11), rgba(139,92,246,.11));
  border: 1px solid var(--line-strong); position: relative; overflow: hidden;
}
.cta-band::before {
  content:''; position:absolute; inset:0;
  background: radial-gradient(circle at 50% 0%, rgba(45,212,191,.16), transparent 62%);
}
.cta-band > * { position: relative; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 30px; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: clamp(46px,6vw,72px) 30px; position: relative; z-index: 3; background: var(--bg-2); }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 36px; margin-bottom: 44px; }
@media (max-width: 880px){ .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px){ .foot-grid { grid-template-columns: 1fr; } }
.foot-grid h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--text-faint); margin-bottom: 18px; font-family: var(--font-body); font-weight: 700; }
.foot-links li { margin-bottom: 11px; }
.foot-links a {
  font-size: .93rem; color: var(--text-dim); display: inline-block;
  transition: color var(--t-hover) var(--ease), transform var(--t-hover) var(--ease-out);
}
.foot-links a:hover { color: var(--teal); transform: translateX(5px); }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; padding-top: 26px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--text-faint); }
.socials { display: flex; gap: 9px; }
.socials a {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  transition: background var(--t-hover) var(--ease), color var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease), transform var(--t-hover) var(--ease-out);
}
.socials a:hover { background: var(--grad); color: var(--ink); border-color: transparent; transform: translateY(-3px); }
.socials svg { width: 16px; height: 16px; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding-top: clamp(130px, 17vh, 180px); padding-bottom: clamp(40px, 6vw, 70px); }
.page-hero h1 { font-size: clamp(2.2rem, 5.6vw, 4rem); margin-bottom: 20px; }

/* ---------- Theme toggle ---------- */
.theme-btn {
  min-width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); background: var(--hair); line-height: 1;
  transition: color var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease),
              background var(--t-hover) var(--ease), transform var(--t-hover) var(--ease-out);
}
.theme-btn:active { transform: scale(.96); transition-duration: var(--t-press); }
.theme-btn:hover { color: var(--teal); border-color: var(--teal); transform: translateY(-2px); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
[data-theme="light"] .theme-btn .moon { display: block; }
[data-theme="light"] .theme-btn .sun  { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-btn .moon { display: block; }
  :root:not([data-theme]) .theme-btn .sun  { display: none; }
}
.sb-theme { display: flex; justify-content: center; margin-bottom: 14px; }
.sb-theme .theme-btn { width: 100%; height: 40px; border-radius: var(--r-sm); gap: 9px; }
.sb-theme .theme-btn span { font-size: .84rem; font-weight: 600; }

/* Theme transition */
body, .card, .sidebar, .site-head, .counter-cell, .work-item, .site-foot {
  transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease);
}

/* ---------- Reveal ---------- */
html.js [data-reveal] { opacity: 0; transform: translateY(26px); }
[data-reveal] { transition: opacity 560ms var(--ease-out), transform 560ms var(--ease-out); }
html.js [data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-delay="1"] { transition-delay: .08s; }
[data-reveal][data-delay="2"] { transition-delay: .16s; }
[data-reveal][data-delay="3"] { transition-delay: .24s; }
[data-reveal][data-delay="4"] { transition-delay: .32s; }
[data-reveal][data-delay="5"] { transition-delay: .40s; }

/* ---------- Progress bar ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad); z-index: 101;
  transform: scaleX(0); transform-origin: left center;
  will-change: transform;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 90px);
  background: var(--surface-2); border: 1px solid var(--teal); color: var(--text);
  padding: 14px 24px; border-radius: 100px; font-size: .9rem; font-weight: 600; z-index: 300;
  transition: transform .45s var(--ease-out); box-shadow: 0 16px 40px rgba(var(--sh), calc(var(--sh-o) * 1.00));
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-s { margin-top: 16px; } .mt-m { margin-top: 28px; } .mt-l { margin-top: 44px; }
.divider { height: 1px; background: var(--line); }
.muted { color: var(--text-faint); font-size: .85rem; }

/* ============================================================
   INTERACTION GUARDS & ACCESSIBILITY
   ============================================================ */

/* Hover effects only where a real pointer exists.
   On touch, :hover sticks after tap and the lift never resets. */
@media not all and (hover: hover) and (pointer: fine) {
  .btn:hover, .card:hover, .tile:hover, .work-item:hover,
  .rail-item:hover, .filter:hover, .socials a:hover, .sb-socials a:hover,
  .theme-btn:hover, .rail-btn:hover, .counter-cell:hover, .sb-nav a:hover {
    transform: none;
    box-shadow: none;
  }
  .tile:hover img, .work-item:hover img, .rail-item:hover img { transform: none; }
  /* Captions can't rely on hover — show them */
  .tile-meta, .work-meta { opacity: 1; transform: none; }
  .tile-zoom { display: none; }
}

/* Keyboard focus — visible, consistent, never removed */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
.btn:focus-visible { outline-offset: 4px; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline: none; }

/* Skip straight to content */
.skip-link {
  position: fixed; left: 12px; top: 12px; z-index: 200;
  padding: 12px 22px; border-radius: 100px;
  background: var(--grad); color: var(--ink); font-weight: 700; font-size: .9rem;
  transform: translateY(-200%);
  transition: transform var(--t-pop) var(--ease-out);
}
.skip-link:focus { transform: none; }

/* ---------- Reduced motion ----------
   Not "no motion" — keep opacity and colour, which aid comprehension.
   Drop movement, parallax and looping ambience. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  html.js [data-reveal] { opacity: 1; transform: none; }
  .ambient, .grain, .cursor-glow { display: none; }
  .float-card { animation: none; }
  .skill-fill { transform: scaleX(1); }
  /* Keep the cross-fades that explain state */
  .lightbox { transition: opacity 200ms ease !important; }
  .sb-scrim { transition: opacity 200ms ease !important; }
}

/* ---------- Reduced transparency ----------
   Apple: raise opacity, drop the blur. */
@media (prefers-reduced-transparency: reduce) {
  .site-head.scrolled, .sb-toggle, .float-card, .portrait-tag,
  .lightbox, .sb-scrim, .admin-head, .savebar, .tile-zoom {
    backdrop-filter: none !important;
    background: var(--surface) !important;
  }
  .ambient, .grain { display: none; }
}

/* ---------- Increased contrast ---------- */
@media (prefers-contrast: more) {
  :root { --line: rgba(255,255,255,.28); --line-strong: rgba(255,255,255,.48); --text-dim: #C6D0DE; --text-faint: #9AA7B8; }
  [data-theme="light"] { --line: rgba(12,17,25,.30); --line-strong: rgba(12,17,25,.55); --text-dim: #313B4A; --text-faint: #4A5768; }
  .card, .tile, .rail-item, .counter-cell { border-width: 1.5px; }
  .ambient, .grain { display: none; }
}
