/* Layout: one centered sheet over a full-bleed vector field, after agilemanifesto.org (2001). */
:root {
  --paper: #edf0f4;   /* page ground */
  --ink: #121b2a;     /* text */
  --muted: #5b6679;   /* right-hand items, notes */
  --field: #7d8ba3;   /* the arrows */
  --accent: #3550c8;  /* direction: links, the seventeen arrows */
  --rule: #c9d0db;
  --shadow: transparent;
  --field-alpha: 0.32;

  --display: "Newsreader", "Times New Roman", Times, serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1522; --ink: #e9edf3; --muted: #95a0b3; --field: #5d6c86;
    --accent: #93a8ff; --rule: #263248; --field-alpha: 0.4; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1522; --ink: #e9edf3; --muted: #95a0b3; --field: #5d6c86;
  --accent: #93a8ff; --rule: #263248; --field-alpha: 0.4; color-scheme: dark;
}

/* 2001: one fixed look in either theme, sepia whiteboard and Times, white type with a dark halo. */
:root.y2001 {
  --paper: #7a5c3a; --ink: #fffaf0; --muted: #f1e4cc; --field: #f6ead2;
  --accent: #fff3c4; --rule: #a88a62; --shadow: rgba(40, 24, 8, 0.85); --field-alpha: 0.22;
  --display: "Times New Roman", Times, serif; --body: "Times New Roman", Times, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: clamp(40px, 9vh, 112px) 48px;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.6s ease, color 0.6s ease;
}
.y2001 body {
  background: radial-gradient(120% 90% at 50% 30%, #b8956a 0%, #8a6a44 45%, #4d3720 100%) fixed;
  text-shadow: 0 0 6px var(--shadow), 0 0 2px var(--shadow);
}

#field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.sheet {
  position: relative; z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
  display: grid;
  gap: clamp(28px, 5vh, 48px);
  text-align: center;
}
/* a soft clearing in the field so the words stay readable */
.sheet::before {
  content: "";
  position: absolute; z-index: -1;
  inset: -12% -18%;
  background: radial-gradient(closest-side, var(--paper) 55%, transparent 100%);
  opacity: 0.88;
  pointer-events: none;
}
.y2001 .sheet::before { opacity: 0; }

/* Sizing follows the 2001 original: a bold title, the left items largest,
   and "over" plus the right item set smaller on the same line, at the size of the prose. */
h1 {
  font-family: var(--display);
  font-weight: 700;
  font-optical-sizing: auto;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}
.lede, .coda {
  margin: 0 auto;
  max-width: 24em;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  line-height: 1.4;
  text-wrap: balance;
}

.values {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  gap: 0.15em;
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  line-height: 1.3;
}
.values li { text-wrap: balance; }
.values .l { font-size: 1.62em; }
.values strong { font-weight: 400; }
.values .r { color: var(--ink); }
.over { color: var(--ink); }

@media (max-width: 560px) {
  .values { gap: 0.6em; }
}

.names {
  list-style: none; margin: 0 auto; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.35em 2.2em;
  font-size: 1.05rem;
  max-width: 36rem;
}
.era-2001 .names { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.2em 1.5em; }
@media (max-width: 560px) { .era-2001 .names { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.notice {
  margin: 0 auto; max-width: 30em;
  font-size: 0.95rem; color: var(--muted);
}
.notice .year { cursor: default; }

nav.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5em 2em; font-size: 1.1rem; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.y2001 a { color: var(--ink); }

.credit {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.y2001 .credit { font-family: var(--body); font-size: 0.85rem; letter-spacing: 0; }

/* Eras: what shows in 2026, what shows in 2001 */
.era-2001 { display: none; }
.y2001 .era-now { display: none; }
.y2001 .era-2001 { display: contents; }

.thanks {
  font-style: italic;
  font-size: 1.15rem;
  margin: 0;
}
.era-hint {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em;
  color: var(--muted); margin: 0; text-shadow: none;
}

/* Principles page */
.principles {
  list-style: none; margin: 0 auto; padding: 0;
  max-width: 38rem;
  display: grid; gap: 1.35em;
  text-align: left;
  counter-reset: none;
}
.principles li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  column-gap: 0.9rem;
  align-items: baseline;
}
.principles .n {
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--accent);
  background: none; border: 0; padding: 0.2em 0;
  text-align: right;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.principles .text { margin: 0; text-wrap: pretty; }
.principles .then {
  grid-column: 2;
  margin: 0.55em 0 0;
  padding-left: 0.9em;
  border-left: 1px solid var(--accent);
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 0.98rem;
  color: var(--muted);
}
.principles .then cite {
  display: block;
  font: normal 0.66rem/1.6 var(--mono);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.y2001 .principles .n { font-family: var(--body); font-size: 1rem; color: var(--ink); cursor: default; }
.y2001 .principles .then { display: none; }
.era-2001 .principles { list-style: disc; padding-left: 1.4em; }
.era-2001 .principles li { display: list-item; }

/* Shoulder tooltip on the field */
#tip {
  position: fixed; z-index: 5;
  pointer-events: none;
  font: 500 0.72rem/1.35 var(--mono);
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--accent);
  padding: 0.35em 0.6em;
  border-radius: 2px;
  white-space: nowrap;
  transform: translate(12px, -50%);
}
#tip small { display: block; color: var(--muted); font-weight: 400; }

/* Preview-only: placeholders are dashed and there is a small badge. Remove the vector:preview meta to launch. */
.is-preview .ph { text-decoration: underline dashed var(--accent) 1px; text-underline-offset: 0.22em; }
.is-preview .ph-block { outline: 1px dashed var(--accent); outline-offset: 6px; }
#preview-badge {
  position: fixed; z-index: 6;
  left: max(12px, env(safe-area-inset-left, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100% - 24px);
  font: 0.7rem/1.4 var(--mono);
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--accent);
  padding: 0.45em 0.7em;
  text-shadow: none;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}
@media (max-width: 640px) {
  #preview-badge { position: relative; left: auto; bottom: auto; margin: 40px auto 0; width: fit-content; }
}
@media (max-width: 1080px) {
  .sheet::before { inset: -8% 0; }
}
