  :root {
    --bg: #f8fafc; --surface: #ffffff; --surface-2: #f1f5f9; --ink: #0f172a; --muted: #475569;
    --line: #e2e8f0; --accent: #2563eb; --accent-ink: #ffffff; --chip: #e0e7ff; --chip-ink: #3730a3;
    --shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.06);
  }
  :root[data-theme="dark"] {
    --bg: #0b1220; --surface: #111a2e; --surface-2: #0f172a; --ink: #f1f5f9; --muted: #94a3b8;
    --line: #1e293b; --accent: #3b82f6; --accent-ink: #ffffff; --chip: #1e2a4a; --chip-ink: #c7d2fe;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #0b1220; --surface: #111a2e; --surface-2: #0f172a; --ink: #f1f5f9; --muted: #94a3b8;
      --line: #1e293b; --accent: #3b82f6; --chip: #1e2a4a; --chip-ink: #c7d2fe;
      --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    }
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; scroll-padding-top: 72px; }
  body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
  a { color: inherit; }
  img { max-width: 100%; display: block; }
  .wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
  section { padding: 72px 0; }
  h2 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
  .eyebrow { color: var(--accent); font-weight: 600; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
  .lead { color: var(--muted); max-width: 640px; margin: 0 0 32px; }

  /* nav */
  header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
  .brand { font-weight: 700; text-decoration: none; }
  .links { display: flex; align-items: center; gap: 22px; font-size: .92rem; }
  .links a { text-decoration: none; color: var(--muted); }
  .links a:hover { color: var(--ink); }
  .icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 1rem; }
  .menu-btn { display: none; }
  .icon-btn { transition: transform .15s ease, background .2s ease, border-color .2s ease; }
  .icon-btn:hover { border-color: var(--accent); }
  .icon-btn:active { transform: scale(.92); }
  .bars { position: relative; display: block; width: 16px; height: 12px; margin: auto; }
  .bars i { position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s cubic-bezier(.2,.7,.2,1), top .3s cubic-bezier(.2,.7,.2,1), opacity .2s ease; }
  .bars i:nth-child(1) { top: 0; }
  .bars i:nth-child(2) { top: 5px; }
  .bars i:nth-child(3) { top: 10px; }
  .menu-btn[aria-expanded="true"] { border-color: var(--accent); }
  .menu-btn[aria-expanded="true"] .bars i:nth-child(1) { top: 5px; transform: rotate(45deg); }
  .menu-btn[aria-expanded="true"] .bars i:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .menu-btn[aria-expanded="true"] .bars i:nth-child(3) { top: 5px; transform: rotate(-45deg); }
  @media (max-width: 720px) {
    .menu-btn { display: inline-block; }
    .links { position: absolute; top: 64px; left: 0; right: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px 16px;
             visibility: hidden; opacity: 0; transform: translateY(-10px); pointer-events: none;
             transition: opacity .25s ease, transform .3s cubic-bezier(.2,.7,.2,1), visibility 0s linear .3s; }
    .links.open { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition-delay: 0s; }
    .links a { padding: 10px 0; width: 100%; opacity: 0; transform: translateY(-8px); transition: opacity .3s ease, transform .3s ease, color .2s ease; }
    .links.open a { opacity: 1; transform: none; }
    .links.open a:nth-child(1) { transition-delay: .08s; }
    .links.open a:nth-child(2) { transition-delay: .13s; }
    .links.open a:nth-child(3) { transition-delay: .18s; }
    .links.open a:nth-child(4) { transition-delay: .23s; }
  }

  /* hero */
  .hero { padding: 72px 0 56px; }
  .hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
  .status { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; margin-bottom: 20px; }
  .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
  h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 16px; }
  h1 em { font-style: normal; color: var(--accent); }
  .hero p { color: var(--muted); font-size: 1.1rem; max-width: 560px; margin: 0 0 24px; }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
  .chip { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--chip-ink); }
  .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
  .btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
  .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .btn.wa { background: #25d366; border-color: #25d366; color: #ffffff; }
  .btn:hover { filter: brightness(.96); }
  .portrait { justify-self: center; width: min(320px, 70vw); aspect-ratio: 1; border-radius: 28px; object-fit: cover; box-shadow: var(--shadow); border: 1px solid var(--line); }
  @media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } .portrait { order: -1; width: 180px; border-radius: 50%; } }

  /* about + experience */
  .band { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .about { max-width: 700px; color: var(--muted); font-size: 1.05rem; }
  .timeline { display: grid; gap: 20px; }
  .job { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; box-shadow: var(--shadow); }
  .job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-bottom: 8px; }
  .job h3 { margin: 0; font-size: 1.05rem; }
  .job .co { color: var(--accent); font-weight: 600; }
  .job time { color: var(--muted); font-size: .88rem; }
  .job ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
  .job li { margin-bottom: 4px; }
  .job li b { color: var(--ink); }

  /* projects */
  .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; row-gap: 0; }
  .card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-rows: subgrid; grid-row: span 5; row-gap: 0; margin-bottom: 24px; }
  .card-body { display: contents; }
  .card-body > * { margin: 12px 24px 0; }
  .card-top { display: flex; align-items: center; gap: 14px; margin-top: 24px !important; }
  .logo { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 4px; flex: none; }
  .logo.ph { display: grid; place-items: center; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; font-weight: 700; border: 0; }
  .card h3 { margin: 0; font-size: 1.2rem; }
  .card .sub { color: var(--muted); font-size: .88rem; }
  .card-body > p { margin: 12px 24px 0; color: var(--muted); font-size: .95rem; }
  .label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
  .tech { font-size: .85rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 12px; }
  .shots { margin-top: 16px; display: flex; gap: 12px; padding: 0 24px 24px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: 24px; }
  .shots img { height: 280px; width: auto; border-radius: 12px; border: 1px solid var(--line); scroll-snap-align: start; flex: none; background: var(--surface-2); }
  .shots .ph-shot { height: 280px; width: 140px; flex: none; border-radius: 12px; border: 1px dashed var(--line); display: grid; place-items: center; text-align: center; font-size: .78rem; color: var(--muted); padding: 10px; background: var(--surface-2); }
  .card.wide .shots { padding-top: 0; }
  @media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

  /* contact */
  .contact { text-align: center; }
  .contact .lead { margin-left: auto; margin-right: auto; }
  .contact .cta { justify-content: center; }
  .contact .cta .btn { min-width: 176px; justify-content: center; }
  footer { border-top: 1px solid var(--line); padding: 24px 0; text-align: center; color: var(--muted); font-size: .85rem; }
  .btn svg { width: 18px; height: 18px; }
  .cta .views { position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .9rem; overflow: visible; }
  .cta .views:not([hidden]) { animation: viewsIn .6s cubic-bezier(.2,.8,.2,1) both, glow 3.6s ease-in-out 1.2s infinite; }
  .cta .views::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(100deg, transparent 40%, color-mix(in srgb, var(--accent) 28%, transparent) 50%, transparent 60%) no-repeat; background-size: 250% 100%; background-position: 130% 0; animation: sheen 6s ease 1s infinite; pointer-events: none; }
  .cta .views .eye { position: relative; display: inline-flex; color: var(--accent); }
  .cta .views .eye svg { width: 18px; height: 18px; animation: blink 6s ease-in-out 2s infinite; transform-origin: center; }
  .cta .views .live { position: absolute; top: -2px; right: -3px; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
  .cta .views .live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #22c55e; animation: ping 2s ease-out infinite; }
  .cta .views b { color: var(--ink); }
  .odo { display: inline-flex; height: 1.3em; line-height: 1.3em; overflow: hidden; vertical-align: bottom; font-variant-numeric: tabular-nums; }
  .odo .d { display: inline-block; height: 1.3em; overflow: hidden; }
  .odo .col { display: flex; flex-direction: column; transition: transform 1.2s cubic-bezier(.15,.8,.2,1); }
  .odo .col span { height: 1.3em; display: block; }
  @keyframes viewsIn { from { opacity: 0; transform: translateX(-10px) scale(.92); } to { opacity: 1; transform: none; } }
  @keyframes sheen { 0% { background-position: 130% 0; } 25%, 100% { background-position: -30% 0; } }
  @keyframes glow {
    0%, 100% { box-shadow: 0 0 0 0 transparent; border-color: var(--line); }
    50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 12%, transparent), 0 0 20px color-mix(in srgb, var(--accent) 22%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  }
  @keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(3.2); opacity: 0; } }
  @keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

  /* scroll motion (only active when JS adds .js; honours reduced-motion) */
  .progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); transform-origin: left; transform: scaleX(0); z-index: 20; }
  .js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0ms); }
  .js .reveal.from-left { transform: translateX(-28px); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .card .shots img, .js .card .shots .ph-shot { opacity: 0; transform: translateX(28px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) * 110ms + 300ms); }
  .js .card.in .shots img, .js .card.in .shots .ph-shot { opacity: 1; transform: none; }
  .js .card .chip { opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease; transition-delay: calc(var(--c, 0) * 45ms + 250ms); }
  .js .card.in .chip { opacity: 1; transform: none; }
  .btn, .card, .job { transition: transform .2s ease, box-shadow .2s ease, filter .2s ease; }
  .btn:hover { transform: translateY(-2px); }
  .links a.active { color: var(--ink); }
  @media (min-width: 721px) {
    .links a { position: relative; padding-bottom: 2px; }
    .links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2,.7,.2,1);
      background: linear-gradient(90deg, var(--accent) 0 38%, color-mix(in srgb, var(--accent) 30%, #fff) 50%, var(--accent) 62% 100%) no-repeat; background-size: 260% 100%; background-position: 130% 0; }
    .links a.active::after { transform: scaleX(1); animation: navshine 4.5s ease-in-out .8s infinite; }
  }
  @keyframes navshine { 0% { background-position: 130% 0; } 30%, 100% { background-position: -30% 0; } }
  @media (max-width: 720px) { .links a.active { color: var(--accent); } }
  @media (prefers-reduced-motion: reduce) {
    .links a::after { transition: none !important; animation: none !important; }
    .js .reveal, .js .card .shots img, .js .card .shots .ph-shot, .js .card .chip { opacity: 1 !important; transform: none !important; transition: none !important; }
    .progress { display: none; }
    .links, .links a, .bars i, .icon-btn { transition: none !important; }
    .cta .views, .cta .views::after, .cta .views .eye svg, .cta .views .live::after, .odo .col { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
  }

  /* experience: heading on the left, jobs on the right */
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 56px; align-items: start; }
  .split .sec-head { position: sticky; top: 96px; }
  .split .sec-head .lead { margin-bottom: 0; }
  @media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 24px; } .split .sec-head { position: static; } .split .sec-head .lead { margin-bottom: 8px; } }
  /* phones: screenshot strips run edge to edge so they scroll off both sides evenly */
  @media (max-width: 820px) { .shots { padding-left: 0; scroll-padding-left: 0; } }
  /* phones: contact buttons stack, one per line, all the same width */
  @media (max-width: 560px) {
    .contact .cta { flex-direction: column; align-items: stretch; max-width: 320px; margin-left: auto; margin-right: auto; }
    .contact .cta .btn { justify-content: center; }
  }
  /* hero buttons: same width on desktop, stacked one per line on phones */
  .hero .cta .btn, .hero .cta .views { min-width: 176px; justify-content: center; }
  .hero .cta .views { min-height: 50px; }
  @media (max-width: 560px) {
    .hero .cta { flex-direction: column; align-items: stretch; max-width: 320px; }
  }
