/* ==========================================================================
   ronald-tan.com — homepage
   Same paper, ink and terracotta as the blog archive (src/assets/css/site.css),
   in a single reading column. Fonts are the blog's files under /blog/assets/fonts/.
   ========================================================================== */

@font-face { font-family: "Fraunces"; src: url("/blog/assets/fonts/fraunces-normal.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/blog/assets/fonts/fraunces-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/blog/assets/fonts/source-serif-4-normal.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/blog/assets/fonts/source-serif-4-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/blog/assets/fonts/ibm-plex-mono-normal-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/blog/assets/fonts/ibm-plex-mono-normal-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* ---------- tokens (kept in step with the blog) ---------- */
:root {
  --paper: #f4efe6;
  --ink: #1d1b18;
  --ink-2: #5b554c;
  --rule: #d6ccbb;
  --rule-strong: #b5aa97;
  --accent: #a64b2a;   /* terracotta */
  --accent-text: #8e3f23; /* accent dark enough for small text on paper */
  --on-accent: #ffffff;
  --live: #2f5d46;   /* pine green */

  --f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --f-body: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* page width and side margins: the same as the blog's front page (.wrap in src/assets/css/site.css) */
  --page: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 3px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12151a; --ink: #ece5d8; --ink-2: #a8a195;
    --rule: #2c323c; --rule-strong: #4a515c;
    --accent: #e08a62; --accent-text: #e08a62; --on-accent: #12151a; --live: #7fb89a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12151a; --ink: #ece5d8; --ink-2: #a8a195;
  --rule: #2c323c; --rule-strong: #4a515c;
  --accent: #e08a62; --accent-text: #e08a62; --on-accent: #12151a; --live: #7fb89a;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--f-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-text); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--paper); }
h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0 0 1rem; text-wrap: pretty; }
.skip { position: absolute; left: -999px; top: 0; padding: .6rem 1rem; background: var(--ink); color: var(--paper); z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.col { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }

/* ---------- header ---------- */
.top__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-block: 1.25rem; border-bottom: 1px solid var(--rule);
}
.mark {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px;
  font: 600 1.25rem/1 var(--f-display); text-decoration: none;
}
.mark svg { width: 1.6rem; height: 1.6rem; }
.mark__disc { fill: var(--accent); }
.mark__lines { stroke: var(--paper); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.25rem; font: 400 0.875rem/1 var(--f-mono); }
.nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.nav a:hover { text-decoration: underline; }
/* the one nav item that leaves the page */
.nav__page { padding-left: 1.25rem; border-left: 1px solid var(--rule); font-weight: 500; }
.nav__page--next { padding-left: 0; border-left: 0; }

/* ---------- the room (hi-fi) above the page, unless the visitor chose lo-fi ---------- */
html[data-mode="lofi"] .room { display: none; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-right: -10px;
  background: none; border: 0; color: inherit; cursor: pointer; border-radius: var(--radius);
}
.theme-toggle svg { width: 1.15rem; height: 1.15rem; }
.theme-toggle:hover { color: var(--accent-text); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(3rem, 9vw, 5.5rem) clamp(2.5rem, 6vw, 4rem); }
.hero h1 {
  font: 400 clamp(2.75rem, 8vw, 4.75rem)/1.02 var(--f-display);
  letter-spacing: -0.025em; margin-bottom: 1.75rem;
}
.lede { font-size: clamp(1.15rem, 2.4vw, 1.3rem); line-height: 1.55; }
.lede strong { font-weight: 600; }
.lede--quiet { color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 2rem 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 1.15rem;
  border: 1px solid var(--ink); border-radius: var(--radius);
  font: 500 0.9rem/1 var(--f-mono); text-decoration: none;
}
.btn:hover { color: var(--accent-text); border-color: var(--accent); }
.btn--solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--solid:hover { color: var(--on-accent); filter: brightness(1.08); }

/* ---------- sections ---------- */
.block { padding-block: 0 3.5rem; scroll-margin-top: 1.5rem; }
.kicker {
  font: 500 0.8rem/1 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.kicker::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; margin-bottom: 0.75rem; }
.title-row h3 { font: 600 1.75rem/1.15 var(--f-display); }
.badge {
  font: 400 0.78rem/1 var(--f-mono); padding: 0.3rem 0.65rem;
  border: 1px solid var(--accent); color: var(--accent-text); border-radius: 999px;
}

.cards { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.card { border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 1.15rem 1.25rem; }
.card__meta { font: 400 0.75rem/1 var(--f-mono); color: var(--ink-2); letter-spacing: 0.06em; }
.card__name { font: 600 1.2rem/1.2 var(--f-display); margin: 0.6rem 0 0.4rem; }
.card p { margin: 0; font-size: 1rem; color: var(--ink-2); }
.empty {
  margin: 1.5rem 0 0; padding: 1rem 1.25rem; border: 1px dashed var(--rule-strong); border-radius: var(--radius);
  font: 400 0.9rem/1.5 var(--f-mono); color: var(--ink-2);
}

.specs {
  margin: 1.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: minmax(7.5rem, max-content) 1fr; gap: 0.6rem 1.5rem;
  font: 400 0.92rem/1.5 var(--f-mono);
}
.specs dt { color: var(--ink-2); }
.specs dd { margin: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); margin-right: 0.55rem; vertical-align: 0.1em; }
@media (max-width: 30rem) { .specs { grid-template-columns: 1fr; gap: 0.1rem; } .specs dd { margin-bottom: 0.6rem; } }

.archive { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.archive__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; margin-bottom: 1rem; }
.archive__head h3 { font: 400 1.5rem/1.2 var(--f-display); }
.archive__head h3 a { text-decoration: none; }
.archive__head h3 a:hover { text-decoration: underline; }
.archive__count { font: 400 0.85rem/1.4 var(--f-mono); color: var(--ink-2); }
.archive__strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
/* phones: one large photo, two below */
@media (max-width: 40rem) {
  .archive__strip { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .archive__strip li:first-child { grid-column: 1 / -1; }
}
.archive__strip a { display: block; overflow: hidden; border-radius: 2px; }
.archive__strip img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 0.4s ease; }
.archive__strip a:hover img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .archive__strip img { transition: none; } }
.archive__note { margin: 0.75rem 0 0; color: var(--ink-2); font-size: 1rem; }

.books { list-style: none; margin-block: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 2rem 2.5rem; }
.book { display: grid; grid-template-columns: 8rem 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 30rem) { .book { grid-template-columns: 6rem 1fr; gap: 1rem; } }
.book__cover { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; box-shadow: 0 2px 8px rgb(0 0 0 / 0.18); outline: 1px solid var(--rule-strong); outline-offset: -1px; }
.book cite { display: block; font: italic 400 1.3rem/1.25 var(--f-display); margin-bottom: 0.2rem; }
.books cite { font-style: italic; }
.books__by { color: var(--ink-2); }
.books__note { display: block; margin-top: 0.6rem; color: var(--ink-2); font-size: 1rem; }

.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 2rem; font: 400 0.95rem/1 var(--f-mono); }
.links a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- footer ---------- */
.foot__links { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; }
.social { display: flex; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.social a { display: grid; place-items: center; width: 44px; height: 44px; margin: -10px 0; border-radius: var(--radius); color: var(--ink-2); }
.social a:hover { color: var(--accent-text); }
.social svg { width: 18px; height: 18px; fill: currentColor; }
.foot__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem;
  padding-block: 1.5rem 3rem; border-top: 1px solid var(--rule);
  font: 400 0.8rem/1.6 var(--f-mono); color: var(--ink-2);
}
