/* Mid-century modern, 200 years on: a Saarinen-white atrium by day (ivory
   and ink navy), deep space by night (black and cream). The nanite dot and
   glow colors live in nanite_controller.js. */
:root {
  --bg: #f4efe4;
  --fg: #18242e;
  --muted: #6b6a63;
  --rule: #ddd5c4;
  --stamp: #c41e3a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #f1e9d8;
    --muted: #a39b8b;
    --rule: #26232d;
    --stamp: #ff3b5c;
  }
}

* {
  box-sizing: border-box;
}

/* `hidden` always wins, even over a display set below. */
[hidden] {
  display: none !important;
}

/* Taps never trigger double-tap zoom. Pinch zoom still works on text pages. */
html {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Times New Roman", Times, serif;
}

/* The home page is exactly one screen: the name at the top, the work list
   and links at the bottom, all laid over the cloud. It never scrolls. */
.landing {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header header"
    "stage  stage"
    "work   links";
  gap: 16px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: 24px 16px;
  /* The landing never scrolls, so touches go to the cloud: dragging a finger
     steers it instead of panning or zooming the page. */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

@media (max-width: 639px) {
  .landing {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "stage"
      "work"
      "links";
    grid-template-rows: auto 1fr auto auto;
  }

  /* Dots fade out behind the work list and links so the text stays clear. */
  .landing::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 48%;
    background: linear-gradient(to bottom, transparent, var(--bg) 45%);
    pointer-events: none;
  }
}

@media (min-width: 640px) {
  .landing {
    padding: 32px 40px;
  }
}

.landing-cloud {
  position: fixed;
  top: 0;
  left: 0;
  inset: 0;
  width: 100%;
  height: 100%;
}

.landing-header,
.landing-work,
.landing-links {
  position: relative;
  z-index: 1;
}

.landing-stage {
  grid-area: stage;
}

.landing-header {
  grid-area: header;
}

.landing-work {
  grid-area: work;
  align-self: end;
  max-width: 420px;
}

.landing-links {
  grid-area: links;
  align-self: end;
}

.landing-name {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.1;
}

.landing-tagline {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-style: italic;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Case study and colophon pages share one readable column. */

.prose,
.site-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 16px;
}

@media (min-width: 640px) {
  .prose,
  .site-footer {
    padding: 64px 40px;
  }
}

.section-heading {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.work-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-item + .work-item {
  margin-top: 8px;
}

.work-link {
  display: block;
  text-decoration: none;
}

.work-title {
  font-size: 1.125rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.work-summary {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.draft-badge {
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  vertical-align: middle;
}

/* A rubber stamp across the whole page. It sits over the text but lets
   clicks and text selection through. */
.draft-stamp {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0.5;
}

.draft-stamp span {
  padding: 0.1em 0.4em;
  border: 3px solid var(--stamp);
  border-radius: 6px;
  color: var(--stamp);
  font-size: clamp(2.5rem, 12vw, 9rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(-18deg);
}

.back-link {
  margin: 0 0 40px;
  font-style: italic;
}

.prose h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  line-height: 1.15;
}

.prose h2 {
  margin: 40px 0 8px;
  font-size: 1.25rem;
  font-weight: 400;
}

.prose p,
.prose li {
  line-height: 1.6;
}

.prose .lede {
  margin-top: 8px;
  color: var(--muted);
  font-size: 1.125rem;
  font-style: italic;
}

.link-list {
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.site-footer {
  border-top: 1px solid var(--rule);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The note for AI agents stays in the HTML but takes up no space on screen. */
.agent-note {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Playable demos on case study pages. They sit in the prose column and
   borrow its type; buttons are plain outlined boxes. */

.demo {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}

.demo-button,
.quiz-choice {
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}

.demo-button:hover,
.quiz-choice:hover:not(:disabled) {
  border-color: var(--fg);
}

.quiz-question {
  margin-top: 32px;
}

.quiz-number {
  color: var(--muted);
  font-style: italic;
}

.quiz-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.quiz-choice {
  position: relative;
  text-align: left;
}

.quiz-choice:disabled {
  cursor: default;
}

.quiz-label {
  margin-right: 6px;
  color: var(--muted);
}

.quiz-choice.is-correct {
  border-color: var(--fg);
  border-width: 2px;
  padding: 7px 13px;
}

.quiz-choice.is-wrong {
  border-color: var(--stamp);
  color: var(--stamp);
}

/* Gemma's pick gets a small tag in the corner. */
.quiz-choice.is-model::after {
  content: "Gemma";
  position: absolute;
  top: -9px;
  right: 8px;
  padding: 0 4px;
  background: var(--bg);
  color: var(--stamp);
  font-size: 0.75rem;
  font-style: italic;
}

.quiz-reveal p {
  color: var(--muted);
}

.quiz-score {
  margin-top: 32px;
  font-size: 1.125rem;
  font-style: italic;
}

.trivia-question {
  margin-top: 24px;
}

.trivia-prompt {
  font-size: 1.25rem;
}

.trivia-clock {
  height: 3px;
  margin-bottom: 16px;
  background: var(--rule);
}

.trivia-clock-bar {
  width: 100%;
  height: 100%;
  background: var(--stamp);
}

.trivia-entry {
  display: flex;
  gap: 8px;
}

/* 16px or larger, so phones don't zoom in when the field is focused. */
.trivia-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: max(1rem, 16px);
}

.trivia-input:focus {
  border-color: var(--fg);
  outline: none;
}
