  /* ============================================================
     THEME TOKENS
     Change colors here. Dark values are duplicated in the
     media query below so it works without JS as well.
     ============================================================ */
  :root {
    color-scheme: light;
    --bg:            #f6f7f9;
    --surface:       #ffffff;
    --text:          #14161a;
    --muted:         #5c6472;
    --border:        #e2e5ea;
    --accent:        #2f5fd0;
    --accent-contrast:#ffffff;
    --accent-soft:   #e8eefc;
    --shadow:        0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06);
    --radius:        14px;
    --max:           1040px;
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg:            #0d1015;
    --surface:       #151a22;
    --text:          #e9ecf1;
    --muted:         #98a2b3;
    --border:        #242b36;
    --accent:        #8ab0ff;
    --accent-contrast:#0d1015;
    --accent-soft:   #1b2431;
    --shadow:        0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.35);
  }

  /* Follow the OS preference when the user hasn't chosen manually */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --bg:            #0d1015;
      --surface:       #151a22;
      --text:          #e9ecf1;
      --muted:         #98a2b3;
      --border:        #242b36;
      --accent:        #8ab0ff;
      --accent-contrast:#0d1015;
      --accent-soft:   #1b2431;
      --shadow:        0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.35);
    }
  }

  /* ============================================================
     BASE
     ============================================================ */
  *, *::before, *::after { box-sizing: border-box; }

  html { scroll-behavior: smooth; }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
                 Helvetica, Arial, sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s ease, color .25s ease;
  }

  a { color: var(--accent); }

  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
  }

  .wrap {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: 20px;
  }

  /* ============================================================
     HEADER
     ============================================================ */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }

  .header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 64px;
  }

  .logo {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
    text-decoration: none;
  }
  .logo span { color: var(--accent); }

  .site-nav {
    margin-left: auto;
    display: flex;
    gap: 20px;
  }
  .site-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: .92rem;
    transition: color .2s ease;
  }
  .site-nav a:hover { color: var(--text); }

  /* --- theme toggle --- */
  .theme-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background-color .2s ease;
  }
  .theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
  .theme-toggle svg { width: 18px; height: 18px; }

  /* Swap icon based on the *effective* theme */
  .theme-toggle .icon-sun { display: none; }
  :root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
  :root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  }

  /* ============================================================
     HERO
     ============================================================ */
  .hero { padding: 76px 0 56px; }

  .eyebrow {
    margin: 0 0 12px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
  }

  .hero h1 {
    margin: 0 0 18px;
    font-size: clamp(2rem, 5.5vw, 3rem);
    line-height: 1.1;
    letter-spacing: -.03em;
  }

  .lead {
    max-width: 48ch;
    margin: 0 0 28px;
    font-size: 1.08rem;
    color: var(--muted);
  }

  .actions { display: flex; flex-wrap: wrap; gap: 12px; }

  .btn {
    display: inline-block;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, background-color .2s ease,
                border-color .2s ease, color .2s ease;
  }
  .btn:hover { transform: translateY(-1px); }
  .btn-primary { background: var(--accent); color: var(--accent-contrast); }
  .btn-ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
  }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

  /* ============================================================
     SECTIONS
     ============================================================ */
  section { padding-bottom: 48px; }

  .section-head h2 {
    margin: 0 0 4px;
    font-size: 1.4rem;
    letter-spacing: -.02em;
  }
  .section-head p {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: .95rem;
  }

  /* --- cards --- */
  .grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease,
                background-color .25s ease;
  }
  .card:hover { transform: translateY(-3px); border-color: var(--accent); }

  .thumb {
    display: grid;
    width: 100%;
    overflow: hidden;
    place-items: center;
    aspect-ratio: 16 / 9;
    margin-bottom: 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-soft), var(--border));
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
  }

.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;    /* Fills the frame perfectly without squishing or stretching */
  object-position: center; /* Keeps the middle of the image focused */
  display: block;       /* Removes unwanted inline whitespace at the bottom */
  transition: transform 0.3s ease; /* For a smooth hover effect */
}

  .card h3 { margin: 0 0 6px; font-size: 1.02rem; letter-spacing: -.01em; }
  .card p { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }

  .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .tags li {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .76rem;
    color: var(--muted);
  }

  /* --- skill chips --- */
  .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .chips li {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: .87rem;
    color: var(--muted);
  }

  /* --- about --- */
  .about-grid {
    display: grid;
    gap: 32px;
    grid-template-columns: 1fr;
  }
  @media (min-width: 760px) {
    .about-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
  }
  .about-grid p { margin: 0 0 14px; color: var(--muted); }

  /* --- contact --- */
  .contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
  }
  .contact-card h2 { margin: 0 0 8px; font-size: 1.3rem; }
  .contact-card p { margin: 0 0 20px; color: var(--muted); }
  .contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* ============================================================
     FOOTER
     ============================================================ */
  .site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    font-size: .85rem;
    color: var(--muted);
  }
  .site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    justify-content: space-between;
  }

  /* ============================================================
     MOTION PREFERENCES
     ============================================================ */
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
      transition: none !important;
      animation: none !important;
    }
  }