  :root {
    --bg: #121212;
    --dot: rgba(255, 255, 255, 0.075);
    --card: #1d1d1d;
    --card-line: rgba(255, 255, 255, 0.07);
    --panel: #161616;
    --panel-line: rgba(255, 255, 255, 0.05);
    --chip: #232323;
    --text: #ececec;
    --dim: #9a9a9a;
    --faint: #6a6a6a;
    --yellow: #f2d633;
    --green: #3fd77f;
    --red: #ff5b54;
    --blue: #4c9dff;
    --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
    --btn: #f5f5f5;
    --btn-hover: #ffffff;
    --btn-ink: #121212;
    --hover: #2a2a2a;
    --shadow: rgba(0, 0, 0, 0.4);
    --card-hover-line: rgba(255, 255, 255, 0.12);
    --dot-main: #f0f0f0;
    --dot-ring: rgba(255, 255, 255, 0.06);
    --dot-off: #5c5c5c;
    --dashed: rgba(255, 255, 255, 0.14);
    color-scheme: dark;
  }

  /* Light theme: used when the system prefers light (and no choice is saved),
     or when the visitor picks it with the toggle. */
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
      --bg: #f3f3f1;
      --dot: rgba(0, 0, 0, 0.11);
      --card: #ffffff;
      --card-line: rgba(0, 0, 0, 0.08);
      --panel: #f6f6f4;
      --panel-line: rgba(0, 0, 0, 0.05);
      --chip: #e9e9e6;
      --text: #161616;
      --dim: #5d5d5d;
      --faint: #8a8a8a;
      --btn: #161616;
      --btn-hover: #000000;
      --btn-ink: #f5f5f5;
      --hover: #e2e2de;
      --shadow: rgba(0, 0, 0, 0.08);
      --card-hover-line: rgba(0, 0, 0, 0.16);
      --dot-main: #161616;
      --dot-ring: rgba(0, 0, 0, 0.06);
      --dot-off: #b5b5b5;
      --dashed: rgba(0, 0, 0, 0.18);
      --yellow: #d9b600;
      --green: #1fa85a;
      color-scheme: light;
    }
  }
  :root[data-theme="light"] {
    --bg: #f3f3f1;
    --dot: rgba(0, 0, 0, 0.11);
    --card: #ffffff;
    --card-line: rgba(0, 0, 0, 0.08);
    --panel: #f6f6f4;
    --panel-line: rgba(0, 0, 0, 0.05);
    --chip: #e9e9e6;
    --text: #161616;
    --dim: #5d5d5d;
    --faint: #8a8a8a;
    --btn: #161616;
    --btn-hover: #000000;
    --btn-ink: #f5f5f5;
    --hover: #e2e2de;
    --shadow: rgba(0, 0, 0, 0.08);
    --card-hover-line: rgba(0, 0, 0, 0.16);
    --dot-main: #161616;
    --dot-ring: rgba(0, 0, 0, 0.06);
    --dot-off: #b5b5b5;
    --dashed: rgba(0, 0, 0, 0.18);
    --yellow: #d9b600;
    --green: #1fa85a;
    color-scheme: light;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; }

  body {
    background-color: var(--bg);
    background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.4px);
    background-size: 22px 22px;
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }

  a { color: inherit; text-decoration: none; }

  .wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

  /* ---------- header ---------- */

  header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 88px;
  }
  .logo { display: flex; align-items: center; gap: 12px; font-weight: 400; font-size: 17px; }
  .logo svg { width: 30px; height: 30px; }
  nav { display: flex; align-items: center; gap: 8px; }
  .tab {
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 400;
    color: var(--dim);
    transition: color .15s, background .15s;
  }
  .tab:hover { color: var(--text); background: var(--chip); }

  .pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 400;
    white-space: nowrap;
    transition: transform .12s, background .15s;
  }
  .pill svg { width: 16px; height: 16px; flex: none; }
  .pill.white { background: var(--btn); color: var(--btn-ink); box-shadow: 0 6px 20px var(--shadow); }
  .pill.white:hover { background: var(--btn-hover); transform: translateY(-1px); }
  .pill.dark { background: var(--chip); border: 1px solid var(--card-line); }
  .pill.dark:hover { background: var(--hover); }

  /* ---------- intro ---------- */

  .intro { padding: 72px 0 64px; max-width: 640px; }
  .intro .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 12px;
    border-radius: 999px;
    background: var(--chip);
    border: 1px solid var(--card-line);
    font-size: 13px;
    color: var(--dim);
  }
  .intro h1 {
    font-size: clamp(38px, 6vw, 60px);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin: 22px 0 16px;
  }
  .intro p { color: var(--dim); font-size: 18px; margin: 0; }

  /* ---------- projects ---------- */

  .section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 400;
    margin: 0 0 18px;
  }
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
  }

  .card {
    background: var(--card);
    border: 1px solid var(--card-line);
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 18px 40px var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform .15s, border-color .15s;
  }
  .card:hover { transform: translateY(-2px); border-color: var(--card-hover-line); }
  .card-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 14px; font-size: 16px; font-weight: 400; }
  .card-head .host { margin-left: auto; color: var(--faint); font-size: 13px; }

  .desc { margin: 0 10px 4px; color: var(--dim); font-size: 14.5px; min-height: 3em; }

  .panel {
    background: var(--panel);
    border: 1px solid var(--panel-line);
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 10px;
  }
  .facts { list-style: none; margin: 0; padding: 0; }
  .facts li { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; padding: 4px 0; }
  .facts li .v { margin-left: auto; color: var(--text); }

  .dot { display: inline-block; width: 9px; height: 1.5px; border-radius: 1px; background: currentColor; flex: none; }
  .dot.status.green { background: var(--green); }
  .dot.status.yellow { background: var(--yellow); }
  .dot.status.red { background: var(--red); }
  .dot.status.blue { background: var(--blue); }
  .dot.status.gray { background: var(--dot-off); }
  .eyebrow .dot.green, .dot.status { width: 8px; height: 8px; border-radius: 50%; }
  .eyebrow .dot.green { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }

  .card .pill { margin-top: auto; }
  .card .panel { margin-bottom: 10px; }

  .card.soon {
    background: transparent;
    border: 1px dashed var(--dashed);
    box-shadow: none;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--faint);
    font-size: 15px;
  }
  .card.soon:hover { transform: none; }

  /* ---------- footer ---------- */

  footer { margin-top: 96px; border-top: 1px solid var(--card-line); }
  footer .wrap {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 22px;
    padding-bottom: 36px;
    color: var(--faint);
    font-size: 13.5px;
  }
  footer a:hover { color: var(--text); }

  @media (max-width: 600px) {
    .wrap { padding: 0 16px; }
    header .wrap { height: 72px; }
      .intro { padding: 40px 0 44px; }
    .intro p { font-size: 16px; }
    .grid { grid-template-columns: 1fr; }
  }

  /* ---------- theme toggle ---------- */

  .theme-toggle {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--chip);
    border: 1px solid var(--card-line);
    color: var(--text);
    cursor: pointer;
    padding: 0;
    transition: background .15s;
  }
  .theme-toggle:hover { background: var(--hover); }
  .theme-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
  .theme-toggle svg { width: 17px; height: 17px; }
  .theme-toggle .sun { display: none; }
  :root[data-theme="light"] .theme-toggle .sun { display: block; }
  :root[data-theme="light"] .theme-toggle .moon { display: none; }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .theme-toggle .sun { display: block; }
    :root:not([data-theme="dark"]) .theme-toggle .moon { display: none; }
  }

  header, main, footer { position: relative; z-index: 1; }
