/* ------------------------------------------------------------------
   Shared styles for content pages (WORK, NOTES, case studies).
   Palette + type mirror the landing page (index.html) so the site
   reads as one system.
------------------------------------------------------------------ */
:root {
  --bg: #0a0c12;
  --panel: #10131c;
  --border: #1e2230;
  --fg: #d8dde8;
  --dim: #9aa2b5;
  --faint: #868ca0;
  --accent: #9bb3d8;
  --maxw: 900px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
  overscroll-behavior-y: none;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--fg); }

img { max-width: 100%; height: auto; display: block; }

/* ---- site header ---- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px);
  background: rgba(10, 12, 18, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
}
.site-head .brand { color: var(--fg); letter-spacing: 0.32em; }
.site-head .brand:hover { color: var(--accent); }
.site-head nav { display: flex; gap: clamp(14px, 2.4vw, 28px); }
.site-head nav a { color: var(--dim); }
.site-head nav a:hover, .site-head nav a[aria-current="page"] { color: var(--fg); }

/* ---- layout ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 40px); }

.eyebrow { font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--faint); margin: 0 0 14px; }

h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 18px; font-weight: 600; }
h2 { font-size: clamp(18px, 3vw, 22px); letter-spacing: 0.02em; margin: 56px 0 16px; font-weight: 600; }
.lede { font-size: clamp(16px, 2.4vw, 19px); color: var(--dim); max-width: 60ch; margin: 0 0 8px; }

.back-link { display: inline-block; margin-bottom: 18px; color: var(--faint); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.back-link:hover { color: var(--fg); }
.content-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 24px 0 8px; color: var(--faint); font-size: 11px; letter-spacing: .06em; }
.content-date { flex: 0 0 auto; white-space: nowrap; }
.content-tags { display: flex; flex: 1 1 220px; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.content-tags a { display: block; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--faint); font-size: 10px; line-height: 1.4; letter-spacing: .04em; transition: color .2s ease, border-color .2s ease, background .2s ease; }
.content-tags a:hover { border-color: var(--faint); background: var(--panel); color: var(--fg); }

p { max-width: 68ch; }

/* ---- meta row (case study) ---- */
.meta { display: flex; flex-wrap: wrap; gap: 28px; margin: 28px 0 8px; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.meta div { display: grid; gap: 4px; }
.meta dt { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); }
.meta dd { margin: 0; font-size: 14px; color: var(--fg); }

/* ---- tags ---- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.tags li { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }

/* ---- notes / work index cards ---- */
.cards { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); margin-top: 40px; }
.card {
  position: relative;
  display: grid; gap: 14px;
  background: var(--bg);
  padding: clamp(22px, 3vw, 34px);
  transition: background 0.2s ease;
}
a.card:hover { background: var(--panel); }
/* Whole card is the link — a single corner arrow signals it, no per-card button. */
a.card::after {
  content: "→";
  position: absolute;
  top: clamp(22px, 3vw, 34px);
  right: clamp(22px, 3vw, 34px);
  color: var(--faint);
  transition: color 0.2s ease, transform 0.2s ease;
}
a.card:hover::after { color: var(--accent); transform: translateX(3px); }
.card .idx { font-size: 12px; color: var(--faint); letter-spacing: 0.2em; }
.card h3 { margin: 0; font-size: clamp(19px, 3vw, 24px); color: var(--fg); font-weight: 600; }
.card p { margin: 0; color: var(--dim); font-size: 14.5px; max-width: 60ch; }
.card[hidden] { display: none; }

/* ---- tag filter bar (Notes) ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.filters button {
  font: inherit; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dim); background: none; border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px; cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.filters button:hover { color: var(--fg); border-color: var(--faint); }
.filters button[aria-pressed="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.filters + .cards { margin-top: 16px; }

/* ---- figures / galleries ---- */
figure { margin: 24px 0; }
figure img { border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
figure figcaption { margin-top: 10px; font-size: 12.5px; color: var(--faint); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 28px 0; }
.gallery img { border: 1px solid var(--border); border-radius: 6px; background: var(--panel); width: 100%; }

/* ---- prev / next ---- */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--border); font-size: 13px; }
.pager a { max-width: 46%; }
.pager .stub { color: var(--faint); }
.pager .lbl { display: block; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.pager-next { text-align: right; }

/* ---- case study image lightbox ---- */
.lightbox-trigger { cursor: zoom-in; }
.lightbox-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.image-lightbox { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: clamp(48px, 7vw, 76px) clamp(16px, 4vw, 48px) 24px; overflow: hidden; border: 0; background: rgb(7 9 14 / .96); color: var(--fg); }
.image-lightbox[open] { display: grid; place-items: center; }
.image-lightbox::backdrop { background: rgb(7 9 14 / .88); backdrop-filter: blur(5px); }
.lightbox-content { display: grid; justify-items: center; gap: 12px; width: 100%; height: 100%; min-height: 0; }
.lightbox-content img { width: auto; max-width: 100%; height: auto; max-height: calc(100dvh - 120px); align-self: center; object-fit: contain; border: 0; border-radius: 0; background: transparent; }
.lightbox-caption { align-self: end; max-width: 72ch; margin: 0; color: var(--dim); font-size: 11px; text-align: center; }
.lightbox-close { position: fixed; z-index: 2; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid #3a4150; border-radius: 50%; background: #10131c; color: var(--fg); font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.lightbox-close:hover, .lightbox-close:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }

/* ---- footer ---- */
.site-foot { border-top: 1px solid var(--border); color: var(--faint); font-size: 12px; letter-spacing: 0.06em; padding: 28px clamp(16px, 4vw, 40px); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---- notes / blog list ---- */
.post-list { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); }
.post-list li { background: var(--bg); padding: 22px clamp(18px, 3vw, 30px); }
.post-list time { font-size: 12px; color: var(--faint); letter-spacing: 0.14em; }
.empty { color: var(--dim); border: 1px dashed var(--border); border-radius: 8px; padding: 32px; margin-top: 40px; text-align: center; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- mobile header: keep brand on one line, tighten spacing ---- */
@media (max-width: 600px) {
  .site-head { padding: 14px 16px; letter-spacing: 0.14em; }
  .site-head .brand { letter-spacing: 0.14em; white-space: nowrap; }
  .site-head nav { gap: clamp(12px, 4vw, 18px); }
}
@media (max-width: 380px) {
  .site-head { font-size: 11px; letter-spacing: 0.06em; }
  .site-head .brand { letter-spacing: 0.06em; }
  .site-head nav { gap: 10px; }
}

/* ---- VS Code developer ergonomics note ---- */
.vscode-principles-note .wrap { max-width: 900px; }
.vscode-principles-note .lede { max-width: 58ch; }

.vscode-essay {
  margin-top: clamp(52px, 8vw, 76px);
  padding-top: clamp(32px, 5vw, 48px);
  border-top: 1px solid var(--border);
}
.vscode-essay p {
  margin: 0 0 20px;
  color: var(--fg);
  font-size: 15px;
}
.vscode-essay > ol {
  width: min(100%, 68ch);
  margin: 0;
  padding-left: 28px;
  font-size: 15px;
}
.vscode-essay > ol li + li { margin-top: 12px; }
.vscode-essay h2 { margin-top: clamp(44px, 7vw, 64px); }
.learning-diagram {
  width: min(100%, 68ch);
  margin: 34px 0;
  padding: 22px 18px 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 15px;
}
.learning-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.learning-steps::before {
  content: "";
  position: absolute;
  top: 16px;
  right: calc(12.5% - 16px);
  left: calc(12.5% - 16px);
  height: 1px;
  background: var(--faint);
  opacity: .55;
}
.learning-steps li {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}
.step-marker {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 1px solid var(--faint);
  border-radius: 50%;
  background: var(--panel);
  color: var(--faint);
  font-size: 9px;
}
.learning-steps li:last-child .step-marker {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}
.learning-diagram figcaption {
  margin-top: 18px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 680px) {
  .learning-diagram { padding: 18px; }
  .learning-steps {
    grid-template-columns: 1fr;
  }
  .learning-steps::before {
    top: 16px;
    right: auto;
    bottom: 16px;
    left: 16px;
    width: 1px;
    height: auto;
  }
  .learning-steps li {
    grid-template-columns: 33px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 12px;
    min-height: 52px;
    font-size: 12px;
    text-align: left;
  }
}
