/* Trove design system, from "DESIGN - For Toolbox" (Structured): putty canvas, ink rooms, a serif voice, a grotesk for work. Flat: no shadows, no gradients. */
@font-face { font-family: 'Instrument Serif'; src: url('fonts/InstrumentSerif-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('fonts/InstrumentSerif-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --putty: #c4c3b6; --ink: #000; --bone: #e7e5e4; --chalk: #ebebeb;
  --vellum: #dfdcd5; --graphite: #595855; --ash: #808080; --paper: #fff;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
  --gutter: 16px; --radius-card: 9px; --radius-pill: 28.8px; --radius-link: 2px;
  color-scheme: light;
}
@media (min-width: 700px) { :root { --gutter: 32px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--putty); color: var(--ink);
  font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header: the mark top-left, one text link top-right. Nothing else. */
.bar { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--gutter) 0; }
.mark {
  width: 32px; height: 32px; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center;
  font: 400 19px/1 var(--serif); text-decoration: none; padding-top: 2px;
}
.link { font-size: 12px; text-decoration: none; padding: 10px 0 10px 10px; }
.link:hover, .link:focus-visible { text-decoration: underline; }

/* The wordmark: as big as the screen allows, never cut off. */
.wordmark {
  font: 400 clamp(96px, 50vw, 374px)/0.84 var(--serif); letter-spacing: -0.009em; white-space: nowrap;
  margin: 28px var(--gutter) 20px;
}
.display { font: 400 52px/1 var(--serif); letter-spacing: -0.009em; margin: 0; }
.heading { font: 400 34px/1.05 var(--serif); letter-spacing: -0.005em; margin: 0; }
.serif { font-family: var(--serif); }
.label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.muted { color: var(--graphite); }
.small { font-size: 12px; }

.wrap { padding: 0 var(--gutter); }
.stack > * + * { margin-top: 16px; }

/* Rooms are hexagons. The open one is filled. */
.hexes { display: flex; flex-wrap: wrap; gap: 18px; padding: 10px var(--gutter) 24px; }
.hex { background: none; border: 0; padding: 0; cursor: pointer; text-align: center; font-size: 12px; min-width: 44px; }
.hex svg { display: block; margin: 0 auto 6px; }
.hex polygon { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.hex[aria-pressed="true"] polygon { fill: var(--ink); }
.hex .lock { display: block; font-size: 10px; color: var(--graphite); }

/* Tools: bone cards with a circle. */
.tools { display: grid; gap: 12px; padding: 0 var(--gutter); }
@media (min-width: 700px) { .tools { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.card { background: var(--bone); border-radius: var(--radius-card); padding: 20px; }
.tool { display: flex; gap: 16px; align-items: center; }
.circle { width: 72px; height: 72px; border-radius: 50%; background: var(--ash); flex: none; object-fit: cover; }
.tool h3 { font: 400 28px/1.05 var(--serif); letter-spacing: -0.005em; margin: 0 0 2px; }
.tool p { margin: 0; font-size: 12px; color: var(--graphite); }
.tool .go { margin-top: 12px; }
.empty { padding: 4px var(--gutter) 24px; color: var(--graphite); }

/* Pills: the only buttons. */
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px;
  background: var(--ink); color: var(--paper); border: 0; border-radius: var(--radius-pill);
  font-size: 12px; padding: 9px 17px; text-decoration: none; cursor: pointer;
}
.pill.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pill.light { background: var(--paper); color: var(--ink); }
.pill[disabled] { opacity: .45; cursor: default; }
@media (pointer: coarse) { .pill { min-height: 44px; font-size: 14px; padding: 11px 20px; } }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Notices sit at the top of the shelf, quietly. */
.notice { margin: 16px var(--gutter) 0; padding: 12px 16px; border: 1px solid var(--ink); border-radius: var(--radius-card); display: flex; gap: 12px; align-items: center; justify-content: space-between; font-size: 13px; }

/* Fields: hairline, bone, generous. 16px stops iPhone zooming in. */
.field { display: block; }
.field span { display: block; font-size: 12px; margin-bottom: 6px; }
.input {
  width: 100%; font-size: 16px; padding: 12px 14px; background: var(--bone); border: 1px solid var(--ink);
  border-radius: var(--radius-card); outline: none;
}
.input:focus-visible { box-shadow: 0 0 0 2px var(--putty), 0 0 0 3px var(--ink); }

/* Ink rooms: hard cut to black, white type. */
.ink { background: var(--ink); color: var(--paper); padding: 32px var(--gutter) calc(32px + env(safe-area-inset-bottom)); margin-top: 48px; }
.ink .muted { color: #b9b8b0; }
.ink .display, .ink .heading { color: var(--paper); }

/* Settings sections */
.section { padding: 24px var(--gutter); border-top: 1px solid var(--ink); }
.section:first-of-type { border-top: 0; }
.section h2 { font: 400 34px/1.05 var(--serif); margin: 0 0 12px; }
.section p { margin: 0 0 12px; max-width: 60ch; }
.steps { margin: 0; padding-left: 20px; }
.steps li + li { margin-top: 6px; }

/* Plain pages (the service worker's messages) */
.note-page { padding: 48px var(--gutter); max-width: 560px; }
.note-page p { margin: 16px 0; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.gap-top { margin-top: 24px; }
.pad-top { padding-top: 28px; }
