/* ─────────────────────────────────────────────────────────────────
   PERSONAL SITE — main.css
   Studio-Noteform-flavoured brutalism: huge geometric sans, hard
   colour blocks (orange / ink / soft grey), corner-meta strips,
   numbered sections.
   ───────────────────────────────────────────────────────────────── */

/* ── reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, blockquote { margin: 0; padding: 0; }
img, video { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; }

/* ── tokens ────────────────────────────────────────────────────── */
:root {
  --ink: #0a0a0a;
  --paper: #ededed;
  --paper-soft: #d4d4d4;
  --paper-deep: #1a1a1a;
  --accent: #fe4a1f;          /* the punchy orange-red from the references */
  --rule: rgba(10,10,10,0.18);
  --rule-on-dark: rgba(237,237,237,0.22);
  --muted: #6a6a6a;

  --grid: 1.5rem;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  --display: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ── document ──────────────────────────────────────────────────── */
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";  /* nicer Inter alternates */
  line-height: 1.5;
}

/* ── layout primitives ─────────────────────────────────────────── */
.wrap {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.4rem;
}
.bleed {
  /* full-width-of-wrap panel that ignores the wrap padding */
  margin-left: -1.4rem;
  margin-right: -1.4rem;
  padding-left: 1.4rem;
  padding-right: 1.4rem;
}

/* ── corner meta strip ─────────────────────────────────────────── */
/* Flex layout so missing fields (e.g. SECTION on the index page) collapse
   gracefully instead of leaving an empty grid cell. */
.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 2rem;
  align-items: flex-start;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.9rem 0 0.7rem;
  border-bottom: 1px solid currentColor;
  opacity: 0.92;
  position: relative;     /* anchor for the share dropdown */
}
.meta-strip > div,
.meta-strip > .share { flex: 1 1 8rem; min-width: 8rem; line-height: 1.35; }
.meta-strip .field-label { display: block; opacity: 0.55; margin-bottom: 0.15rem; }
.meta-strip .mark {
  width: 0.85rem; height: 0.85rem; border: 1px solid currentColor; border-radius: 50%;
  flex: 0 0 auto;
  align-self: flex-start;
  margin-left: auto;
}
@media (max-width: 720px) {
  .meta-strip { gap: 0.6rem 1.4rem; }
  .meta-strip > div,
  .meta-strip > .share { flex-basis: 40%; }
  .meta-strip .mark { display: none; }
}

/* ── hero panel ────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  padding: 1.2rem 1.4rem 2.2rem;
  margin: 0 -1.4rem 2.6rem;
}
.hero--accent { background: var(--accent); color: var(--paper); }
.hero--soft   { background: var(--paper-soft); color: var(--ink); }

.hero__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3rem, 11vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 1.6rem 0 0;
  max-width: 14ch;
}
.hero__sub {
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.4;
  max-width: 38rem;
  margin-top: 1rem;
  opacity: 0.88;
}
.hero__index {
  position: absolute;
  top: 0.95rem;
  right: 1.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
  text-align: right;
}
.hero__num {
  position: absolute;
  right: 1.4rem;
  bottom: 0.9rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 5.4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

/* ── nav ───────────────────────────────────────────────────────── */
.nav {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0;
  margin-bottom: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.4rem; align-items: center; }
.nav a {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  gap: 0.35rem;
  align-items: baseline;
  padding: 0.2rem 0;
}
.nav a .num { font-size: 0.62rem; opacity: 0.6; }
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--accent);
}
.nav a[aria-current="page"] .num { opacity: 1; }

/* ── headings (in body content) ────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h1 { font-size: 2.6rem; margin: 1.4rem 0 0.7rem; }
h2 { font-size: 1.7rem; margin: 1.6rem 0 0.6rem; }
h3 { font-size: 1.2rem; margin: 1.2rem 0 0.4rem; }

/* ── prose ─────────────────────────────────────────────────────── */
.prose { max-width: 42rem; }
.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose figure { margin-bottom: var(--grid); font-size: 1.02rem; line-height: 1.6; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
}
.prose a:hover { color: var(--accent); }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  font-style: normal;
  color: var(--muted);
}
.prose code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: rgba(10,10,10,0.07);
  padding: 0.05em 0.3em;
  border-radius: 2px;
}
.prose pre {
  font-family: var(--mono);
  background: var(--ink);
  color: var(--paper);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin-bottom: var(--grid);
  border-radius: 2px;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4rem 0;
}

/* ── post / page meta ─────────────────────────────────────────── */
.meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.7rem;
}
.meta .cat {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 0.15rem 0.5rem;
  margin-right: 0.4rem;
  text-decoration: none;
  border-radius: 2px;
}
.meta .cat:hover { background: var(--accent); }
.meta .read-time,
.read-time {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

/* ── section labels (numbered) ────────────────────────────────── */
.section-head {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1.4rem;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  padding-top: 0.8rem;
  margin: 2.6rem 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-head .num { font-weight: 500; }
.section-head .label { color: var(--ink); }

/* ── post listing (tabular) ───────────────────────────────────── */
.post-list {
  list-style: none;
  border-top: 1px solid var(--rule);
}
.post-list li {
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 0;
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  column-gap: 1.4rem;
  align-items: start;
}
.post-list .date {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 0.4rem;     /* nudge down so it sits with the headline baseline */
}
.post-list .body { min-width: 0; }   /* lets long titles wrap inside grid */
.post-list h3 { margin: 0; font-size: 1.4rem; line-height: 1.2; letter-spacing: -0.01em; }
.post-list h3 a { color: var(--ink); text-decoration: none; }
.post-list h3 a:hover { color: var(--accent); }
.post-list .excerpt { color: var(--muted); font-size: 0.95rem; margin-top: 0.4rem; max-width: 38rem; }

.post-list .post-cat {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 0.22rem 0.55rem;
  border-radius: 2px;
  white-space: nowrap;
  justify-self: end;
  align-self: start;
  margin-top: 0.55rem;     /* aligns visually with the headline */
}

@media (max-width: 720px) {
  .post-list li { grid-template-columns: 5rem 1fr; row-gap: 0.4rem; }
  .post-list .post-cat {
    grid-column: 2;
    justify-self: start;
    margin-top: 0;
  }
}

/* ── about page ───────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 1.8rem;
  align-items: start;
  margin-top: 1.4rem;
}
.about-grid .portrait {
  border: 0;
  width: 100%;
  background: var(--ink);
}
@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-grid .portrait { max-width: 16rem; }
}

/* ── photo project grid (Studio-Noteform "Projects" plate) ────── */
.project-strip {
  background: var(--ink);
  color: var(--paper);
  padding: 1.6rem 1.4rem 2rem;
  margin: 0 -1.4rem 2.4rem;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.4rem 1.2rem;
}
.project-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.project-card,
.project-card:visited,
.project-card a,
.project-card a:visited { color: inherit; text-decoration: none; }
.project-card .cover {
  aspect-ratio: 4/3;
  width: 100%;
  background: #222;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  margin-bottom: 0.6rem;
}
.project-card .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.project-card .row .title { font-weight: 500; }
.project-card .row .year { opacity: 0.65; }
.project-card:hover .cover { filter: grayscale(0); }
.project-card:hover .row .title { color: var(--accent); }

/* same grid on a paper background (for the homepage section index) */
.project-grid--paper .project-card .cover { background: var(--paper-soft); }

/* ── photo project page ───────────────────────────────────────── */
.photo-stack figure { margin-bottom: var(--grid); }
.photo-stack img { width: 100%; }

/* ── ttrpg list ───────────────────────────────────────────────── */
.ttrpg-list { list-style: none; border-top: 1px solid var(--rule); }
.ttrpg-list > li {
  border-bottom: 1px solid var(--rule);
  padding: 1.6rem 0;
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 1.6rem;
}
.ttrpg-list .cover {
  aspect-ratio: 3/4;
  width: 100%;
  background: var(--ink);
  filter: grayscale(1);
  object-fit: cover;
}
.ttrpg-list h3 {
  font-size: 2rem;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}
.ttrpg-list .status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  margin-left: 0.4rem;
  vertical-align: middle;
  border: 1px solid currentColor;
  border-radius: 2px;
}
.ttrpg-list .status.released    { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ttrpg-list .status.in-progress { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.ttrpg-list .blurb { color: var(--ink); margin: 0.5rem 0 0.9rem; max-width: 38rem; }
.ttrpg-list .links { display: flex; flex-wrap: wrap; gap: 0.5rem; }

@media (max-width: 720px) {
  .ttrpg-list > li { grid-template-columns: 1fr; }
  .ttrpg-list .cover { max-width: 12rem; }
  .ttrpg-list h3 { font-size: 1.5rem; }
}

/* ── buttons / chips ──────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 0.5rem 0.85rem;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border-radius: 2px;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.accent { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.btn.accent:hover { background: var(--ink); border-color: var(--ink); }

/* ── footer ───────────────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding: 1.4rem 0 2.4rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* ── selection ────────────────────────────────────────────────── */
::selection { background: var(--accent); color: var(--paper); }

/* ─────────────────────────────────────────────────────────────────
   SHARE DROPDOWN (in the meta strip)
   <div class="share">
     <button class="share__toggle" aria-expanded="false">Share / Link ↗</button>
     <div class="share__menu" hidden>…options…</div>
   </div>
   Plain button + div instead of <details>/<summary> — Safari has nasty
   quirks with native <details> toggles (preventDefault is unreliable),
   and rolling our own with aria-expanded is more predictable.
   ───────────────────────────────────────────────────────────────── */

.share { position: relative; }

.share__toggle {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: left;
  padding: 0;
  margin: 0;
  width: 100%;
  cursor: pointer;
  line-height: inherit;
}
.share__toggle:focus-visible { outline: 1px dashed currentColor; outline-offset: 3px; }

.share__arrow {
  display: inline-block;
  margin-left: 0.15rem;
  transition: transform 0.15s ease;
}
.share__toggle[aria-expanded="true"] .share__arrow { transform: rotate(45deg); }

.share__menu {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  z-index: 50;
  min-width: 14rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0;
  box-shadow: 6px 6px 0 var(--accent);
  font-family: var(--mono);
  border-radius: 2px;
}
/* On the orange (accent) hero, the orange shadow disappears. Use ink instead. */
.hero--accent .share__menu { box-shadow: 6px 6px 0 var(--ink); }
.share__menu[hidden] { display: none !important; }

.share__opt {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  align-items: center;
  width: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.share__opt:hover,
.share__opt:focus {
  background: var(--accent);
  color: var(--paper);
  outline: none;
}
.share__opt-num { opacity: 0.5; }
.share__opt.is-copied .share__opt-label::after {
  content: " ✓ Copied";
  opacity: 0.8;
  margin-left: 0.4rem;
}

/* On mobile, anchor the dropdown to the meta-strip's left edge so it doesn't
   overflow when the share field is in the second column of a 2-up layout. */
@media (max-width: 720px) {
  .share__menu { left: 0; right: auto; }
}

/* ─────────────────────────────────────────────────────────────────
   FOOTNOTES (littlefoot.js v4) — overrides for the new palette.
   ───────────────────────────────────────────────────────────────── */

.littlefoot__button {
  background: var(--ink) !important;
  border: 0 !important;
  border-radius: 2px !important;
  box-shadow: none !important;
  color: var(--paper) !important;
  font-family: var(--mono) !important;
  font-size: 0.66rem !important;
  font-weight: 500 !important;
  letter-spacing: 0;
  line-height: 1 !important;
  height: auto !important;
  width: auto !important;
  min-width: 1.3rem;
  margin: 0 0.15rem 0 0.05rem;
  padding: 0.18rem 0.35rem !important;
  vertical-align: super;
  transform: translateY(-0.1rem);
  transition: none !important;
}
.littlefoot__button:hover,
.littlefoot__button.is-active {
  background: var(--accent) !important;
  color: var(--paper) !important;
}
.littlefoot__button .littlefoot__circle { display: none !important; }

.littlefoot__popover {
  background: var(--ink) !important;
  border: 0 !important;
  border-radius: 2px !important;
  box-shadow: 6px 6px 0 var(--accent) !important;
  color: var(--paper) !important;
  font-family: var(--sans) !important;
  font-size: 0.95rem !important;
  max-width: 28rem !important;
  padding: 0 !important;
}
.littlefoot__popover::after { display: none !important; }
.littlefoot__wrapper { background: transparent !important; border-radius: 0 !important; padding: 0 !important; }
.littlefoot__content {
  padding: 0.85rem 1rem !important;
  background: transparent !important;
  border-radius: 0 !important;
  font-family: var(--sans) !important;
  color: var(--paper) !important;
}
.littlefoot__content p { margin: 0 0 0.5rem; }
.littlefoot__content p:last-child { margin-bottom: 0; }
.littlefoot__content a { color: var(--accent); text-decoration: underline; }
.littlefoot__content a:hover { color: var(--paper); }

.littlefoot__popover::before {
  display: block !important;
  content: "FOOTNOTE";
  font-family: var(--mono) !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent) !important;
  color: var(--paper) !important;
  padding: 0.3rem 0.6rem !important;
}

html.js .footnotes { display: none; }
