/* ============================================================================
   modumatics.com — site styles.
   ONE style: the Toan Ngo PhD Thesis Design System, "tufte" skin only (warm
   parchment, ET Book serif, one maroon accent, Quicksand brand mark, rectilinear
   + quiet). No theme switching. Tokens vendored from the system's
   colors_and_type.css. Restraint is the brand: few type treatments, generous
   margins, a single measured column.
   ============================================================================ */

@import url('/assets/fonts.css');

:root {
  /* palette */
  --darkred: #800000; --darkred-ink: #5e0000; --darkred-tint: #f3e3e3;
  --ref-ink: #571f1b;
  --ink: #322d27; --ink-2: #574f45; --ink-3: #8a8073;
  --rule: #e2dcd2; --rule-soft: #efeae1;
  --paper: #fcfbf8; --parchment: #fbf6ec;

  /* type */
  --serif: 'ET Book', 'TeX Gyre Pagella', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, 'Times New Roman', serif;
  --sans:  'Lato', 'Helvetica Neue', Arial, sans-serif;
  --geometric: 'Quicksand', 'Futura', 'Century Gothic', 'Avenir Next', sans-serif;

  --leading-body: 1.62; --leading-tight: 1.22;

  /* spacing / radii / elevation (rectilinear, quiet warm shadow) */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --radius: 4px;
  --shadow-sm: 0 1px 2px rgba(40, 20, 10, 0.06);
  --shadow-md: 0 3px 14px rgba(40, 20, 10, 0.09);
  --hairline: 1px solid var(--rule);

  /* layout — a single composed column */
  --col: 44rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: var(--leading-body);
  font-feature-settings: "onum" 1, "liga" 1, "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;            /* belt-and-braces against any incidental overflow */
  overflow-wrap: break-word;
}

a { color: var(--darkred); text-decoration: none; }

/* column: never wider than the viewport — width:100% capped by max-width, gutters
   via padding (box-sizing:border-box), so it can't overflow on narrow screens. */
.wrap {
  width: 100%;
  max-width: var(--col);
  margin-inline: auto;
  padding-inline: 1.375rem;
  min-width: 0;
}

/* ---- masthead: full-width hairline, content in the column ---- */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--parchment) 86%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: var(--hairline);
}
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); padding: var(--space-3) 0; min-width: 0;
}
.brand { display: inline-flex; align-items: center; gap: var(--space-3); min-width: 0; }
.brand .monogram { width: 28px; height: 28px; flex: none; border-radius: var(--radius); display: block; }
.brand .wordmark {
  font-family: var(--geometric); font-weight: 600; font-size: 1.14rem;
  letter-spacing: 0.05em; color: var(--ink); white-space: nowrap;
}
.masthead nav a {
  font-family: var(--sans); font-size: 0.9rem; letter-spacing: 0.01em;
  color: var(--ink-2); padding: 2px 4px; border-radius: 2px;
  transition: color 120ms ease, background 120ms ease;
}
.masthead nav a:hover { color: var(--darkred); background: var(--darkred-tint); }

/* ---- main: one column, vertically composed ---- */
main {
  flex: 1 1 auto;
  min-width: 0;                  /* allow shrink to viewport (prevents h-overflow) */
  display: flex; flex-direction: column; justify-content: center;
  padding-block: var(--space-8);
}

/* ---- hero ---- */
.hero { margin-bottom: var(--space-8); }
.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 3.4rem); line-height: 1.05;
  font-variant: small-caps; letter-spacing: 0.015em;
  color: var(--ink); margin: 0 0 var(--space-4);
}
.hero .lede {
  font-size: 1.2rem; line-height: 1.5; color: var(--ink-2);
  max-width: 34rem; margin: 0;
}

/* ---- a section label: small-caps serif, maroon, with a short rule ---- */
.label {
  display: flex; align-items: baseline; gap: var(--space-3);
  margin: 0 0 var(--space-4);
  font-variant: small-caps; letter-spacing: 0.08em;
  font-size: 0.92rem; color: var(--darkred);
}
.label::after { content: ""; flex: 1; height: 1px; background: var(--rule); align-self: center; }

/* ---- the thesis feature (the one function, presented well) ---- */
.feature {
  display: block;
  background: var(--paper);
  border: var(--hairline);
  border-left: 2px solid var(--darkred);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6) var(--space-6);
  color: var(--ink); text-decoration: none;
  transition: box-shadow 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.feature:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.feature .kicker {
  font-variant: small-caps; letter-spacing: 0.07em;
  font-size: 0.86rem; color: var(--darkred);
}
.feature .f-title {
  display: block;
  font-family: var(--serif); font-weight: 700;
  font-size: 1.55rem; line-height: var(--leading-tight);
  color: var(--ink); margin: var(--space-2) 0 var(--space-3);
}
.feature:hover .f-title { color: var(--darkred-ink); }
.feature .f-desc { font-size: 1rem; line-height: 1.55; color: var(--ink-2); margin: 0; max-width: 36rem; }
.feature .f-go {
  display: inline-block; margin-top: var(--space-4);
  font-family: var(--sans); font-weight: 700; font-size: 0.95rem; color: var(--darkred);
}

.more-note {
  margin-top: var(--space-5); font-size: 0.95rem; font-style: italic; color: var(--ink-3);
}

/* ---- prose (about) ---- */
.prose h1 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(2rem, 5vw, 2.5rem);
  font-variant: small-caps; letter-spacing: 0.015em; line-height: var(--leading-tight);
  color: var(--ink); margin: 0 0 var(--space-5);
}
.prose h2 { font-family: var(--serif); font-weight: 700; font-size: 1.4rem; color: var(--ink); margin: var(--space-7) 0 var(--space-3); }
.prose p { margin: 0 0 var(--space-4); max-width: 36rem; }
.prose ul { margin: 0 0 var(--space-4); padding-left: 1.2rem; max-width: 36rem; }
.prose li { margin: var(--space-2) 0; }
.prose a { color: var(--darkred); font-weight: 600; border-radius: 3px; padding: 0 1px; transition: background 120ms ease; }
.prose a:hover { background: var(--darkred-tint); }
.prose em { font-style: italic; }

/* the signature 0.5pt rule (left-aligned, short) */
.rule { border: 0; height: 0.5pt; width: 8rem; margin: var(--space-6) 0; background: var(--ink-3); opacity: 0.55; }

/* ---- footer ---- */
footer { flex-shrink: 0; border-top: var(--hairline); }
footer .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-2); padding: var(--space-5) 0;
  font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--ink-3);
}
footer a { color: var(--ink-2); }
footer a:hover { color: var(--darkred); }

@media (max-width: 560px) {
  main { padding: var(--space-6) 0; justify-content: flex-start; }
  .hero { margin-bottom: var(--space-7); }
}
