/* ==========================================================================
   Home Ed Resource — "Kitchen Table"
   Tokens first, then layout. No radii, no shadows: that flatness is the point.
   ========================================================================== */

/* --- Fonts (self-hosted; subsets and ranges mirror Google's own CSS) ------ */

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('fonts/karla-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('fonts/karla-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  --ink:          #231d16;  /* header band, headings, strongest text */
  --text:         #3d352c;  /* body copy */
  --text-soft:    #4c433a;  /* lede, secondary body */
  --muted:        #6b6157;  /* meta, footer — at the AA limit, do not lighten */
  --paper:        #fbf7f1;
  --paper-tint:   #f2ebe0;
  --rule:         #e6dccd;  /* section dividers */
  --rule-light:   #eee4d6;  /* between entries */
  --nav:          #e2d8c9;

  /* sRGB fallbacks; the oklch originals are restored in @supports below */
  --accent-dot:    #af6340;
  --accent-domain: #985535;
  --accent-link:   #8b492a;

  --measure:  880px;
  --gutter:    60px;
  --rail:     200px;
  --inset:     40px;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans:  'Karla', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@supports (color: oklch(0.58 0.11 45)) {
  :root {
    --accent-dot:    oklch(0.58 0.11 45);
    --accent-domain: oklch(0.52 0.1 45);
    --accent-link:   oklch(0.48 0.1 45);
  }
}

/* --- Base ----------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p { margin: 0; }

a { color: inherit; }

/* One focus treatment everywhere. Never remove it. */
a:focus-visible,
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: var(--paper);
  color: var(--ink);
  padding: 12px 20px;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--ink);
}
.skip-link:focus {
  left: 0;
}

/* Bands run the full viewport width; their contents sit on the measure. */
.band > .band__inner,
.measure {
  max-width: var(--measure);
  margin-inline: auto;
}

/* --- Header --------------------------------------------------------------- */

.masthead {
  background: var(--ink);
  color: var(--paper);
}
.masthead__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 30px var(--gutter);
}
.wordmark {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.masthead nav {
  display: flex;
  gap: 26px;
  font-size: 14px;
}
.masthead nav a {
  color: var(--nav);
  text-decoration: none;
  transition: color 120ms ease;
}
.masthead nav a:hover { color: var(--paper); }
.masthead nav a:focus-visible { outline-color: var(--nav); }

/* --- Intro ---------------------------------------------------------------- */

.intro { border-bottom: 1px solid var(--rule); }
.intro__inner {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 64px var(--gutter) 52px;
}
.intro h1 {
  font-family: var(--serif);
  font-size: 58px;
  line-height: 1.08;
  font-weight: 400;
  max-width: 17ch;
}
.intro__lede {
  font-size: 19px;
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 54ch;
}
.status {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}
.status__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-dot);
  flex: none;
}

/* --- Section blocks ------------------------------------------------------- */

.section { border-bottom: 1px solid var(--rule); }
.section__inner {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: 0;
}
.section__rail {
  padding: 44px 24px 44px var(--gutter);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section__rail h2 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
}
.section__note {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}
.section__body { display: flex; flex-direction: column; }

/* --- Entry ---------------------------------------------------------------- */

.entry {
  padding: 36px var(--gutter) 34px var(--inset);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--rule-light);
}
.entry:last-child { border-bottom: 0; }

.entry__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
}
.entry__title {
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 400;
  line-height: 1.15;
}
.entry__title a {
  color: var(--ink);
  text-decoration: none;
}
.entry__title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.entry__checked {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.entry__description {
  font-size: 17.5px;
  line-height: 1.62;
  color: var(--text);
  max-width: 50ch;
}
.entry__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
  list-style: none;
  padding: 0;
  margin: 0;
}
.entry__domain { color: var(--accent-domain); }

/* Content-authored empty state — deliberately prose, not a placeholder card. */
.section__empty {
  padding: 40px var(--gutter) 40px var(--inset);
  font-size: 17.5px;
  line-height: 1.62;
  color: var(--text-soft);
  max-width: 52ch;
}

/* --- Two-up info block ---------------------------------------------------- */

.info { background: var(--paper-tint); }
.info__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 52px;
  padding: 48px var(--gutter);
}
.info__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.info__col h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
}
.info__col p {
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--text);
}
.contact-link {
  font-size: 16px;
  color: var(--accent-link);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-link) 40%, transparent);
  align-self: flex-start;
  padding-bottom: 2px;
}
@supports not (color: color-mix(in srgb, red 40%, transparent)) {
  .contact-link { border-bottom-color: #d3b5a4; }
}
.contact-link:hover { border-bottom-color: var(--accent-link); }

/* Email is assembled at runtime; this keeps the visible text unharvestable
   for the no-JS case without changing how it reads. */
.email-reverse {
  unicode-bidi: bidi-override;
  direction: rtl;
}

/* --- Footer --------------------------------------------------------------- */

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding: 26px var(--gutter) 32px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.footer__disclaimer { max-width: 56ch; }
.footer__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
  white-space: nowrap;
}
.footer__meta a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 120ms ease;
}
.footer__meta a:hover { border-bottom-color: var(--ink); }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 820px) {
  .info__inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 720px) {
  /* Rail becomes a stacked heading above its entries. */
  .section__inner { grid-template-columns: 1fr; }
  .section__rail {
    padding: 36px var(--gutter) 20px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    gap: 8px;
  }
  .entry,
  .section__empty {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
  /* Checked date drops under the title, left-aligned. */
  .entry__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .intro h1 { font-size: 40px; line-height: 1.1; }
  .intro__inner { padding-top: 48px; padding-bottom: 40px; }
}

@media (max-width: 700px) {
  :root { --gutter: 24px; }
  .masthead__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding-top: 24px;
    padding-bottom: 24px;
  }
  .masthead nav { gap: 20px; flex-wrap: wrap; }
  .footer__inner {
    flex-direction: column;
    gap: 20px;
  }
  .footer__meta {
    text-align: left;
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .intro h1 { font-size: 36px; }
  .entry__title { font-size: 27px; }
}

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

@media print {
  .masthead nav, .skip-link { display: none; }
  body { background: #fff; }
}
