/* =========================================================
   Ahmed Muzamil Portfolio, Liquid Glass theme
   Performance rules: animate only transform/opacity, blur only on a few
   elements (and only on capable desktops), static backgrounds on mobile.
   ========================================================= */
@font-face { font-family: "Inter Var"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Jakarta Var"; src: url("/fonts/jakarta.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --font: "Inter Var", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --display: "Jakarta Var", "Inter Var", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --r-xl: 32px; --r-lg: 24px; --r-md: 16px; --r-sm: 12px;
  --blur: 22px;
  --nav-h: 60px;
  --ok: #22c55e; --danger: #ef4444;
  --gutter: clamp(18px, 5vw, 40px);
  --grad: linear-gradient(110deg, var(--accent) 0%, var(--accent-2) 100%);
  color-scheme: light;
}
[data-theme="light"] {
  --bg: #eef3fd; --bg-2: #f8faff;
  --b1: rgba(86, 140, 255, .42); --b2: rgba(56, 189, 248, .30); --b3: rgba(255, 190, 140, .22);
  --accent: #1f5df0; --accent-2: #2aa8f5;
  --text: #0b1437; --muted: #4b5679; --faint: #8791b0;
  --glass: rgba(255, 255, 255, .62); --glass-2: rgba(255, 255, 255, .86); --glass-solid: #ffffff;
  --stroke: rgba(255, 255, 255, .9); --line: rgba(20, 40, 110, .09);
  --hi: rgba(255, 255, 255, .95); --lo: rgba(30, 50, 120, .08);
  --sheen: rgba(255, 255, 255, .85);
  --shadow: 0 16px 40px -18px rgba(31, 70, 170, .32), 0 2px 6px rgba(31, 70, 170, .06);
  --field: rgba(255, 255, 255, .7);
  --grid: rgba(31, 70, 170, .045);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #04060f; --bg-2: #070b1a;
  --b1: rgba(37, 99, 235, .42); --b2: rgba(14, 165, 233, .26); --b3: rgba(99, 102, 241, .22);
  --accent: #5b94ff; --accent-2: #38c8ff;
  --text: #f1f5ff; --muted: rgba(220, 230, 255, .68); --faint: rgba(200, 215, 255, .42);
  --glass: rgba(255, 255, 255, .06); --glass-2: rgba(255, 255, 255, .11); --glass-solid: #0f1424;
  --stroke: rgba(255, 255, 255, .13); --line: rgba(255, 255, 255, .08);
  --hi: rgba(255, 255, 255, .22); --lo: rgba(0, 0, 0, .4);
  --sheen: rgba(255, 255, 255, .12);
  --shadow: 0 18px 46px -18px rgba(0, 0, 0, .75), 0 2px 8px rgba(0, 0, 0, .3);
  --field: rgba(255, 255, 255, .06);
  --grid: rgba(255, 255, 255, .035);
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 36px); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 400 clamp(15px, .3vw + 14px, 17px)/1.65 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { -webkit-appearance: none; appearance: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--glass-solid); border-radius: 12px; transition: top .2s; }
.skip:focus { top: 12px; }
.container { width: min(1160px, 100% - var(--gutter) * 2); margin-inline: auto; }

html.theme-anim body, html.theme-anim .glass, html.theme-anim .btn, html.theme-anim .chip, html.theme-anim .field,
html.theme-anim .nav-links a, html.theme-anim .icon-btn, html.theme-anim .ambient {
  transition: background-color .45s ease, color .45s ease, border-color .45s ease, box-shadow .45s ease !important;
}

/* ============ Ambient background ============ */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; contain: strict;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(180deg, var(--bg-2), var(--bg)); }
.blob { position: absolute; border-radius: 50%; }
.b1 { width: 70vmax; height: 70vmax; left: -22vmax; top: -30vmax; background: radial-gradient(circle, var(--b1), transparent 65%); }
.b2 { width: 60vmax; height: 60vmax; right: -24vmax; top: 4vh; background: radial-gradient(circle, var(--b2), transparent 65%); }
.b3 { width: 55vmax; height: 55vmax; left: 10vw; bottom: -34vmax; background: radial-gradient(circle, var(--b3), transparent 65%); }
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .b1 { animation: drift1 28s ease-in-out infinite alternate; will-change: transform; }
  .b2 { animation: drift2 34s ease-in-out infinite alternate; will-change: transform; }
}
@keyframes drift1 { to { transform: translate3d(10vmax, 8vmax, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(-9vmax, 6vmax, 0) scale(.94); } }
@media (max-width: 900px) { .b3 { display: none; } .ambient { background: linear-gradient(180deg, var(--bg-2), var(--bg)); } }

.progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 60; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); }
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
  @keyframes grow { to { transform: scaleX(1); } }
}

/* ============ Liquid glass ============ */
.glass {
  position: relative; isolation: isolate;
  background-color: var(--glass);
  border: 1px solid var(--stroke); border-radius: var(--r-lg);
  box-shadow: var(--shadow), inset 0 1px 0 var(--hi), inset 0 -1px 0 var(--lo);
}
.glass::before { /* soft top specular highlight, static (cheap) */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, var(--sheen) 0%, transparent 38%);
  opacity: .55;
}
@media (min-width: 901px) {
  .glass { -webkit-backdrop-filter: blur(var(--blur)) saturate(165%); backdrop-filter: blur(var(--blur)) saturate(165%); }
  .glass::before { background: radial-gradient(520px circle at var(--mx, 15%) var(--my, -10%), var(--sheen), transparent 55%); opacity: .8; }
}
@media (max-width: 900px) { [data-theme="light"] { --glass: rgba(255, 255, 255, .78); } [data-theme="dark"] { --glass: rgba(24, 30, 52, .62); } }
/* the few elements that keep real blur on phones */
.nav, .float-chip, .toast, .menu-sheet { -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); }
.lift { transition: transform .45s var(--ease), box-shadow .45s var(--ease), background-color .3s; }
@media (hover: hover) and (pointer: fine) { .lift:hover { transform: translate3d(0, -6px, 0); background-color: var(--glass-2); } }

/* ============ Buttons / chips / fields ============ */
.btn {
  --h: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--h); padding: 0 26px;
  border-radius: 999px; border: 1px solid var(--stroke); background-color: var(--glass-2); cursor: pointer; font-weight: 650; font-size: .95rem; letter-spacing: -.005em;
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .25s, opacity .25s; position: relative; overflow: hidden; white-space: nowrap; touch-action: manipulation;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .btn:hover { transform: translate3d(0, -2px, 0); } }
.btn.primary { color: #fff; border-color: rgba(255, 255, 255, .3); background: var(--grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 14px 30px -12px var(--accent); }
.btn.primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%); transform: translate3d(-120%, 0, 0); transition: transform .8s var(--ease); }
@media (hover: hover) and (pointer: fine) { .btn.primary:hover::after { transform: translate3d(120%, 0, 0); } }
.btn.danger { color: var(--danger); }
.btn.sm { --h: 38px; padding: 0 16px; font-size: .85rem; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--stroke); background-color: var(--glass-2); display: grid; place-items: center; cursor: pointer; flex: none; padding: 0;
  box-shadow: inset 0 1px 0 var(--hi); transition: transform .35s var(--ease), background-color .25s; touch-action: manipulation;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(.9); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { transform: translate3d(0, -2px, 0) rotate(8deg); } }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; font-size: .78rem; font-weight: 600; border-radius: 999px; background-color: var(--glass); border: 1px solid var(--stroke); color: var(--muted); }
.chip.accent { color: var(--accent); }
.chip svg { width: 14px; height: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; position: relative; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(3); opacity: 0; } }

.field { display: grid; gap: 6px; }
.field > span, .field > label > span { font-size: .82rem; font-weight: 600; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background-color: var(--field);
  box-shadow: inset 0 1px 2px var(--lo); transition: border-color .25s, box-shadow .25s; min-height: 50px; font-size: 16px; /* 16px stops iOS zoom */
}
[data-theme="dark"] .field input, [data-theme="dark"] .field textarea, [data-theme="dark"] .field select { border-color: var(--stroke); }
.field select option { color: #111; }
.field textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.field .err { color: var(--danger); font-size: .8rem; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ============ Navigation ============ */
.nav-wrap { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 50; display: flex; justify-content: center; padding-inline: 14px; pointer-events: none; }
.nav { pointer-events: auto; display: flex; align-items: center; gap: 6px; height: var(--nav-h); padding: 0 8px 0 20px; border-radius: 999px; width: fit-content; max-width: 100%; animation: navIn .9s var(--ease) both; transition: transform .5s var(--ease), box-shadow .4s; }
.nav.hide { transform: translate3d(0, -140%, 0); }
@keyframes navIn { from { opacity: 0; transform: translate3d(0, -26px, 0); } }
.brand { font-family: var(--display); font-weight: 800; letter-spacing: .02em; text-transform: uppercase; display: flex; align-items: center; gap: 9px; margin-right: 14px; white-space: nowrap; font-size: .95rem; }
.brand-mark { width: 12px; height: 12px; border-radius: 50%; background: var(--grad); font-size: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); flex: none; }
.nav-links { display: flex; gap: 2px; }
.nav-links a { display: block; padding: 8px 13px; border-radius: 999px; font-size: .86rem; font-weight: 550; color: var(--muted); transition: color .25s, background-color .25s; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); background-color: var(--glass-2); box-shadow: inset 0 1px 0 var(--hi); }
.nav-actions { display: flex; gap: 8px; margin-left: 8px; }
.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle .i-sun, .theme-toggle .i-moon { position: absolute; transition: transform .6s var(--ease), opacity .4s; }
[data-theme="dark"] .i-sun { opacity: 0; transform: rotate(-90deg) scale(.4); }
[data-theme="light"] .i-moon { opacity: 0; transform: rotate(90deg) scale(.4); }
.menu-btn { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.menu-btn span { width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .4s var(--ease); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translate3d(0, 3.5px, 0) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translate3d(0, -3.5px, 0) rotate(-45deg); }

@media (max-width: 1140px) {
  .nav { width: min(560px, 100%); padding-left: 18px; }
  .nav-wrap { padding-inline: 12px; }
  .menu-btn { display: flex; }
  .brand { margin-right: auto; }
  .nav-links {
    position: fixed; top: calc(var(--nav-h) + 24px + env(safe-area-inset-top)); left: 12px; right: 12px; max-width: 560px; margin-inline: auto;
    flex-direction: column; gap: 2px; padding: 10px; border-radius: var(--r-lg); max-height: calc(100dvh - var(--nav-h) - 48px - env(safe-area-inset-top));
    overflow-y: auto; overscroll-behavior: contain;
    background-color: var(--glass-solid); border: 1px solid var(--stroke); box-shadow: var(--shadow);
    opacity: 0; transform: translate3d(0, -14px, 0) scale(.97); transform-origin: top center; pointer-events: none; visibility: hidden;
    transition: opacity .3s, transform .45s var(--ease), visibility .3s;
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
  .nav-links a { padding: 14px 18px; font-size: 1rem; border-radius: var(--r-md); }
  .nav-links li { opacity: 0; transform: translate3d(0, 8px, 0); transition: opacity .35s, transform .45s var(--ease); }
  .nav-links.open li { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 35ms + 80ms); }
}

/* ============ Hero ============ */
.hero { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: clamp(28px, 5vw, 80px); padding: calc(var(--nav-h) + 70px) 0 90px; position: relative; }
.hero-copy { display: grid; gap: 22px; justify-items: start; min-width: 0; }
.hero-copy > * { max-width: 100%; }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: clamp(.72rem, .5vw + .6rem, .86rem); font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.eyebrow .dot { width: 10px; height: 10px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 18%, transparent); }
.hero h1 { font-size: clamp(2.9rem, 10.5vw, 7.4rem); line-height: .95; letter-spacing: -.045em; font-weight: 800; text-transform: uppercase; margin-top: -6px; }
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.hero h1 .w > span { display: inline-block; }
.hero h1 .line { display: block; }
.hero h1 .grad, .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.hero .tagline { font-family: var(--display); font-size: clamp(1.25rem, 2.6vw, 2rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.2; max-width: 22ch; margin-top: 10px; }
.hero .intro { max-width: 52ch; color: var(--muted); font-size: clamp(1rem, .5vw + .9rem, 1.15rem); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.socials { display: flex; gap: 10px; flex-wrap: wrap; }
.socials a { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.socials svg { width: 20px; height: 20px; }
.scroll-hint { position: absolute; left: 0; bottom: 28px; display: flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: .72rem; letter-spacing: .24em; color: var(--muted); }
.scroll-hint i { width: 24px; height: 38px; border-radius: 14px; border: 1.5px solid var(--faint); position: relative; }
.scroll-hint i::after { content: ""; position: absolute; left: 50%; top: 8px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 3px; background: var(--accent); animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { transform: translate3d(0, 0, 0); opacity: 1; } 70% { transform: translate3d(0, 12px, 0); opacity: 0; } 100% { opacity: 0; } }

/* Portrait + shapes */
.portrait-wrap { position: relative; justify-self: center; width: min(100%, 420px); perspective: 1000px; }
.portrait-shadow { filter: drop-shadow(0 28px 34px color-mix(in srgb, var(--accent) 30%, transparent)); }
.portrait {
  --bw: 5px; position: relative; padding: var(--bw); aspect-ratio: 4 / 5; border-radius: 44px; transform-style: preserve-3d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 55%, var(--accent));
  transition: transform .5s var(--ease); will-change: transform;
}
.portrait .ph { width: 100%; height: 100%; overflow: hidden; border-radius: calc(44px - var(--bw)); background: var(--glass-solid); display: grid; place-items: center; position: relative; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.portrait .ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(165deg, rgba(255, 255, 255, .22), transparent 35%); pointer-events: none; }
.portrait .initials { font-family: var(--display); font-size: 5rem; font-weight: 800; letter-spacing: -.05em; }
/* shape variants: border-radius ones keep the border; clip-path ones use the same shape on both layers */
.shape-rounded .portrait, .shape-rounded .ph { border-radius: 44px; } .shape-rounded .ph { border-radius: 39px; }
.shape-squircle .portrait { border-radius: 38% / 34%; } .shape-squircle .ph { border-radius: 38% / 34%; }
.shape-circle .portrait { aspect-ratio: 1; border-radius: 50%; } .shape-circle .ph { border-radius: 50%; }
.shape-oval .portrait { border-radius: 50%; } .shape-oval .ph { border-radius: 50%; }
.shape-arch .portrait { border-radius: 999px 999px 40px 40px; } .shape-arch .ph { border-radius: 999px 999px 36px 36px; }
.shape-leaf .portrait { border-radius: 90px 14px 90px 14px; } .shape-leaf .ph { border-radius: 86px 10px 86px 10px; }
.shape-blob .portrait { border-radius: 58% 42% 55% 45% / 50% 58% 42% 50%; } .shape-blob .ph { border-radius: 58% 42% 55% 45% / 50% 58% 42% 50%; }
.shape-hexagon .portrait { aspect-ratio: 1 / 1.1; border-radius: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); padding: 0; }
.shape-hexagon .ph { border-radius: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); transform: scale(.965); }
.shape-diamond .portrait { aspect-ratio: 1; border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); padding: 0; }
.shape-diamond .ph { border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); transform: scale(.965); }
.shape-circle .portrait-wrap, .shape-diamond .portrait-wrap { width: min(100%, 380px); }

.float-chip { position: absolute; padding: 10px 16px; border-radius: 16px; font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: 9px; white-space: nowrap; z-index: 2; background-color: var(--glass-2); border: 1px solid var(--stroke); box-shadow: var(--shadow), inset 0 1px 0 var(--hi); }
.float-chip::before { display: none; }
.float-chip .dot { background: var(--accent); width: 7px; height: 7px; } .float-chip .dot::after { display: none; }
.float-chip.c1 { left: -9%; top: 14%; --fd: 7s; }
.float-chip.c2 { right: -9%; top: 46%; --fd: 8s; }
.float-chip.c3 { left: -4%; bottom: 8%; --fd: 9s; }
@keyframes floaty { 50% { transform: translate3d(0, -10px, 0); } }

/* hero entrance */
.hero-in .w > span { transform: translate3d(0, 105%, 0); animation: wordUp 1s var(--ease) forwards; animation-delay: calc(.12s + var(--i, 0) * .09s); }
@keyframes wordUp { to { transform: none; } }
.hero-in > :not(h1) { opacity: 0; transform: translate3d(0, 24px, 0); animation: rise .9s var(--ease) forwards; animation-delay: calc(.05s + var(--i, 0) * .09s); }
@keyframes rise { to { opacity: 1; transform: none; } }
.portrait-wrap { opacity: 0; transform: translate3d(0, 30px, 0) scale(.94); animation: pop 1.1s .25s var(--ease) forwards; }
@keyframes pop { to { opacity: 1; transform: none; } }
.float-chip { opacity: 0; animation: chipIn .8s var(--ease) forwards, floaty var(--fd, 7s) ease-in-out infinite; }
.float-chip.c1 { animation-delay: .9s, .9s; } .float-chip.c2 { animation-delay: 1.05s, 1.05s; } .float-chip.c3 { animation-delay: 1.2s, 1.2s; }
@keyframes chipIn { from { opacity: 0; margin-top: 14px; } to { opacity: 1; margin-top: 0; } }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding: calc(var(--nav-h) + 44px) 0 56px; min-height: auto; gap: 30px; }
  .hero-copy { justify-items: center; }
  .hero .tagline { max-width: 26ch; }
  .portrait-wrap { order: -1; width: min(66vw, 300px); }
  .shape-circle .portrait-wrap, .shape-diamond .portrait-wrap { width: min(62vw, 280px); }
  .cta-row, .socials { justify-content: center; }
  .scroll-hint { display: none; }
  .float-chip { font-size: .74rem; padding: 8px 12px; }
  .float-chip.c1 { left: -14%; } .float-chip.c2 { right: -14%; } .float-chip.c3 { left: -6%; }
  .eyebrow { letter-spacing: .18em; }
}
@media (max-width: 420px) { .cta-row .btn { flex: 1 1 100%; } .float-chip.c1 { left: -8%; } .float-chip.c2 { right: -8%; } }

/* ============ Stats + marquee ============ */
.stats-strip { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 14px; margin-top: -30px; position: relative; z-index: 2; }
.stat-card { padding: 22px 20px; text-align: center; border-radius: var(--r-lg); }
.stat-card b { display: block; font-family: var(--display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-card span { color: var(--muted); font-size: .88rem; font-weight: 550; }
@media (max-width: 640px) {
  .stats-strip { gap: 10px; margin-top: -10px; }
  .stats-strip[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { padding: 16px 8px; }
  .stat-card b { font-size: 1.7rem; }
  .stat-card span { font-size: .74rem; line-height: 1.3; display: block; margin-top: 2px; }
}
.marquee { overflow: hidden; margin: 56px 0 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 32s linear infinite; animation-play-state: paused; }
.marquee.run .marquee-track { animation-play-state: running; }
.marquee .chip { font-size: .95rem; padding: 10px 22px; color: var(--text); font-family: var(--display); font-weight: 650; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* ============ Sections ============ */
.section { padding: clamp(60px, 9vw, 120px) 0; content-visibility: auto; contain-intrinsic-size: auto 700px; }
.section-head { margin-bottom: clamp(30px, 4vw, 52px); display: grid; gap: 10px; justify-items: start; }
.section-head .kicker { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .76rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.section-head .kicker::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: var(--grad); }
.section-head h2 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.04em; line-height: 1.04; font-weight: 800; }

.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.card { padding: clamp(22px, 3vw, 34px); }
.card h3 { font-size: 1.2rem; letter-spacing: -.02em; margin-bottom: 10px; }
.card p + p { margin-top: 14px; }
.card p { color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.objective { background-image: linear-gradient(145deg, color-mix(in srgb, var(--accent) 14%, transparent), color-mix(in srgb, var(--accent-2) 12%, transparent)); }
.facts { display: grid; gap: 12px; margin-top: 20px; }
.fact { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--r-md); min-width: 0; }
.fact svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.fact small { display: block; color: var(--faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.fact span { overflow-wrap: anywhere; font-weight: 550; }
.fact > div { min-width: 0; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.svc { display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.svc .ico { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 12px 24px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .5); transition: transform .5s var(--ease); }
.svc .ico svg { width: 26px; height: 26px; }
@media (hover: hover) and (pointer: fine) { .svc:hover .ico { transform: rotate(-8deg) scale(1.08); } }
.svc h3 { font-size: 1.2rem; letter-spacing: -.02em; }
.svc p { color: var(--muted); font-size: .96rem; }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.skill { margin-top: 18px; }
.skill-top { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; font-weight: 550; margin-bottom: 8px; }
.skill-top span { min-width: 0; overflow-wrap: anywhere; }
.skill-top b { color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background-color: var(--field); overflow: hidden; box-shadow: inset 0 1px 2px var(--lo); }
.bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.3s var(--ease) var(--d, 0s); }
.in .bar i, .bar.in i { transform: scaleX(var(--p)); }

.timeline { position: relative; display: grid; gap: 22px; padding-left: 36px; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), var(--accent-2), transparent); border-radius: 2px; opacity: .55; transform-origin: 50% 0; transform: scaleY(0); transition: transform 1.6s var(--ease); }
.timeline.in::before { transform: scaleY(1); }
.t-item { position: relative; }
.t-item::before { content: ""; position: absolute; left: -35px; top: 30px; width: 14px; height: 14px; border-radius: 50%; background: var(--glass-solid); border: 3px solid var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent); }
.t-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; align-items: flex-start; }
.t-head > div { min-width: 0; }
.t-head h3 { font-size: 1.25rem; margin: 0; overflow-wrap: anywhere; }
.t-sub { color: var(--accent); font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.t-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px; }
.bullets { margin-top: 12px; display: grid; gap: 8px; }
.bullets li { position: relative; padding-left: 22px; color: var(--muted); }
.bullets li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--grad); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.p-card { display: flex; flex-direction: column; gap: 12px; height: 100%; min-width: 0; }
.p-card.featured { grid-column: span 2; background-image: linear-gradient(145deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%); }
@media (max-width: 720px) { .p-card.featured { grid-column: auto; } }
.p-card h3 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.p-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.p-card .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 6px; }
.badge { color: #fff; background: var(--grad); border: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filters button { cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--grad); color: #fff; border-color: transparent; }

.doc-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-family: var(--mono); font-weight: 700; font-size: .78rem; letter-spacing: .06em; flex: none; }
.doc-top { display: flex; gap: 14px; align-items: center; }
.doc-top h3 { font-size: 1.1rem; }
.doc-meta { color: var(--faint); font-size: .8rem; margin-top: 2px; }

.contact-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.contact-list { display: grid; gap: 12px; }
.contact-list a.fact { transition: transform .4s var(--ease), background-color .25s; }
@media (hover: hover) and (pointer: fine) { .contact-list a.fact:hover { transform: translate3d(5px, 0, 0); background-color: var(--glass-2); } }
.form { display: grid; gap: 16px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-msg { min-height: 1.4em; font-size: .92rem; font-weight: 550; }
.form-msg.ok { color: var(--ok); } .form-msg.bad { color: var(--danger); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } .form .two { grid-template-columns: 1fr; } }

.footer { padding: 36px 0 calc(48px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer nav { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.footer nav a:hover { color: var(--text); }
.footer .socials a { width: 38px; height: 38px; }
@media (max-width: 640px) { .footer { flex-direction: column; text-align: center; } .footer nav { justify-content: center; } }

/* ============ Reveal / skeleton / toast ============ */
.reveal { opacity: 0; transform: translate3d(0, 32px, 0) scale(.985); transition: opacity .85s var(--ease) var(--d, 0s), transform .85s var(--ease) var(--d, 0s); }
.reveal.left { transform: translate3d(-40px, 0, 0); } .reveal.right { transform: translate3d(40px, 0, 0); } .reveal.zoom { transform: scale(.92); }
.reveal.in { opacity: 1; transform: none; }
.reveal.in.lift { transition: transform .45s var(--ease), box-shadow .45s var(--ease), background-color .3s, opacity .85s var(--ease); }
@media (max-width: 700px) { .reveal { transform: translate3d(0, 22px, 0); } .reveal.left, .reveal.right { transform: translate3d(0, 22px, 0); } }

.skeleton-hero { grid-column: 1 / -1; display: grid; gap: 18px; align-content: center; min-height: 60vh; justify-items: start; }
.skeleton-hero i, .sk { display: block; height: 28px; border-radius: 14px; background-color: var(--glass); position: relative; overflow: hidden; }
.skeleton-hero i:nth-child(1) { width: min(520px, 80%); height: 90px; } .skeleton-hero i:nth-child(2) { width: min(340px, 60%); } .skeleton-hero i:nth-child(3) { width: min(440px, 70%); }
.skeleton-hero i::after, .sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent, var(--sheen), transparent); transform: translate3d(-100%, 0, 0); animation: shimmer 1.6s infinite; }
@keyframes shimmer { to { transform: translate3d(100%, 0, 0); } }

.toast-region { position: fixed; z-index: 90; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 10px; width: min(440px, 100% - 28px); pointer-events: none; }
.toast { pointer-events: auto; padding: 14px 18px; border-radius: var(--r-md); display: flex; gap: 12px; align-items: center; font-weight: 550; animation: toastIn .55s var(--ease) both; background-color: var(--glass-solid); }
.toast.ok { border-left: 4px solid var(--ok); } .toast.bad { border-left: 4px solid var(--danger); }
.toast.out { animation: toastOut .35s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translate3d(0, 24px, 0) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translate3d(0, 12px, 0) scale(.97); } }
.preview-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; padding: 8px 16px; text-align: center; font-size: .82rem; font-weight: 600; color: #fff; background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* ============ Motion preferences ============ */
/* "Reduce motion" is common on Android battery-saver and Windows with animations off.
   We keep gentle fades (so the site never looks broken/static) and drop movement + loops. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.left, .reveal.right, .reveal.zoom { transform: none; transition: opacity .5s ease var(--d, 0s); }
  .hero-in .w > span { transform: none; animation: fade .6s ease forwards; animation-delay: 0s; }
  .hero-in > :not(h1), .portrait-wrap { transform: none; animation: fade .6s ease forwards; }
  .float-chip { animation: fade .6s ease forwards; }
  .marquee-track, .dot::after, .scroll-hint i::after, .b1, .b2 { animation: none !important; }
  .timeline::before { transform: none; transition: none; }
  .lift:hover { transform: none; }
}
@keyframes fade { to { opacity: 1; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav, .float-chip, .toast { background-color: var(--glass-solid); }
}
@media print { .ambient, .nav-wrap, .progress { display: none; } .reveal { opacity: 1; transform: none; } }
