/* What the Frame Allows — styles.
   Shares the design language of ../purpose/ and ../susan-and-robert/
   (same SEA-EU thinking-surface family, same tokens). */

:root {
  --paper: #f5f2ea;
  --card: #fcfaf4;
  --inset: #efeadd;
  --ink: #23261f;
  --ink-soft: #474b40;
  --muted: #6b6557;
  /* text-only shades of the accent colours, 4.5:1 or better on every course background (30 Sep 2026) */
  --text-ochre: #855c15; --text-green: #4c6a3a; --text-brown: #8e4f22;
  --hair: #ddd6c4;
  --hair-strong: #c9c1ab;
  --danger: #a8442c;
  --danger-soft: #f4e6df;
  --ok: #587d4b;
  --ok-soft: #e9eedd;
  --warn: #b7822f;
  --warn-soft: #f5ecd8;
  --ai: #6c58a8;
  --ai-soft: #ece7f4;
  --font-ui: "Schibsted Grotesk", system-ui, sans-serif;
  --font-display: "Newsreader", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

.app { min-height: 100vh; display: flex; flex-direction: column; }

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

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding: 26px 44px 0 44px;
  border-bottom: 1px solid var(--hair-strong);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.masthead-id { padding-bottom: 18px; }

.masthead-eyebrow {
  margin: 0 0 4px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.masthead-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-optical-sizing: auto;
}

.lens-tabs { display: flex; gap: 4px; }

.lens-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 14px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-ui);
  transition: color 0.15s ease;
}

.lens-tab:hover { color: var(--ink-soft); }

.lens-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.lens-tab-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.lens-tab-name { font-size: 15.5px; font-weight: 600; }

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(380px, 5fr) minmax(420px, 6fr);
  gap: 48px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 44px 64px 44px;
  flex: 1;
  align-items: start;
}

.stage { position: sticky; top: 28px; }

.stage-caption {
  margin: 6px auto 0 auto;
  max-width: 420px;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.panel { min-width: 0; }

.lens-panel { display: flex; flex-direction: column; gap: 18px; }

/* ---------- the audit plane (centerpiece) ---------- */

.ff-svg { width: 100%; height: auto; display: block; touch-action: none; }

.ff-quad { opacity: 0.06; }
.ff-frame { fill: none; stroke: var(--hair-strong); stroke-width: 1.5; }
.ff-mid { stroke: var(--hair-strong); stroke-width: 1; stroke-dasharray: 3 6; opacity: 0.7; }

.ff-axis-end {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  fill: var(--ink-soft);
}
.ff-axis-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  fill: var(--muted);
}

.ff-chip { transition: none; }
.ff-chip-box {
  fill: var(--card);
  stroke: var(--hair-strong);
  stroke-width: 1.4;
  transition: stroke 0.15s ease, fill 0.15s ease;
}
.ff-chip-label {
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  fill: var(--ink);
  pointer-events: none;
  user-select: none;
}
.ff-chip:hover .ff-chip-box { stroke: var(--ink-soft); }
.ff-chip.is-active .ff-chip-box { fill: var(--inset); stroke: var(--ink); stroke-width: 2; }
.ff-chip:focus-visible { outline: none; }
.ff-chip:focus-visible .ff-chip-box { stroke: var(--ink); stroke-width: 2; }

/* ---------- cards (shared vocabulary) ---------- */

.detail-card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 26px 28px;
}

.detail-kicker {
  margin: 0 0 6px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-title {
  margin: 0 0 12px 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 25px;
  line-height: 1.18;
  letter-spacing: -0.005em;
}

.detail-body {
  margin: 0 0 12px 0;
  font-size: 17px;
  line-height: 1.68;
  color: var(--ink-soft);
}
.detail-body:last-child { margin-bottom: 0; }

.detail-craft {
  margin: 0 0 16px 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.detail-craft li {
  position: relative;
  padding-left: 20px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.detail-craft li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 7px;
  height: 7px;
  background: var(--hair-strong);
}
.detail-craft:last-child { margin-bottom: 0; }

.detail-example {
  background: var(--inset);
  border-radius: 6px;
  padding: 16px 18px;
}
.detail-example-kicker {
  margin: 0 0 6px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-example-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.5;
  font-style: italic;
}

.detail-hint {
  margin: 14px 0 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.footnote {
  margin: 8px 0 0 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.bq { margin: 0 0 12px 0; padding: 4px 0 0 0; }
.bq:last-child { margin-bottom: 0; }
.bq p {
  margin: 0 0 8px 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
}
.bq cite {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
}

/* accent cards — coloured left border by tone */
.ff-accent { border-left-width: 4px; }
.ff-accent[data-tone="danger"] { border-left-color: var(--danger); }
.ff-accent[data-tone="ok"] { border-left-color: var(--ok); }
.ff-accent[data-tone="warn"] { border-left-color: var(--warn); }
.ff-accent[data-tone="ai"] { border-left-color: var(--ai); }

/* ---------- the audit readout (tab 02) ---------- */

.sim-block {
  border-top: 1px solid var(--hair-strong);
  padding-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sim-kicker {
  margin: 0 0 -8px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.sim-block .detail-title { margin-bottom: 0; }

.ff-readout {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ff-readout-chip {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
}
.ff-readout-chip-empty { color: var(--muted); font-style: italic; }
.ff-readout-note {
  margin: -8px 0 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.ff-quad-readout {
  border-top: 1px solid var(--hair);
  padding-top: 14px;
  border-left: 3px solid var(--hair-strong);
  padding-left: 14px;
}
.ff-quad-readout[data-tone="danger"] { border-left-color: var(--danger); }
.ff-quad-readout[data-tone="ok"] { border-left-color: var(--ok); }
.ff-quad-readout[data-tone="warn"] { border-left-color: var(--warn); }
.ff-quad-readout[data-tone="muted"] { border-left-color: var(--hair-strong); }
.ff-quad-name {
  margin: 0 0 6px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.ff-quad-reading {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
}

/* ---------- next / link cards ---------- */

.next-link {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--inset);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 12px;
  transition: border-color 0.15s ease;
}
.next-link:first-of-type { margin-top: 4px; }
.next-link:hover { border-color: var(--ink); }
.next-link-kicker {
  margin: 0 0 4px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.next-link-label { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }

/* ---------- colophon ---------- */

.colophon {
  border-top: 1px solid var(--hair-strong);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 44px 26px 44px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.colophon p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- 04 · Your Frame (the activity) ---------- */

.ff-reflect { margin: 14px 0 0 0; padding: 10px 12px; background: var(--inset); border-radius: 6px; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.ff-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.ff-sum-q { padding: 10px 12px; border-radius: 6px; background: var(--inset); border-left: 4px solid var(--hair-strong); }
.ff-sum-q[data-tone="danger"] { border-left-color: var(--danger); }
.ff-sum-q[data-tone="ok"] { border-left-color: var(--ok); }
.ff-sum-q[data-tone="warn"] { border-left-color: var(--warn); }
.ff-sum-name { margin: 0 0 4px 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.ff-sum-items { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
.ff-sum-none { color: var(--muted); font-style: italic; }
.ff-small { margin: 10px 0 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.ff-privacy { color: var(--ai); }
.ff-label { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ff-input {
  box-sizing: border-box;
  width: 100%;
  font-family: var(--font-ui);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--hair-strong);
  border-radius: 6px;
  padding: 9px 11px;
}
.ff-textarea { display: block; resize: vertical; line-height: 1.5; }
.detail-card > .ff-textarea { margin-top: 8px; }
.ff-input:focus { outline: 2px solid var(--ok); outline-offset: 1px; border-color: var(--ok); }
.ff-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.ff-btn {
  appearance: none;
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--hair-strong);
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ff-btn:hover { border-color: var(--ink); }
.ff-btn-primary { background: var(--ink); color: var(--card); border-color: var(--ink); }
.ff-btn-primary:hover { background: #3a3e33; }
.ff-btn.is-done { background: var(--ok); border-color: var(--ok); color: var(--card); }
.ff-prompt {
  margin: 12px 0 0 0;
  max-height: 320px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--hair-strong);
  border-radius: 6px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ff-subhead { margin: 18px 0 8px 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ff-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.ff-list li { position: relative; padding-left: 20px; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.ff-list li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--ai); }
@media (max-width: 560px) { .ff-sum { grid-template-columns: 1fr; } }

/* ---------- responsive ---------- */

@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; gap: 24px; padding: 24px 24px 48px 24px; }
  .stage { position: static; max-width: 540px; margin: 0 auto; }
  .masthead { padding: 22px 24px 0 24px; }
  .lens-tabs { overflow-x: auto; width: 100%; }
  .colophon { padding: 16px 24px 22px 24px; }
}

@media (max-width: 560px) {
  .masthead-title { font-size: 27px; }
  .lens-tab { padding: 10px 10px 12px 10px; }
  .lens-tab-name { font-size: 14px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
