/*
 * eatfeel.org
 *
 * The visual system is not invented here. It is the app's, from DESIGN.md:
 * ink on tinted chart stock, exactly two printing plates, hairline and heavy
 * rules doing the structural work, Archivo set tight over a platform body
 * face, spaced small caps, tabular figures, square shoulders.
 *
 * Three pages share this file and differ only in composition.
 */

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light;

  --stock: #e4e7dd;
  --stock-sunk: #d8dcd0;
  --ink: #16202b;
  --ink-soft: #4e5862;
  --rule: #a9b2a6;
  --rule-strong: #16202b;

  --eat: #a64a18;
  --eat-ink: #8e3f14;
  --eat-wash: #efe2d6;
  --eat-deep: #6e2f0e;

  --feel: #2d5d7c;
  --feel-ink: #234b65;
  --feel-wash: #d9e1e6;
  --feel-deep: #1b3b50;

  --on-plate: #f4f2ea;
  --good: #3f6b4a;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --gutter: 20px;
  --measure: 36rem; /* ~68 characters at this size */
  --bed: 3px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --stock: #101720;
    --stock-sunk: #19212b;
    --ink: #dde2d8;
    --ink-soft: #97a1a8;
    --rule: #39424c;
    --rule-strong: #dde2d8;

    --eat: #d9722f;
    --eat-ink: #e6935a;
    --eat-wash: #2b2018;
    --eat-deep: #8f4517;

    --feel: #5e9bc4;
    --feel-ink: #7fb2d4;
    --feel-wash: #17242e;
    --feel-deep: #35637f;

    --on-plate: #0e1520;
    --good: #7bb68a;
  }
}

/* ------------------------------------------------------------------- reset */

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

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

body {
  margin: 0;
  background: var(--stock);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
}

/* The parts of the page a browser draws for us still belong to the system. */
::selection { background: var(--feel); color: var(--on-plate); }
:focus-visible {
  outline: 2px solid var(--feel-ink);
  outline-offset: 3px;
}
a { color: inherit; }

/* --------------------------------------------------------------- structure */

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.rule       { height: 1px; background: var(--rule); border: 0; margin: 0; }
.rule-heavy { height: 3px; background: var(--rule-strong); border: 0; margin: 0; }

.caps {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-soft);
}

.figures {
  font-family: var(--display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 26px 10px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

/* The app's own icon, so what is on this page and what is on the home screen
   are visibly the same thing. iOS rounds its icons; matching that here is what
   makes it read as an app icon rather than a picture. */
.appmark {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 22.5%;
  flex: none;
}
.appmark.big { width: 68px; height: 68px; }

.identify {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.identify p { margin: 0; font-size: 15px; color: var(--ink-soft); }

.masthead a.get {
  text-decoration: none;
  color: var(--feel-ink);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  white-space: nowrap;
}
.masthead a.get:hover { color: var(--feel); }

/* ------------------------------------------------------------------ typing */

h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  text-wrap: balance;
}

p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--ink-soft);
  max-width: var(--measure);
}
.lede strong { color: var(--ink); font-weight: 600; }

.note { font-size: 15px; color: var(--ink-soft); max-width: var(--measure); }

/* ------------------------------------------------- the hour column (shared) */

.column { margin: 0; }

.hour {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0 16px;
  border-top: 1px solid var(--rule);
  padding-block: 10px 14px;
  min-height: 62px;
}
.hour:first-child { border-top: 0; }

.hour > .t {
  font-family: var(--display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 2px;
}

.entry { display: flex; align-items: flex-start; gap: 10px; }

/* The mark that says which plate a row belongs to. Never the only signal:
   the row is also bold, which is what keeps it readable without colour. */
.mark {
  flex: none;
  width: 18px;
  height: 4px;
  margin-top: 0.62em;
  background: var(--ink);
}
.mark.eat  { background: var(--eat); }
.mark.feel { background: var(--feel); }

.entry b { font-weight: 700; }
.entry .detail {
  display: block;
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* --------------------------------------------------------------- the plate */

/*
 * The app's signature control. The face sits on a deeper bed and a press moves
 * it down onto that bed. This is not a drop shadow and must not be corrected
 * into one - the deep colour is part of the plate.
 */
.plate {
  display: block;
  text-decoration: none;
  border-radius: 4px;
  padding: 0;
  border: 0;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  background: var(--eat-deep);
}
.plate.feel    { background: var(--feel-deep); }
.plate.neutral { background: #000; }

.plate > span {
  display: block;
  background: var(--eat);
  border-radius: 4px;
  padding: 20px 18px;
  margin-bottom: var(--bed);
  transform: translateY(0);
  transition: transform 90ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.plate.feel > span    { background: var(--feel); }
.plate.neutral > span { background: var(--ink); }

.plate:hover > span  { transform: translateY(1px); }
.plate:active > span { transform: translateY(var(--bed)); }

.plate .label {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--on-plate);
  line-height: 1.05;
}
.plate .sub {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--on-plate);
}
.plate.neutral .label,
.plate.neutral .sub { color: var(--stock); }

@media (prefers-reduced-motion: reduce) {
  .plate > span { transition: none; }
}

/* ---------------------------------------------------------------- sections */

.band { padding-block: 44px; }
.band-tight { padding-block: 28px; }

.facts { margin: 0; padding: 0; list-style: none; }
.facts li {
  border-top: 1px solid var(--rule);
  padding-block: 18px;
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 4px 20px;
}
.facts li > .k {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-soft);
  padding-top: 3px;
}
.facts li > .v { max-width: var(--measure); }
.facts li > .v p { margin: 0; }

@media (max-width: 34rem) {
  .facts li { grid-template-columns: 1fr; }
  .hour { grid-template-columns: 3.4rem 1fr; gap: 0 12px; }
}

/* ------------------------------------------------------------------ footer */

.colophon {
  padding-block: 28px 56px;
  font-size: 14px;
  color: var(--ink-soft);
}
.colophon a { color: var(--feel-ink); }

/* The credit line. The heart is drawn, not an emoji - the same reason the tab
   marks in the app are drawn: one visual vocabulary, and a glyph would arrive
   in whatever font and colour the reader's platform decided. It takes the eat
   plate's ink, so it stays inside the two-plate rule. */
.credit {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--ink);
}
.credit svg { flex: none; color: var(--eat-ink); }
.colophon p { max-width: var(--measure); }

/* ------------------------------------------- temporary composition switcher */

/*
 * Three compositions of one world, shipped together so they can be compared.
 * This bar comes out once a choice is made - it is not part of the design.
 */
.versions {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--stock-sunk);
  border-bottom: 1px solid var(--rule);
}
.versions .inner {
  max-width: 44rem;
  margin: 0 auto;
  padding: 8px var(--gutter);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.versions .inner::-webkit-scrollbar { display: none; }
.versions a,
.versions .which { white-space: nowrap; flex: none; }
.versions .which {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-soft);
  margin-right: 2px;
}
.versions a {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 6px 10px;
}
.versions a[aria-current="page"] {
  background: var(--feel);
  border-color: var(--feel);
  color: var(--on-plate);
}
.versions a:hover:not([aria-current="page"]) { background: var(--stock); }
