/* Layout only. Colour, type, spacing, and radius are the brand tokens
   (brand/tokens.css, copied from docs/reference/branding by the build);
   sapphire is every action, brass is punctuation, dark is the default. */

* { box-sizing: border-box; }

html { background: var(--color-bg); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
}

a { color: var(--color-link); }
a:hover { color: var(--color-primary-hover); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.masthead,
main,
.colophon {
  width: min(100% - 2 * var(--space-4), 44rem);
  margin-inline: auto;
}

/* One column of prose reads well at 44rem; a laptop shows more margin than
   page. Past 64rem the column widens and each section turns sideways: the
   eyebrow and heading on the left, the body on the right, at the same 38rem
   measure it reads at on a phone. The hero stays a single statement. */
@media (min-width: 64rem) {
  .masthead,
  main,
  .colophon {
    width: min(100% - 2 * var(--space-6), 64rem);
  }
}

/* The wordmark keeps its 0.20em tracking at every width (BRAND.md), so on a
   phone the nav drops to a second line rather than crowding it. */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-block: var(--space-5);
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.mark { display: block; }

/* BRAND.md: the wordmark is Josefin Sans 300, uppercase, 0.20em tracking. Always. */
.wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-xl);
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--color-accent);
  /* Optical: Josefin's caps sit low; nudge to centre on the mark. */
  transform: translateY(2px);
}

.nav {
  display: flex;
  gap: var(--space-5);
  margin-inline-start: auto;
}

/* BRAND.md law 3: brass is the active nav item. */
.nav a[aria-current="page"] { color: var(--color-accent); }

.nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  text-decoration: none;
}

main { flex: 1; }

.hero { padding-block: var(--space-9) var(--space-8); }

/* The masthead is the studio's everywhere; a page's own lockup opens its hero,
   one step larger. Same wordmark rules as above (BRAND.md). */
.hero-lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-6);
}
.hero-lockup .wordmark { font-size: var(--text-2xl); transform: translateY(3px); }

.eyebrow {
  margin: 0 0 var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-fg-muted);
}

h1 {
  margin: 0 0 var(--space-5);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(var(--text-3xl), 6vw, var(--text-5xl));
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--color-fg);
}

.lede {
  margin: 0 0 var(--space-6);
  max-width: 38rem;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-fg-secondary);
}

.status {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-fg-muted);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0 0;
}

.cta .aside { font-size: var(--text-sm); }

/* BRAND.md law 2: sapphire is every action. */
.button {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
}
.button:hover { background: var(--color-primary-hover); color: var(--color-on-primary); }
.button:active { background: var(--color-primary-active); }

/* Landing body: one column of sections under the hero, separated by space
   rather than rules. A pair is two floating surfaces with a gutter. */
.section { padding-block: var(--space-7); }

/* Desktop: eyebrow and heading take the first column, everything else the
   second. The first body item spans the heading's two rows so the body starts
   level with the eyebrow; the heading's row is the flexible one, so the
   body's extra height lands there and the eyebrow's row stays its own size. */
@media (min-width: 64rem) {
  .section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    grid-template-rows: auto 1fr;
    column-gap: var(--space-8);
    padding-block: var(--space-8);
  }
  .section > .eyebrow { grid-column: 1; grid-row: 1; }
  .section > h2 { grid-column: 1; grid-row: 2; align-self: start; margin-bottom: 0; }
  .section > :not(.eyebrow):not(h2) { grid-column: 2; }
  .section > h2 + * { grid-row: 1 / span 2; margin-top: 0; }
}

.section h2 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
}

.section > p {
  margin: 0 0 var(--space-4);
  max-width: 38rem;
  line-height: var(--leading-relaxed);
  color: var(--color-fg-secondary);
}

.pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0 0;
}

.pair > div {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
  box-shadow: var(--shadow-1);
}

.pair dt {
  margin: 0 0 var(--space-2);
  font-weight: 500;
  color: var(--color-fg);
}

/* The object a path lands on, set as data: a label beside the sentence. */
.pair .object {
  display: block;
  margin-top: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-fg-muted);
}

.pair dd {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-fg-secondary);
}

/* A list marked in brass: the landing's promises, the tenets. list-style:
   none loses list semantics in WebKit; the markup says role="list". */
.marked {
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
  max-width: 38rem;
}

.marked li {
  position: relative;
  padding-left: var(--space-5);
  margin-bottom: var(--space-3);
  line-height: var(--leading-relaxed);
  color: var(--color-fg-secondary);
}

/* BRAND.md law 3: brass is punctuation. A square, not a bullet — law 5. */
.marked li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
}

.marked strong { font-weight: 500; color: var(--color-fg); }

/* One photograph on a page, full column width, the caption set as data.
   Radius is the largest the brand allows (BRAND.md law 5). */
.figure {
  margin: var(--space-5) 0 var(--space-6);
  max-width: 38rem;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
}

.figure figcaption {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-fg-muted);
}

.surfaces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-5) var(--space-6);
  margin: var(--space-5) 0 0;
}

.surface-list,
.dashboard-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
}

/* One count across both lists, so the numbers match the gallery's. */
.surfaces { counter-reset: surface; }
.surface-list li,
.dashboard-list dt { counter-increment: surface; }
.surface-list li { margin-bottom: var(--space-2); }
.surface-list li::before,
.dashboard-list dt::before {
  content: counter(surface, decimal-leading-zero) " ";
  color: var(--color-fg-muted);
}

.surface-list a,
.dashboard-list a { text-decoration: none; }

.dashboard-list dt { margin: 0; }
.dashboard-list dd {
  margin: 0 0 var(--space-3) 3ch;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-normal);
  color: var(--color-fg-muted);
}

code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.colophon {
  padding-block: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-fg-muted);
}

.colophon p { margin: 0; }

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