/* ---- tokens -------------------------------------------------------------- */
:root {
  --bg:        #f2f6f2;
  --surface:   #ffffff;
  --border:    #dbe5dc;
  --text:      #1f2a24;
  --muted:     #5c6b62;
  --status:    #2f6b4a;
  --status-sf: #e4f0e8;
  --link:      #2f6b4a;
  --link-sf:   #e4f0e8;
  --shadow:    0 1px 2px rgba(31, 42, 36, .06), 0 8px 24px rgba(31, 42, 36, .06);
  --radius:    14px;
  --maxw:      1040px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #101713;
    --surface:   #1a231e;
    --border:    #2c3830;
    --text:      #e9f0eb;
    --muted:     #94a49a;
    --status:    #7fc9a0;
    --status-sf: #1e2f26;
    --link:      #7fc9a0;
    --link-sf:   #1e2f26;
    --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

:root[data-theme="dark"] {
  --bg:        #101713;
  --surface:   #1a231e;
  --border:    #2c3830;
  --text:      #e9f0eb;
  --muted:     #94a49a;
  --status:    #7fc9a0;
  --status-sf: #1e2f26;
  --link:      #7fc9a0;
  --link-sf:   #1e2f26;
  --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}

/* ---- base ---------------------------------------------------------------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--surface); padding: 10px 16px; border-radius: 8px;
}
.skip:focus { left: 16px; top: 16px; z-index: 10; }

:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

/* ---- topbar -------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 60px; flex-wrap: wrap;
}

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 650; color: var(--text); text-decoration: none;
  margin-right: auto;
}
.brand-mark { width: 26px; height: 26px; display: block; }

.nav { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 6px 12px; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-size: 15px;
}
.nav a:hover { background: var(--link-sf); color: var(--link); }

.theme-toggle {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  width: 34px; height: 34px; border-radius: 999px; cursor: pointer; font-size: 15px;
}
.theme-toggle:hover { color: var(--link); border-color: var(--link); }

/* ---- hero ---------------------------------------------------------------- */
.hero { padding: 72px 0 40px; }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 6vw, 3.1rem);
  line-height: 1.1; letter-spacing: -0.02em;
}
.tagline { margin: 0; color: var(--muted); font-size: 1.12rem; max-width: 56ch; }

/* ---- sections ------------------------------------------------------------ */
.sections { padding-bottom: 72px; }

.section { padding-top: 48px; scroll-margin-top: 76px; }

.section-head {
  border-top: 1px solid var(--border);
  padding-top: 24px; margin-bottom: 24px;
}
.section-head h2 {
  margin: 0 0 6px; font-size: 1.4rem; letter-spacing: -0.01em;
}
.section-head p { margin: 0; color: var(--muted); }

.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

.card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--link); }

.card h3 { margin: 0; font-size: 1.06rem; }

/* A linked card title covers the whole card, so the card reads as clickable
   while the tags below stay individually clickable (they sit above it). */
.card-title { color: inherit; text-decoration: none; }
.card-title::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-title:hover { color: var(--link); }
.card:focus-within { border-color: var(--link); }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tag {
  font-size: .74rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 999px;
}

/* Clickable tags sit above the card-title overlay so they keep their own link. */
.tag-link { position: relative; z-index: 1; padding: 0; border: 0; }
.tag-link a {
  display: block; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); text-decoration: none;
}
.tag-link a:hover { color: var(--link); border-color: var(--link); background: var(--link-sf); }

.tags, .card-foot { position: relative; z-index: 1; }
.card-foot a { position: relative; z-index: 1; }

.card-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: auto; padding-top: 6px; font-size: .9rem;
}
.status { color: var(--status); background: var(--status-sf); padding: 2px 9px; border-radius: 999px; font-size: .78rem; }

.notice { color: var(--muted); }

/* ---- footer -------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--muted); font-size: .92rem;
}
.footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- project detail page -------------------------------------------------- */
.hero-project { padding-top: 40px; }

.backlink { margin: 0 0 14px; font-size: .92rem; }
.backlink a { text-decoration: none; }
.backlink a:hover { text-decoration: underline; }

.meta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 0 0; }

.prose { max-width: 68ch; }
.prose p { margin: 0 0 16px; }
.prose ul { margin: 0; padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--text); }
.prose code {
  font-size: .9em; background: var(--link-sf); color: var(--link);
  padding: 1px 6px; border-radius: 6px;
}

/* ---- preview mode (local only) -------------------------------------------- */
/* Planned projects are hidden from visitors; these styles only ever appear
   when you are viewing locally or with ?preview. */
.preview-banner {
  margin: 28px 0 0;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: .9rem;
}

.card-planned {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  opacity: .72;
}
.card-planned:hover { opacity: 1; }

.badge-planned {
  font-size: .78rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  padding: 2px 9px;
  border-radius: 999px;
}
