/* The Thoreau Down
   Design system. Two typographic voices, light from one side, 1:2 grid.
   ------------------------------------------------------------------ */

:root {
  /* Paper is the default. Dark is the lamp, on the toggle. */
  --paper:      #f3efe4;
  --paper-lit:  #fcf9f1;   /* the window side */
  --paper-dark: #e7e1d2;   /* the far wall */
  --ink:        #22201b;
  --ink-soft:   #595248;
  --ink-faint:  #918a7c;
  --rule:       #d9d2c0;
  --rule-lit:   #c6bfaa;
  --lamp:       #2f5d3f;   /* the one accent: the green off the floor */
  --lamp-soft:  #9ab3a2;

  /* Two voices. Serif is the thinking, mono is the machine. */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* 7'6" by 15'6". One unit short side, two units long. */
  --measure: 34rem;
  --gutter:  clamp(1rem, 5vw, 4rem);
  --light-angle: 112deg; /* daylight enters from the WNW window wall, always */
}

:root[data-theme="dark"] {
  --paper:      #121110;
  --paper-lit:  #1a1917;
  --paper-dark: #0d0c0b;
  --ink:        #e8e3d9;
  --ink-soft:   #a8a29a;
  --ink-faint:  #6d6862;
  --rule:       #2a2724;
  --rule-lit:   #3a3630;
  --lamp:       #d8933f;
  --lamp-soft:  #7a5423;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  /* The room is lit from one side. Every page is too. */
  background-image: linear-gradient(var(--light-angle),
    var(--paper-lit) 0%, var(--paper) 38%, var(--paper-dark) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---- the machine voice ---------------------------------------------- */
.mono, .meta, .status, .ledger, .plan-note, nav, .came-off li::before {
  font-family: var(--mono);
}
.meta {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---- layout --------------------------------------------------------- */
.shell { max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); }
.prose p, .prose ul { margin: 0 0 1.4em; }

a { color: var(--ink); text-decoration-color: var(--lamp-soft); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--lamp); }

/* ---- masthead ------------------------------------------------------- */
header.site {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
  /* lit edge on the window side */
  box-shadow: -1px 0 0 var(--rule-lit);
}
.wordmark {
  display: flex; align-items: baseline; gap: 0.45rem;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1; text-decoration: none; color: var(--ink);
}
.wordmark .the {
  font-family: var(--mono); font-size: 0.5em;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-faint); align-self: center;
}
.wordmark .thoreau { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
.wordmark .down {
  font-family: var(--mono); font-weight: 500; font-size: 0.82em;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--lamp);
}
header.site nav { margin-left: auto; display: flex; gap: 1.5rem; font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase; }
header.site nav a { color: var(--ink-soft); text-decoration: none; }
header.site nav a:hover, header.site nav a[aria-current] { color: var(--lamp); }

button.theme {
  background: none; border: 1px solid var(--rule); color: var(--ink-soft);
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 0.4rem 0.6rem; cursor: pointer;
}
button.theme:hover { border-color: var(--lamp); color: var(--lamp); }

/* ---- the mark ------------------------------------------------------- */
.plan { display: block; }
.plan .wall   { fill: none; stroke: var(--ink); stroke-width: 3; }
.plan .window { stroke: var(--lamp); stroke-width: 3; }
.plan .door   { stroke: var(--ink); stroke-width: 3; }
.plan .swing  { fill: none; stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 3 3; }
.plan .dim    { stroke: var(--ink-faint); stroke-width: 0.75; fill: none; }
.plan .unit   { fill: var(--rule); stroke: var(--ink-soft); stroke-width: 2; }
.plan .north  { fill: var(--ink-faint); stroke: none; }
.plan .roof   { fill: none; stroke: var(--ink-faint); stroke-width: 1.25; stroke-dasharray: 6 4; }
.plan .post   { fill: var(--ink-soft); stroke: none; }
.plan .tree   { fill: none; stroke: var(--ink-soft); stroke-width: 1.5; stroke-dasharray: 2 3; }
.plan text    { font-family: var(--mono); font-size: 9px; fill: var(--ink-faint); }

/* ---- hero ----------------------------------------------------------- */
.hero { padding: 4.5rem 0 3.5rem; display: grid; gap: 3rem;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.hero h1 { font-size: clamp(1.75rem, 4.2vw, 2.75rem); line-height: 1.18;
  font-weight: 400; margin: 0 0 1rem; max-width: 28ch; }
.hero h1 em { font-style: normal; color: var(--lamp); }
.hero p { color: var(--ink-soft); max-width: 46ch; margin: 0; }
.hero figure { margin: 0; }
.hero figcaption { margin-top: 0.75rem; }

/* ---- build grid (1:2 cards, lit from the left) ---------------------- */
/* The dividers are drawn on the cards, not as a 1px gap over a coloured
   container. A short last row would otherwise leave empty cells showing the
   container colour through, which reads as a grey hole in the grid. */
.builds { display: grid; gap: 0;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  border: 1px solid var(--rule); margin: 0 0 4rem; }
.build {
  /* The 1:2 of the room sets the card's target shape, but the card must fill
     its row or the grid's rule colour shows through underneath. */
  min-height: 9.5rem;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin: 0 -1px -1px 0;
  padding: 1.25rem 1.4rem; display: flex; flex-direction: column;
  text-decoration: none; color: var(--ink);
  /* the window side of every card catches a little more light */
  background-image: linear-gradient(var(--light-angle),
    var(--paper-lit) 0%, var(--paper) 85%);
  background-color: var(--paper);
  transition: background-color 0.18s ease;
}
.build:hover { background-image: none; background-color: var(--paper-lit); }
.build h3 { font-size: 1.2rem; font-weight: 600; margin: 0.5rem 0 0.35rem; }
.build p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }
.build .spacer { flex: 1; }
.build footer { display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-faint); }

.status::before { content: "■"; margin-right: 0.45em; color: currentColor; }
.status { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.status.shipped   { color: var(--lamp); }
.status.running   { color: #8a6a1f; }
.status.parked    { color: var(--ink-faint); }
.status.abandoned { color: var(--ink-faint); text-decoration: line-through; }

/* ---- article -------------------------------------------------------- */
article.post { padding: 3.5rem 0 2rem; }
article.post h1 { font-size: clamp(2rem, 5.5vw, 3.1rem); line-height: 1.1;
  font-weight: 600; margin: 0.75rem 0 0.5rem; max-width: 24ch; }
article.post .standfirst { font-size: 1.2rem; color: var(--ink-soft);
  max-width: 44ch; margin: 0 0 2rem; }
article.post h2 { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--lamp); margin: 3.5rem 0 1rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--rule); max-width: var(--measure); }
article.post h3 { font-size: 1.25rem; margin: 2.5rem 0 0.75rem; }
.byline { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: baseline;
  padding-bottom: 1.5rem; }

figure.shot { margin: 2.5rem 0; max-width: 54rem; }
figure.shot img { width: 100%; display: block; border: 1px solid var(--rule);
  /* the light falls the same way on every image as it does in the room */
  box-shadow: 0.75rem 0.75rem 0 -0.5rem var(--rule-lit); }  /* light from the left, so the shadow falls right */
figure.shot figcaption { margin-top: 0.85rem; max-width: var(--measure); }
/* Long captions stay in the machine voice but drop the all-caps, which is
   only legible in short bursts. */
figure.shot figcaption.meta { text-transform: none; letter-spacing: 0.01em;
  font-size: 0.78rem; line-height: 1.55; color: var(--ink-soft); }
figure.shot figcaption .callout { font-weight: 500; }
figure.shot .callout { color: var(--lamp); }

.pair { display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; margin: 2.5rem 0; }
.pair figure { margin: 0; }

/* ---- economy ledger ------------------------------------------------- */
.ledger { width: 100%; max-width: 40rem; border-collapse: collapse;
  font-size: 0.82rem; margin: 1.5rem 0 1rem; }
.ledger caption { text-align: left; font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint);
  padding-bottom: 0.75rem; }
.ledger th, .ledger td { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.ledger thead th { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 400; }
.ledger td.num, .ledger th.num { text-align: right; padding-left: 1.5rem; font-variant-numeric: tabular-nums;
  padding-right: 0; white-space: nowrap; }
.ledger td.date { color: var(--ink-faint); white-space: nowrap; }
.ledger tfoot td { border-bottom: none; border-top: 2px solid var(--rule-lit);
  padding-top: 0.75rem; color: var(--lamp); font-weight: 500; }
.ledger .tbd { color: var(--ink-faint); }

/* ---- what came off -------------------------------------------------- */
.came-off { max-width: var(--measure); }
.came-off ul { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.came-off li { padding-left: 2rem; position: relative; margin-bottom: 0.6rem;
  color: var(--ink-soft); }
.came-off li::before { content: "\2212"; position: absolute; left: 0;
  color: var(--lamp); font-size: 0.9rem; }

/* ---- pulled quote --------------------------------------------------- */
blockquote.pull { margin: 3rem 0; padding-left: 1.5rem;
  border-left: 2px solid var(--lamp-soft); max-width: 36rem;
  font-size: 1.35rem; line-height: 1.4; color: var(--ink); }

/* ---- footer --------------------------------------------------------- */
footer.site { margin-top: 5rem; border-top: 1px solid var(--rule);
  padding: 2.5rem 0 4rem; display: flex; gap: 2rem; align-items: flex-start;
  flex-wrap: wrap; }
footer.site p { margin: 0; max-width: 30ch; color: var(--ink-soft); font-size: 0.9rem; }
footer.site .sig { margin-left: auto; text-align: right; }

/* ---- the one outbound link, on the about page only ------------------ */
.offsite { max-width: var(--measure); margin: 3.5rem 0 0;
  border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.offsite p { margin: 0 0 0.75rem; color: var(--ink-soft); }
.prose a { color: var(--lamp); text-decoration: none;
  border-bottom: 1px solid var(--lamp-soft); }
.prose a:hover { border-bottom-color: var(--lamp); }

.offsite a { color: var(--lamp); text-decoration: none;
  border-bottom: 1px solid var(--lamp-soft); }
.offsite a:hover { border-bottom-color: var(--lamp); }

/* ---- pending markers (design example only) -------------------------- */
.pending { color: var(--lamp); border-bottom: 1px dashed var(--lamp-soft);
  font-family: var(--mono); font-size: 0.85em; }

@media (max-width: 54rem) {
  .hero, .pair { grid-template-columns: 1fr; }
  header.site { flex-wrap: wrap; gap: 0.75rem; }
  header.site nav { width: 100%; margin-left: 0; gap: 1rem; }
  body { background-image: linear-gradient(170deg, var(--paper-lit), var(--paper) 45%, var(--paper-dark)); }
}
