/* ==========================================================================
   cliffordtan.com — styles.css
   Static, dependency-free CSS. Warm, editorial, text-first.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------ */
:root {
  --color-bg: #f7f2e7;        /* warm off-white */
  --color-ink: #241f19;       /* charcoal, warm-leaning */
  --color-muted: #6b6055;     /* muted supporting text */
  --color-accent: #976022;    /* muted ochre / warm gold */
  --color-accent-dark: #7a4e1c;
  --color-line: #ddd2bd;      /* hairline / divider */
  --color-focus: #1d5c5a;     /* distinct, high-contrast focus ring */

  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --content-width: 700px;
  --wide-width: 880px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.75rem;
  --space-4: 3rem;
  --space-5: 5rem;
}

/* ---- Reset / base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
}

h1 { font-size: clamp(2.25rem, 6vw, 3.4rem); font-weight: 500; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 var(--space-2); }

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--color-accent-dark); }

ul, ol { padding-left: 1.25em; }

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

/* Visible, high-contrast focus state for every interactive element */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Skip link ------------------------------------------------------------ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  background: var(--color-ink);
  color: var(--color-bg);
  padding: 0.75em 1.25em;
  z-index: 100;
  border-radius: 4px;
}
.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Layout containers ------------------------------------------------- */
.wrap {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.prose {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* ---- Header / nav ---------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--color-line);
}

.header-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.site-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
}
.site-name:hover { color: var(--color-accent); }

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--color-ink);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-accent);
}
.site-nav a[aria-current="page"] {
  border-bottom: 2px solid var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-line);
  border-radius: 6px;
  padding: 0.5em 0.7em;
  cursor: pointer;
}
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-ink);
  border-radius: 1px;
}
.nav-toggle-icon { position: relative; }
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }

@media (max-width: 700px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav { display: none; width: 100%; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: var(--space-2); padding: var(--space-2) 0; }
  .header-inner { flex-wrap: wrap; }
}

/* ---- Sections & dividers ------------------------------------------------ */
main { display: block; }

.section {
  padding: var(--space-5) 0;
}

.section--tight { padding: var(--space-4) 0; }

hr.divider {
  border: none;
  border-top: 1px solid var(--color-line);
  max-width: var(--wide-width);
  margin: 0 auto;
}

.eyebrow {
  display: block;
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.lede {
  color: var(--color-muted);
  font-size: 1.15rem;
  max-width: 34em;
}

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

.status {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-accent-dark);
  text-transform: uppercase;
}

/* ---- Link lists (hero links, section footers) --------------------------- */
.link-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: 0;
  margin: var(--space-3) 0 0;
}
.link-row a { font-weight: 600; }

.section-link {
  display: inline-block;
  margin-top: var(--space-2);
  font-weight: 600;
}

/* ---- Entry blocks (now / notes / experiments / teaching) ----------------- */
.entry {
  margin-bottom: var(--space-4);
}
.entry:last-child { margin-bottom: 0; }
.entry h3 { margin-bottom: var(--space-1); }
.entry-meta { margin: 0 0 var(--space-1); }

.entry-field {
  margin: var(--space-1) 0;
}
.entry-field dt {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--space-2);
}
.entry-field dd {
  margin: 0.25em 0 0;
}

/* ---- Working principles list --------------------------------------------- */
.principles {
  list-style: none;
  padding: 0;
  margin: 0;
}
.principles li {
  padding: var(--space-2) 0;
  border-top: 1px solid var(--color-line);
  font-family: var(--font-serif);
  font-size: 1.15rem;
}
.principles li:last-of-type + p { margin-top: var(--space-2); }

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding: var(--space-3);
  color: var(--color-muted);
  font-size: 0.9rem;
}
.footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  justify-content: space-between;
}

/* ---- Reduced motion -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* Minimal, functional motion only (no decorative animation) */
.site-nav { transition: none; }

/* ==========================================================================
   Refinement pass — Now / Notes / Experiments rhythm & entry treatments
   ========================================================================== */

:root {
  --space-4b: 3.75rem;
}

/* Section rhythm variants — used to vary vertical rhythm between sections */
.section--cozy { padding: var(--space-4b) 0; }

/* ---- Now: compact rows, restrained status, distinct from Notes ---- */
.now-list .entry--now {
  margin-bottom: var(--space-3);
}
.now-list .entry--now:last-child { margin-bottom: 0; }
.now-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25em var(--space-2);
}
.now-row h3 { margin-bottom: 0; min-width: 0; }
.entry--now p { margin-top: 0.35em; margin-bottom: 0; }

/* ---- Notes: editorial list — prominent titles, subtle dividers, no cards ---- */
.notes-list {
  margin-top: var(--space-3);
}
.note-entry {
  padding: var(--space-3) 0;
}
.note-entry:first-child { padding-top: 0; }
.note-entry:not(:first-child) {
  border-top: 1px solid var(--color-line);
}
.note-title {
  font-size: 1.4rem;
  margin-bottom: 0.4em;
}
.note-entry p {
  color: var(--color-muted);
  margin-bottom: 0;
}

/* ---- Experiments: compact horizontal rows ---- */
.entry-list--rows {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0;
}
.entry-list--rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25em var(--space-2);
  padding: 0.65em 0;
  border-top: 1px solid var(--color-line);
}
.entry-list--rows li:first-child { border-top: none; }
.exp-name { font-weight: 600; }

/* ---- About: optional future photo slot (unused until a real photo exists) ---- */
.about-photo {
  margin: 0 0 var(--space-3);
  max-width: 220px;
}
.about-photo img {
  width: 100%;
  display: block;
  border-radius: 4px;
}
.about-photo figcaption {
  margin-top: 0.5em;
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* ---- Working principles: emphasize one, quiet the rest ---- */
.principle--primary {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-ink);
}
.principle--quiet {
  font-size: 1.02rem;
  font-weight: 400;
  color: var(--color-muted);
}
