/* ============================================================
   Shared shell for the homepage-family pages:
   index.html, index-en.html, work.html, work-en.html

   Extracted verbatim from index.html's inline <style>. The two
   homepages' stylesheets were byte-identical apart from one
   `content:` string, which is now the --preview-label custom
   property so a single file can serve both languages.

   NOT for the portfolio-pages.css family — the two stylesheets
   define .hero, .section, .nav-links and .tag* differently and
   must never be loaded together on one page.
   ============================================================ */

/* ============================================================
       DESIGN TOKENS
    ============================================================ */
    :root {
      --bg:           #0d1117;
      --surface:      #161b22;
      --surface-2:    #1c2128;
      --ink:          #e6edf3;
      --ink-2:        #c9d1d9;
      --muted:        #8b949e;
      --muted-2:      #7d858f;
      --border:       #21262d;
      --border-2:     #30363d;
      --accent:       #5274f8;
      --accent-dark:  #3651d4;
      --accent-darker:#2a41ab;
      --accent-light: rgba(79,110,247,0.14);
      --accent-text:  #7c93fb;
      --mint:         rgba(16,185,129,0.14);
      --mint-text:    #34d399;
      --amber:        rgba(245,158,11,0.14);
      --amber-text:   #fbbf24;
      --rose:         rgba(239,68,68,0.14);
      --rose-text:    #f87171;
      --dark:         #010409;
      --dark-2:       #0d1117;
      --max:          1100px;
      --ease:         cubic-bezier(0.16, 1, 0.3, 1);
      --r-sm:         8px;
      --r:            14px;
      --r-lg:         20px;
      --sh-sm:        0 1px 3px rgba(0,0,0,.22);
      --sh:           0 4px 16px rgba(0,0,0,.32), 0 1px 4px rgba(0,0,0,.22);
      --sh-lg:        0 16px 48px rgba(0,0,0,.48), 0 4px 12px rgba(0,0,0,.32);
    }

    /* ============================================================
       RESET & BASE
    ============================================================ */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; overflow-x: hidden; }
    body {
      font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      background: var(--bg);
      color: var(--ink);
      line-height: 1.65;
      overflow-x: hidden;
      min-height: 100vh;
      -webkit-font-smoothing: antialiased;
      overflow-x: hidden;
    }
    a { color: inherit; text-decoration: none; }
    img { display: block; max-width: 100%; }
    button { font: inherit; cursor: pointer; border: none; background: none; }

    .container {
      width: min(var(--max), calc(100% - 40px));
      margin: 0 auto;
    }

    /* ============================================================
       NAVBAR
    ============================================================ */
    .navbar {
      position: sticky;
      top: 0;
      z-index: 100;
      background: rgba(13, 17, 23, 0.92);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-bottom: 1px solid rgba(33, 38, 45, 0.9);
    }

    .nav-inner {
      height: 68px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
    }

    .nav-brand {
      display: flex;
      align-items: center;
      gap: 8px;
      font-weight: 700;
      font-size: 0.97rem;
      color: var(--ink);
      letter-spacing: -0.01em;
      flex-shrink: 0;
      white-space: nowrap;
    }

    .nav-logo-mark {
      flex-shrink: 0;
      border-radius: 7px;
    }

    .nav-links {
      display: flex;
      align-items: center;
      gap: 2px;
      list-style: none;
    }

    .nav-links a {
      display: inline-flex;
      align-items: center;
      white-space: nowrap;
      height: 38px;
      padding: 0 11px;
      border-radius: var(--r-sm);
      font-size: 0.875rem;
      font-weight: 500;
      color: var(--muted);
      transition: color 150ms, background 150ms;
    }

    .nav-links a:hover { color: var(--ink); background: rgba(255,255,255,0.07); }

    .nav-resume {
      display: inline-flex;
      align-items: center;
      height: 40px;
      padding: 0 20px;
      border-radius: var(--r-sm);
      background: var(--accent-dark);
      color: #fff;
      font-size: 0.875rem;
      font-weight: 600;
      flex-shrink: 0;
      transition: background 150ms, transform 160ms;
    }

    .nav-resume:hover { background: var(--accent-darker); transform: translateY(-1px); }

    /* mobile hamburger */
    .nav-toggle {
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 5px;
      width: 40px;
      height: 40px;
      border-radius: var(--r-sm);
      border: 1px solid var(--border);
      flex-shrink: 0;
    }

    .nav-toggle span {
      display: block;
      width: 16px;
      height: 2px;
      border-radius: 99px;
      background: var(--ink);
      transition: transform 220ms var(--ease), opacity 180ms;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* mobile drawer */
    .nav-mobile-panel {
      display: none;
      position: absolute;
      top: 68px;
      left: 0;
      right: 0;
      background: rgba(13, 17, 23, 0.97);
      backdrop-filter: blur(18px);
      border-bottom: 1px solid var(--border);
      padding: 12px 20px 20px;
      flex-direction: column;
      gap: 4px;
      z-index: 99;
    }

    .nav-mobile-panel.open { display: flex; }

    .nav-mobile-panel a {
      display: flex;
      align-items: center;
      height: 44px;
      padding: 0 14px;
      border-radius: var(--r-sm);
      font-size: 0.93rem;
      font-weight: 500;
      color: var(--ink-2);
      transition: background 150ms;
    }

    .nav-mobile-panel a:hover { background: rgba(255,255,255,0.07); }

    .nav-mobile-panel .resume-mobile {
      margin-top: 6px;
      justify-content: center;
      background: var(--accent-dark);
      color: #fff;
      font-weight: 600;
    }

    .nav-mobile-panel .resume-mobile:hover { background: var(--accent-darker); }

    /* ============================================================
       HERO
    ============================================================ */
    .hero {
      padding: clamp(64px, 10vw, 108px) 0 clamp(52px, 8vw, 88px);
    }

    .hero-eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 24px;
      background-color: var(--bg);
      font-size: 0.76rem;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--accent);
    }

    .hero-eyebrow::before {
      content: '';
      display: block;
      width: 28px;
      height: 2.5px;
      border-radius: 99px;
      background: var(--accent);
    }

    .hero h1 {
      font-size: clamp(3rem, 7.5vw, 5.8rem);
      font-weight: 800;
      line-height: 1.04;
      letter-spacing: -0.03em;
      color: var(--ink);
      max-width: 13ch;
      margin-bottom: 22px;
    }

    .hero-role {
      display: block;
      font-size: clamp(1rem, 1.8vw, 1.25rem);
      font-weight: 600;
      letter-spacing: -0.01em;
      color: var(--muted-2);
      margin-top: 10px;
    }

    .hero-desc {
      font-size: clamp(1rem, 1.6vw, 1.15rem);
      color: var(--muted);
      max-width: 50ch;
      line-height: 1.8;
      margin-bottom: 36px;
    }

    .hero-ctas {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
    }

    /* ============================================================
       HERO — SPLIT LAYOUT
    ============================================================ */
    .hero-inner {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 48px;
      align-items: center;
    }

    .hero-right {
      position: relative;
      height: 340px;
    }

    .hc {
      position: absolute;
      background: var(--surface);
      border: 1px solid var(--border-2);
      border-radius: var(--r);
      box-shadow: var(--sh-lg);
      padding: 18px 20px;
    }

    .hc-main {
      width: 224px;
      top: 16px;
      right: 0;
      animation: hc-float1 5s ease-in-out infinite;
    }

    .hc-tag {
      width: 200px;
      bottom: 28px;
      right: 28px;
      animation: hc-float2 6.5s ease-in-out infinite 1.2s;
    }

    .hc-pill {
      width: 128px;
      top: 138px;
      left: 0;
      padding: 12px 16px;
      animation: hc-float3 7s ease-in-out infinite 0.6s;
    }

    @keyframes hc-float1 {
      0%, 100% { transform: translateY(0); }
      50%       { transform: translateY(-14px); }
    }
    @keyframes hc-float2 {
      0%, 100% { transform: translateY(0) rotate(0.4deg); }
      50%       { transform: translateY(-10px) rotate(-0.4deg); }
    }
    @keyframes hc-float3 {
      0%, 100% { transform: translateY(0) rotate(-1deg); }
      50%       { transform: translateY(-8px) rotate(0.6deg); }
    }

    @media (prefers-reduced-motion: reduce) {
      .hc { animation: none !important; }
    }

    @media (max-width: 900px) {
      .hero-inner { grid-template-columns: 1fr; }
      .hero-right  { display: none; }
    }

    /* ============================================================
       BUTTONS
    ============================================================ */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      height: 48px;
      padding: 0 26px;
      border-radius: var(--r-sm);
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 150ms;
      line-height: 1;
      white-space: nowrap;
    }

    .btn:hover { transform: translateY(-2px); }

    .btn-dark {
      background: #3651d4;
      color: #fff;
      box-shadow: 0 4px 18px rgba(54,81,212,.35);
    }

    .btn-dark:hover {
      background: #2d47c9;
      box-shadow: 0 10px 28px rgba(54,81,212,.4);
    }

    .btn-ghost {
      background: #1c2128;
      color: #e6edf3;
      border: 1.5px solid #30363d;
      box-shadow: var(--sh-sm);
    }

    .btn-ghost:hover { border-color: #484f58; box-shadow: var(--sh); }

    /* ============================================================
       SECTION SHELL
    ============================================================ */
    .section {
      padding: clamp(56px, 9vw, 88px) 0;
      scroll-margin-top: 80px;
    }

    .section-label {
      display: inline-block;
      font-size: 0.73rem;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--accent);
      background-color: var(--bg);
      margin-bottom: 10px;
    }

    .section-title {
      font-size: clamp(1.75rem, 3.6vw, 2.5rem);
      font-weight: 700;
      letter-spacing: -0.022em;
      color: var(--ink);
      line-height: 1.12;
      margin-bottom: 36px;
    }

    /* ============================================================
       WORK CARDS
    ============================================================ */
    .works-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 20px;
    }

    .work-card {
      background: #161b22;
      border: 1px solid #21262d;
      border-radius: var(--r);
      overflow: hidden;
      box-shadow: var(--sh-sm);
      display: flex;
      flex-direction: column;
      transition: transform 240ms var(--ease), box-shadow 240ms var(--ease), border-color 200ms;
    }

    .work-card:hover {
      transform: translateY(-5px);
      box-shadow: var(--sh-lg);
      border-color: transparent;
    }

    .work-thumb {
      aspect-ratio: 16 / 10;
      overflow: clip;
      position: relative;
      background: var(--surface-2);
      flex-shrink: 0;
      display: block;
    }

    .work-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: top center;
      transition: transform 360ms var(--ease);
    }

    .work-card:hover .work-thumb img { transform: scale(1.05); }

    .work-thumb::after {
      content: var(--preview-label, 'ดูตัวอย่าง →');
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(13,17,23,0.72);
      color: #fff;
      font: 700 0.9rem/1 'Outfit', sans-serif;
      opacity: 0;
      transition: opacity 220ms var(--ease);
      pointer-events: none;
    }

    .work-card:hover .work-thumb::after,
    .work-card:focus-within .work-thumb::after { opacity: 1; }

    .work-body {
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 13px;
      flex: 1;
    }

    .work-name {
      font-size: 1rem;
      font-weight: 700;
      color: var(--ink);
      letter-spacing: -0.01em;
    }

    .work-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    /* ============================================================
       TAGS
    ============================================================ */
    .tag {
      display: inline-flex;
      align-items: center;
      height: 27px;
      padding: 0 11px;
      border-radius: 99px;
      font-size: 0.74rem;
      font-weight: 600;
      white-space: nowrap;
    }

    .tag-accent { background: var(--accent-light); color: var(--accent-text); }
    .tag-mint   { background: var(--mint);         color: var(--mint-text); }
    .tag-amber  { background: var(--amber);         color: var(--amber-text); }
    .tag-rose   { background: var(--rose);           color: var(--rose-text); }
    .tag-gray   { background: #21262d;              color: #8b949e; }

    /* ============================================================
       VIEW PROJECT BUTTON (in card)
    ============================================================ */
    .work-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; }

    .btn-project {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 42px;
      flex: 1;
      border-radius: var(--r-sm);
      background: var(--accent-dark);
      color: #fff;
      font-size: 0.85rem;
      font-weight: 600;
      transition: background 150ms, transform 150ms;
    }

    .btn-project:hover { background: var(--accent-darker); transform: translateY(-1px); }

    .btn-github {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      height: 42px;
      padding: 0 13px;
      border-radius: var(--r-sm);
      background: transparent;
      border: 1px solid rgba(255,255,255,0.13);
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 500;
      text-decoration: none;
      flex-shrink: 0;
      transition: background 150ms, color 150ms, border-color 150ms;
    }
    .btn-github:hover {
      background: rgba(255,255,255,0.06);
      color: var(--fg);
      border-color: rgba(255,255,255,0.28);
    }
    .btn-github svg { width: 15px; height: 15px; flex-shrink: 0; }

    /* ============================================================
       FILTER BAR
    ============================================================ */
    .featured-strip { margin-bottom: 28px; }

    .featured-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 14px;
    }

    .featured-head h3 {
      font: 700 1.05rem/1.3 'Outfit', sans-serif;
      color: var(--fg);
    }

    .featured-nav { display: flex; gap: 8px; }

    .carousel-nav {
      width: 40px;
      height: 40px;
      border-radius: var(--r-sm);
      border: 1.5px solid var(--border);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      background: var(--surface);
      cursor: pointer;
      transition: color 150ms, border-color 150ms, transform 160ms, background 150ms;
    }

    .carousel-nav:hover {
      color: var(--fg);
      border-color: var(--border-2);
      background: var(--surface-2);
    }

    .carousel-nav:disabled {
      opacity: 0.4;
      cursor: default;
    }

    .carousel-nav:disabled:hover {
      color: var(--muted);
      border-color: var(--border);
      background: var(--surface);
    }

    .carousel-nav svg { width: 18px; height: 18px; }

    .featured-track {
      display: flex;
      gap: 16px;
      overflow-x: auto;
      scroll-snap-type: x mandatory;
      scrollbar-width: none;
      padding-bottom: 4px;
    }

    .featured-track::-webkit-scrollbar { display: none; }

    .featured-track .work-card {
      scroll-snap-align: start;
      min-width: 280px;
      max-width: 280px;
      flex-shrink: 0;
    }

    .filter-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 36px;
    }

    .filter-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      height: 36px;
      padding: 0 16px;
      border-radius: 99px;
      border: 1px solid rgba(255,255,255,0.12);
      background: transparent;
      color: var(--muted);
      font: 600 0.8rem/1 'Outfit', sans-serif;
      cursor: pointer;
      transition: background 150ms, color 150ms, border-color 150ms;
    }

    .filter-btn:hover {
      background: rgba(255,255,255,0.06);
      color: var(--fg);
      border-color: rgba(255,255,255,0.28);
    }

    .filter-btn.active {
      background: var(--accent-dark);
      color: #fff;
      border-color: transparent;
    }

    .filter-btn .filter-count {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 18px;
      height: 18px;
      padding: 0 5px;
      border-radius: 99px;
      background: rgba(255,255,255,0.18);
      color: var(--ink-2); /* contrast ≥4.5:1 on pill bg */
      font-size: 0.7rem;
      font-weight: 700;
    }

    .filter-btn.active .filter-count { background: rgba(0,0,0,0.28); color: #fff; }

    /* ============================================================
       WORK ARCHIVE — sidebar filter + results pane
       The sidebar reuses .filter-btn verbatim so assets/site-ui.js,
       which drives the same filter on index.html, needs no change.
       Only the flex axis of the container differs from .filter-bar.
    ============================================================ */
    .work-layout {
      display: grid;
      grid-template-columns: 240px minmax(0, 1fr);
      gap: 28px;
      align-items: start;
    }

    .work-filter {
      position: sticky;
      top: 88px;
      padding: 18px;
      border: 1px solid var(--border);
      border-radius: var(--r);
      background: var(--surface);
    }

    .work-filter > summary {
      font: 700 0.95rem/1 'Outfit', sans-serif;
      color: var(--ink);
      cursor: pointer;
      list-style: none;
    }

    .work-filter > summary::-webkit-details-marker { display: none; }
    .work-filter > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

    .work-search {
      display: block;
      width: 100%;
      height: 38px;
      margin: 14px 0 6px;
      padding: 0 12px;
      border: 1px solid var(--border-2);
      border-radius: 8px;
      background: var(--bg);
      color: var(--ink);
      font: 500 0.86rem/1 'Outfit', sans-serif;
    }

    .work-search::placeholder { color: var(--muted); }
    .work-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

    .work-filter .filter-bar {
      flex-direction: column;
      align-items: stretch;
      gap: 4px;
      margin: 14px 0 0;
    }

    /* Stacked and left-aligned, with the count pushed to the right edge */
    .work-filter .filter-btn {
      justify-content: flex-start;
      height: 34px;
      padding: 0 10px;
      border-color: transparent;
      border-radius: 8px;
      text-align: left;
    }

    .work-filter .filter-btn .filter-count { margin-left: auto; }

    /* Tag pills. These were a passive .work-tagcloud under the grid until the
       labels were mapped onto the cards via data-tags; now they filter, so
       they belong beside the other controls. */
    .tag-filter {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 18px;
      padding-top: 16px;
      border-top: 1px solid var(--border);
    }

    .tag-filter-label {
      width: 100%;
      margin-bottom: 2px;
      color: var(--muted);
      font: 700 0.78rem/1 'Outfit', sans-serif;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .tag-btn {
      border: 1px solid transparent;
      cursor: pointer;
      font-family: inherit;
      transition: filter 150ms, border-color 150ms;
    }

    .tag-btn:hover { filter: brightness(1.25); }
    .tag-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

    .tag-btn[aria-pressed="true"] {
      border-color: var(--accent);
      box-shadow: 0 0 0 1px var(--accent);
    }

    .work-results-head {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 18px;
    }

    .result-count {
      margin: 0;
      color: var(--muted);
      font-size: 0.9rem;
    }

    .featured-toggle {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      height: 32px;
      padding: 0 14px;
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 99px;
      background: transparent;
      color: var(--muted);
      font: 600 0.8rem/1 'Outfit', sans-serif;
      cursor: pointer;
      transition: background 150ms, color 150ms, border-color 150ms;
    }

    .featured-toggle:hover { border-color: rgba(255,255,255,0.28); color: var(--fg); }

    .featured-toggle[aria-pressed="true"] {
      background: var(--accent-dark);
      border-color: transparent;
      color: #fff;
    }

    .featured-toggle[aria-pressed="true"] .filter-count { background: rgba(0,0,0,0.28); color: #fff; }

    .crumbs {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin: 0 0 12px;
      padding: 0;
      list-style: none;
      color: var(--muted);
      font-size: 0.85rem;
    }

    .crumbs a { color: var(--muted); text-decoration: none; }
    .crumbs a:hover { color: var(--accent-text); text-decoration: underline; }
    .crumbs li + li::before { content: "\203A"; margin-right: 8px; }
    .crumbs [aria-current="page"] { color: var(--ink); }

    @media (max-width: 900px) {
      .work-layout { grid-template-columns: minmax(0, 1fr); }
      .work-filter { position: static; }
      .work-filter > summary::after { content: " \25BE"; }
      .work-filter[open] > summary::after { content: " \25B4"; }
      .work-filter .filter-bar { flex-direction: row; flex-wrap: wrap; }
      .work-filter .filter-btn { justify-content: center; }
      .work-filter .filter-btn .filter-count { margin-left: 6px; }
    }

    /* Visually hidden but exposed to assistive tech */
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    /* Empty state shown when a filter matches no cards */
    .works-empty {
      grid-column: 1 / -1;
      padding: 48px 16px;
      text-align: center;
      color: var(--muted);
      font-size: 0.95rem;
      background: var(--surface);
      border: 1px dashed var(--border-2);
      border-radius: var(--r);
    }

    .works-empty[hidden] { display: none; }

    .work-tagcloud {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 32px;
      padding-top: 32px;
      border-top: 1px solid var(--border);
    }

    .work-tagcloud-label {
      width: 100%;
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--muted);
      margin-bottom: 4px;
    }

    .work-card {
      transition: opacity 250ms ease, transform 250ms ease;
    }

    .work-card[data-hidden] {
      display: none;
    }

    /* ============================================================
       ABOUT + EXPERIENCE — 2-COL CARDS
    ============================================================ */
    .two-col {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      align-items: start;
    }

    .card {
      background: #161b22;
      border: 1px solid #21262d;
      border-radius: var(--r);
      padding: clamp(22px, 3vw, 32px);
      box-shadow: var(--sh-sm);
    }

    .card-title {
      font-size: 1.15rem;
      font-weight: 700;
      color: var(--ink);
      letter-spacing: -0.01em;
      margin-bottom: 14px;
    }

    .card-text {
      font-size: 0.93rem;
      color: var(--muted);
      line-height: 1.78;
      margin-bottom: 12px;
    }

    .card-link {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 0.88rem;
      font-weight: 600;
      /* --accent-text, not --accent. On the page background (#0d1117) --accent
         clears 4.5:1, but inside a .card (#161b22) it is 4.29:1 and fails.
         --accent-text is the accent tuned for dark surfaces: 6.11:1. */
      color: var(--accent-text);
      margin-top: 6px;
      transition: gap 150ms;
    }

    .card-link:hover { gap: 9px; }

    .card-price {
      font-size: 1.5rem;
      font-weight: 800;
      color: var(--ink);
      letter-spacing: -0.01em;
      margin-bottom: 2px;
    }

    .card-duration {
      font-size: 0.82rem;
      color: var(--muted);
      margin-bottom: 16px;
    }

    .card-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 9px;
      margin-bottom: 14px;
    }

    .card-list li {
      font-size: 0.9rem;
      color: var(--muted);
      line-height: 1.6;
      padding-left: 20px;
      position: relative;
      overflow-wrap: anywhere;
    }

    .card-list li::before {
      content: "";
      position: absolute;
      left: 0;
      top: 0.55em;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--accent);
    }

    .card-note {
      font-size: 0.85rem;
      color: var(--muted);
      line-height: 1.6;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid var(--border);
      overflow-wrap: anywhere;
    }

    .card-cta-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 14px;
      margin-top: 16px;
    }

    .card-cta-row .card-link { margin-top: 0; }

    .card-cta-secondary {
      display: inline-flex;
      align-items: center;
      font-size: 0.88rem;
      font-weight: 600;
      color: var(--muted);
      transition: color 150ms;
    }

    .card-cta-secondary:hover { color: var(--ink); }

    /* ============================================================
       TESTIMONIALS
    ============================================================ */
    .testimonial-stars {
      display: flex;
      gap: 3px;
      margin-bottom: 14px;
    }

    .testimonial-stars svg {
      width: 16px;
      height: 16px;
      fill: var(--amber-text);
    }

    .testimonial-quote {
      font-size: 0.98rem;
      color: var(--ink-2);
      line-height: 1.75;
      margin-bottom: 18px;
    }

    .testimonial-author {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.85rem;
      color: var(--muted);
    }

    .testimonial-author strong {
      color: var(--ink);
      font-weight: 600;
    }

    .testimonial-source {
      display: inline-flex;
      align-items: center;
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: #8ba4ff;
      background: var(--accent-light);
      padding: 3px 8px;
      border-radius: 999px;
    }

    .testimonials-footer {
      margin-top: 32px;
      text-align: center;
    }

    /* About photo */
    .about-photo {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      object-fit: cover;
      object-position: top center;
      display: block;
      margin-bottom: 18px;
      border: 2.5px solid var(--border-2);
      box-shadow: var(--sh-sm);
      background: var(--surface-2); /* fallback while loading */
    }

    /* experience items */
    .exp-item { margin-bottom: 22px; }
    .exp-item:last-child { margin-bottom: 0; }

    .exp-role {
      font-size: 1rem;
      font-weight: 700;
      color: var(--ink);
      margin-bottom: 3px;
    }

    .exp-period {
      font-size: 0.81rem;
      color: var(--muted);
      margin-bottom: 13px;
    }

    .exp-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
    }

    /* ============================================================
       CASE STUDIES — DARK CARDS
    ============================================================ */
    .case-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 20px;
    }

    .case-card {
      background: var(--dark);
      border: 1px solid rgba(255,255,255,0.07);
      border-radius: var(--r);
      overflow: hidden;
      box-shadow: var(--sh-lg);
      display: flex;
      flex-direction: column;
      transition: transform 240ms var(--ease), box-shadow 240ms;
    }

    .case-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 28px 72px rgba(0,0,0,.22);
    }

    .case-thumb {
      aspect-ratio: 16 / 9;
      overflow: hidden;
      background: var(--dark-2);
      position: relative;
      display: block;
    }

    .case-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: top;
      opacity: 0.78;
      transition: transform 360ms var(--ease), opacity 220ms;
    }

    .case-card:hover .case-thumb img { transform: scale(1.04); opacity: 0.9; }

    .case-thumb::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(to bottom, transparent 44%, rgba(15,23,42,.62));
      pointer-events: none;
    }

    .case-body {
      padding: 22px 24px 26px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      flex: 1;
    }

    .case-eyebrow {
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      color: rgba(255,255,255,.38);
    }

    .case-name {
      font-size: 1.06rem;
      font-weight: 700;
      color: #fff;
      line-height: 1.35;
      letter-spacing: -0.01em;
    }

    .case-desc {
      font-size: 0.86rem;
      color: rgba(255,255,255,.52);
      line-height: 1.68;
      flex: 1;
    }

    .btn-live {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      height: 38px;
      padding: 0 20px;
      border-radius: var(--r-sm);
      background: var(--accent-dark);
      color: #fff;
      font-size: 0.82rem;
      font-weight: 600;
      align-self: flex-start;
      margin-top: 8px;
      transition: background 150ms, transform 150ms;
    }

    .btn-live:hover { background: #2b41ab; transform: translateY(-1px); }

    /* ============================================================
       CONTACT / FOOTER
    ============================================================ */
    .footer-section {
      background: #010409;
      border-top: 1px solid #21262d;
      padding: clamp(48px, 7vw, 72px) 0 clamp(36px, 5vw, 52px);
      scroll-margin-top: 80px;
    }

    .footer-grid {
      display: grid;
      grid-template-columns: 1.5fr 1fr 1fr;
      gap: clamp(32px, 5vw, 72px);
      align-items: start;
    }

    .footer-brand-name {
      font-size: 1rem;
      font-weight: 700;
      color: var(--ink);
      margin-bottom: 5px;
    }

    .footer-brand-email {
      font-size: 0.87rem;
      color: var(--muted);
    }

    .footer-col-label {
      font-size: 0.76rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.09em;
      color: var(--muted);
      margin-bottom: 16px;
    }

    .footer-nav {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 11px;
    }

    .footer-nav a {
      font-size: 0.88rem;
      color: var(--ink-2);
      transition: color 150ms;
    }

    .footer-nav a:hover { color: var(--accent); }

    .social-row { display: flex; gap: 10px; }

    .social-btn {
      width: 40px;
      height: 40px;
      border-radius: var(--r-sm);
      border: 1.5px solid var(--border);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      background: var(--surface);
      transition: color 150ms, border-color 150ms, transform 160ms, background 150ms;
    }

    .social-btn:hover {
      color: var(--ink);
      border-color: var(--border-2);
      background: var(--surface-2);
      transform: translateY(-2px);
    }

    .social-btn svg { width: 17px; height: 17px; fill: currentColor; }

    .footer-copy {
      margin-top: 48px;
      padding-top: 22px;
      border-top: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
      font-size: 0.82rem;
      color: var(--muted);
    }

    .footer-copy a { color: var(--accent); font-weight: 600; }
    .footer-copy a:hover { text-decoration: underline; }

    /* ============================================================
       SCROLL REVEAL
    ============================================================ */
    .reveal {
      opacity: 0;
      transform: translateY(22px);
      transition: opacity 560ms var(--ease), transform 560ms var(--ease);
    }

    .reveal.visible {
      opacity: 1;
      transform: translateY(0);
    }

    /* ============================================================
       REDUCED MOTION
    ============================================================ */
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
      }
      html { scroll-behavior: auto; }
      .reveal { opacity: 1; transform: none; }
    }

    /* ============================================================
       SKIP LINK
    ============================================================ */
    .skip-link {
      position: absolute;
      top: -100px;
      left: 16px;
      z-index: 9999;
      background: var(--accent-dark);
      color: #fff;
      font-size: 0.88rem;
      font-weight: 700;
      padding: 10px 18px;
      border-radius: var(--r-sm);
      text-decoration: none;
      transition: top 0.15s;
    }
    .skip-link:focus { top: 16px; }

    /* ============================================================
       FOCUS STYLES
    ============================================================ */
    a:focus-visible,
    button:focus-visible {
      outline: 3px solid rgba(79,110,247,.46);
      outline-offset: 3px;
      border-radius: 4px;
    }

    /* ============================================================
       RESPONSIVE
    ============================================================ */
    @media (max-width: 1024px) {
      .works-grid { grid-template-columns: repeat(2, 1fr); }
    }

    @media (max-width: 900px) {
      .case-grid { grid-template-columns: repeat(2, 1fr); }
    }

    /* The navbar search needs room, so the link list collapses into the
       hamburger well before the old 768px breakpoint. */
    @media (max-width: 1180px) {
      .nav-links  { display: none; }
      .nav-resume { display: none; }
      .nav-toggle { display: flex; }
    }

    @media (max-width: 768px) {
      .two-col    { grid-template-columns: 1fr; }
      .case-grid  { grid-template-columns: 1fr; }
      .footer-grid { grid-template-columns: 1fr 1fr; }
    }

    @media (max-width: 640px) {
      .works-grid  { grid-template-columns: 1fr; }
      .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    }

    @media (max-width: 480px) {
      .hero h1    { font-size: clamp(2.6rem, 14vw, 3.4rem); }
      .hero-ctas  { flex-direction: column; }
      .hero-ctas .btn { width: 100%; }
      /* Contact form send button goes full-width on very small screens */
      /* Work-foot: keep project button dominant, github stays compact */
      .work-foot  { flex-wrap: wrap; }
      .btn-project { min-width: 140px; flex: 1; }
      .btn-github  { flex-shrink: 0; }
    }

    @media (max-width: 360px) {
      .hero h1   { font-size: clamp(1.9rem, 11vw, 2.3rem); }
      .btn-project, .btn-github { width: 100%; flex: none; }
      .work-foot { gap: 6px; }
    }

    /* ============================================================
       AVAILABILITY BADGE
    ============================================================ */
    .avail-badge {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      background: rgba(34,197,94,.12);
      border: 1px solid rgba(34,197,94,.35);
      color: #16a34a;
      font-size: .78rem;
      font-weight: 600;
      letter-spacing: .02em;
      padding: 5px 12px;
      border-radius: 99px;
      margin-bottom: 20px;
    }
    .avail-dot {
      width: 7px; height: 7px;
      background: #22c55e;
      border-radius: 50%;
      animation: pulse-dot 2s ease-in-out infinite;
      flex-shrink: 0;
    }
    @keyframes pulse-dot {
      0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); }
      50%      { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
    }

    /* ============================================================
       WORK CARD — PROBLEM STATEMENT
    ============================================================ */
    .work-problem {
      font-size: .78rem;
      color: var(--muted);
      line-height: 1.5;
      margin: 4px 0 8px;
    }

    /* ============================================================
       CONTACT SECTION
    ============================================================ */
    .contact-section {
      background: #090d13;
      color: #fff;
      padding: 80px 0;
    }
    .contact-section .section-label { color: rgba(255,255,255,.45); }
    .contact-section .section-title { color: #fff; margin-bottom: 12px; }
    .contact-lead {
      color: rgba(255,255,255,.65);
      font-size: 1rem;
      max-width: 480px;
      margin: 0 0 36px;
      line-height: 1.65;
    }
    .contact-direct {
      margin-top: 28px;
      font-size: .85rem;
      color: rgba(255,255,255,.45);
    }
    .contact-direct a {
      color: rgba(255,255,255,.75);
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    /* ── Tech stack marquee ─────────────────────── */
    .stack-sec { padding: 6px 0 30px; overflow: hidden; }
    .stack-mask {
      overflow: hidden;
      -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
      mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    }
    .stack-track { display: flex; width: max-content; padding: 11px 0; animation: stack-left 38s linear infinite; }
    .stack-track.rev { animation-name: stack-right; }
    .stack-mask:hover .stack-track { animation-play-state: paused; }
    .stack-group { display: flex; align-items: center; gap: 46px; padding-right: 46px; }
    .stack-item {
      display: flex; align-items: center; gap: 9px;
      color: var(--muted); font-size: 13.5px; font-weight: 500; white-space: nowrap;
      transition: color 0.3s var(--ease);
    }
    .stack-item svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
    .stack-item:hover { color: var(--ink-2); }
    @keyframes stack-left  { from { transform: translateX(0); }    to { transform: translateX(-50%); } }
    @keyframes stack-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
    @media (prefers-reduced-motion: reduce) {
      .stack-track { animation: none; width: auto; }
      .stack-group { flex-wrap: wrap; justify-content: center; }
      .stack-group.dup { display: none; }
    }
    .active-filter{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin:0 0 1.1rem;font-size:.92rem;color:var(--muted);}
    .active-filter[hidden]{display:none;}
    .active-filter strong{color:var(--ink);}
    .active-filter-clear{border:1px solid var(--border);background:transparent;color:var(--ink);border-radius:999px;padding:.28rem .8rem;font:inherit;font-size:.85rem;cursor:pointer;}
    .active-filter-clear:hover{border-color:var(--accent);color:var(--accent-text);}
    .active-filter-clear:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}

    /* Need selector */
    .need-sub{margin:0 0 1.8rem;color:var(--muted);max-width:52ch;}
    .need-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:.9rem;}
    .need-tile{display:flex;flex-direction:column;gap:.45rem;padding:1.1rem 1rem;border:1px solid var(--border);border-radius:var(--r);background:var(--surface);text-decoration:none;color:inherit;transition:border-color .18s var(--ease),transform .18s var(--ease);}
    .need-tile:hover{border-color:var(--accent);transform:translateY(-2px);}
    .need-tile:focus-visible{outline:2px solid var(--accent);outline-offset:3px;}
    .need-tile svg{width:26px;height:26px;stroke:var(--accent-text);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
    .need-tile strong{font-size:1rem;line-height:1.35;color:var(--ink);}
    .need-tile span{font-size:.86rem;color:var(--muted);line-height:1.45;}
    @media (max-width:900px){.need-grid{grid-template-columns:repeat(2,1fr);}}
    @media (prefers-reduced-motion:reduce){.need-tile{transition:none;}.need-tile:hover{transform:none;}}
