/* Sam Solomon — portfolio. Warm paper, ink, restrained brown. */

@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Spline Sans Mono";
  src: url("assets/fonts/spline-sans-mono.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f4f1ec;
  --paper-2: #efeae2;
  --paper-3: #e7e0d5;
  --ink: #1a1a18;
  --ink-2: #45423c;
  --muted: #645f57;
  --accent: #6d4a2f;
  --accent-2: #8a6a4f;
  --rule: rgba(26, 26, 24, 0.14);
  --rule-soft: rgba(26, 26, 24, 0.08);
  --rule-strong: rgba(26, 26, 24, 0.26);
  --grain: rgba(26, 26, 24, 0.045);
  --masthead: rgba(244, 241, 236, 0.94);
  --backdrop: rgba(26, 26, 24, 0.52);
  --sheet-shadow: 0 40px 90px -40px rgba(26, 26, 24, 0.6);
  /* Brand marks keep the surface their artwork needs, in either theme. */
  --brand-surface: #e7e0d5;
  --inverse-surface: #1a1a18;
  --inverse-fg: #f4f1ec;
  --shadow: 0 1px 2px rgba(26, 26, 24, 0.05), 0 12px 28px -18px rgba(26, 26, 24, 0.28);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gut: clamp(20px, 4.6vw, 64px);
  --rail: 336px;
}

/* Dark variant: the same warm relationship, reversed — espresso ground,
   cream ink, and a lighter tan accent instead of the darker brown. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141210;
  --paper-2: #1c1916;
  --paper-3: #241f1a;
  --ink: #ece5d8;
  --ink-2: #cbc2b2;
  --muted: #978d7d;
  --accent: #d0a074;
  --accent-2: #a87c51;
  --rule: rgba(236, 229, 216, 0.17);
  --rule-soft: rgba(236, 229, 216, 0.09);
  --rule-strong: rgba(236, 229, 216, 0.3);
  --grain: rgba(236, 229, 216, 0.05);
  --masthead: rgba(20, 18, 16, 0.94);
  --backdrop: rgba(6, 5, 4, 0.62);
  --sheet-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.85);
  --brand-surface: #e2dacb;
  --inverse-surface: #0d0b09;
  --inverse-fg: #f2ece1;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 12px 28px -18px rgba(0, 0, 0, 0.75);
}

:root[data-theme="dark"] .portrait img {
  mix-blend-mode: screen;
}

:root[data-theme="dark"] .timeline__org img[data-mark="mono"] {
  filter: invert(1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* faint paper texture, no images */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(var(--grain) 0.5px, transparent 0.6px);
  background-size: 4px 4px;
  opacity: 0.5;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: var(--gut);
  position: relative;
  z-index: 1;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 12px;
}
.skip:focus {
  left: var(--gut);
  top: 10px;
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--masthead);
  backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: 1px solid var(--rule);
}

.masthead__inner {
  display: flex;
  align-items: flex-end;
  gap: clamp(16px, 4vw, 48px);
  padding-block: 14px;
  flex-wrap: wrap;
}

.identity {
  margin-right: auto;
}

.identity__name {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 25px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  padding: 2px 0;
}

.identity__specialty {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.sections ul {
  display: flex;
  gap: clamp(14px, 2.2vw, 30px);
  flex-wrap: wrap;
}

.sections a {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 6px 0 5px;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.sections a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-2);
}

.sections a[aria-current="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.resume {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 8px 14px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.resume:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.masthead__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.theme[hidden] {
  display: none;
}

.theme:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.theme__glyph {
  font-size: 12px;
  line-height: 1;
}

/* ---------- shared type bits ---------- */

.num {
  font-family: var(--mono);
  font-size: 0.5em;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--accent);
  vertical-align: 0.55em;
  margin-right: 0.7em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}

.section-head {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
  margin-bottom: 26px;
}

.section-title {
  font-size: clamp(26px, 3.4vw, 40px);
}

.section-title--rail {
  font-size: 21px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}

.section-lede {
  color: var(--muted);
  font-size: 14.5px;
  max-width: 54ch;
  margin-top: 10px;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding-top: clamp(40px, 7vw, 92px);
  padding-bottom: clamp(40px, 6vw, 76px);
  border-bottom: 1px solid var(--rule);
}

.hero__title {
  font-size: clamp(38px, 6.4vw, 78px);
  line-height: 1.05;
  letter-spacing: -0.018em;
  max-width: 18ch;
}

.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.hero__sub {
  font-size: clamp(16px, 1.6vw, 19.5px);
  color: var(--ink-2);
  max-width: 52ch;
  margin-top: 26px;
}

.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  margin-top: clamp(34px, 4vw, 52px);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--rule-soft);
}

.figures__item {
  background: var(--paper);
  padding: 16px 18px 16px 0;
}

.figures dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.figures dd {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.figures dd span {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-right: 4px;
}

.hero__right {
  border-left: 1px solid var(--rule);
  padding-left: clamp(20px, 2.6vw, 34px);
}

.portrait {
  width: 128px;
  margin-bottom: 22px;
}

.portrait img {
  width: 100%;
  filter: grayscale(1) contrast(1.05);
  mix-blend-mode: multiply;
}

.rail-title {
  font-size: 15px;
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--rule-soft);
  padding-top: 14px;
  margin-top: 26px;
  margin-bottom: 12px;
}

.rail-title .num {
  font-size: 11px;
  vertical-align: 0;
}

.hero__right p {
  font-size: 14.5px;
  color: var(--ink-2);
}

.hero__right p + p {
  margin-top: 12px;
}

.status {
  border-top: 1px solid var(--rule-soft);
}

.status li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13.5px;
}

.status__k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}

.status__v {
  color: var(--ink);
}

/* ---------- page grid ---------- */

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: clamp(28px, 4.4vw, 64px);
  align-items: start;
  padding-top: clamp(40px, 5vw, 64px);
  padding-bottom: clamp(48px, 6vw, 88px);
}

.work {
  scroll-margin-top: 96px;
}

/* ---------- project cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.2vw, 28px);
}

.card {
  break-inside: avoid;
}

.card__open {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card__open:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--rule-strong);
}

.card__open:hover .preview--logo img,
.card__open:hover .preview--logo span {
  transform: scale(1.02);
}

.card__open:hover .card__cta {
  color: var(--accent);
  border-color: var(--accent-2);
}

.preview {
  aspect-ratio: 5 / 3;
  border-bottom: 1px solid var(--rule);
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.preview--logo {
  background: var(--brand-surface);
}

.preview--logo[data-tone="ink"] {
  background: var(--inverse-surface);
  color: var(--inverse-fg);
}

.preview--logo img,
.preview--logo span {
  max-width: 78%;
  max-height: 62%;
  width: auto;
  height: auto;
  transition: transform 0.25s ease;
}

.preview--logo span {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.012em;
}

.preview--data {
  background: var(--paper-3);
  gap: 0;
  padding: 18px 20px;
}

.preview--data .stat {
  text-align: center;
  padding: 0 10px;
}

.preview--data .stat + .stat {
  border-left: 1px solid var(--rule);
}

.preview--data[data-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preview--data[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview--data .stat b {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(22px, 2.6vw, 31px);
  letter-spacing: -0.015em;
  line-height: 1;
  color: var(--ink);
}

.preview--data .stat small {
  display: block;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--muted);
}

.preview__flag {
  position: absolute;
  left: 14px;
  top: 12px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.card__body {
  padding: 16px 18px 18px;
}

.card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}

.card__meta .year {
  color: var(--accent);
  white-space: nowrap;
}

.card__meta .year--pending {
  font-style: italic;
  letter-spacing: 0.06em;
  text-transform: none;
}

.card__title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.2;
  margin-top: 12px;
}

.card__org {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}

.card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 11px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.noscript {
  grid-column: 1 / -1;
  border: 1px dashed var(--rule);
  padding: 18px;
  font-size: 14px;
  color: var(--ink-2);
}

/* Links inside running text carry an underline, not colour alone (WCAG 1.4.1). */
.noscript a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ---------- rail ---------- */

.rail {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-bottom: 8px;
}

.rail__block {
  scroll-margin-top: 104px;
  padding-bottom: 34px;
}

.rail__block--last {
  padding-bottom: 0;
}

.timeline {
  margin-top: 6px;
}

.timeline__item {
  position: relative;
  padding: 18px 0 18px 24px;
  border-bottom: 1px solid var(--rule-soft);
}

.timeline__item:last-child {
  border-bottom: 0;
}

.timeline__mark {
  position: absolute;
  left: 0;
  top: 22px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--paper);
}

.timeline__item:first-child .timeline__mark {
  background: var(--accent);
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 32px;
  bottom: -18px;
  width: 1px;
  background: var(--rule);
}

.timeline__item:last-child::before {
  display: none;
}

.timeline__role {
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.timeline__org {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 3px;
}

.timeline__org img {
  width: 13px;
  height: 13px;
  object-fit: contain;
  opacity: 0.85;
}

.timeline__meta {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.timeline__summary {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 9px;
}

.timeline__points {
  margin-top: 9px;
}

.timeline__points li {
  position: relative;
  font-size: 12.5px;
  color: var(--muted);
  padding-left: 13px;
  margin-top: 5px;
  line-height: 1.5;
}

.timeline__points li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.skillset {
  margin-top: 16px;
}

.skillset__label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 16px;
  margin-bottom: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags li {
  font-size: 11.5px;
  line-height: 1;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--paper-2);
}

.contact__lede {
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
  margin-bottom: 6px;
}

.contact {
  border-top: 1px solid var(--rule-soft);
}

.contact li {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13px;
}

.contact__k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}

.contact__v {
  color: var(--ink);
  overflow-wrap: anywhere;
}

a.contact__v {
  display: inline-block;
  color: var(--accent);
  padding-block: 2px;
  border-bottom: 1px solid var(--rule-strong);
  transition: color 0.18s ease, border-color 0.18s ease;
}

a.contact__v:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 12px 18px;
  margin-top: 20px;
  transition: background 0.18s ease, color 0.18s ease;
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.button--full {
  width: 100%;
}

/* ---------- detail sheet ---------- */

.sheet {
  width: min(780px, calc(100vw - 2 * var(--gut)));
  max-height: min(86vh, 900px);
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--sheet-shadow);
  overflow: hidden;
}

/* Bound to the dialog's own state, so closing it — by button, backdrop or
   Escape — can never leave the page locked. */
html:has(.sheet[open]) {
  overflow: hidden;
}

.sheet::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(2px);
}

.sheet[open] {
  animation: sheet-in 0.22s ease-out;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
}

.sheet__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
  position: sticky;
  top: 0;
  z-index: 2;
}

.sheet__counter {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.sheet__nav {
  display: flex;
  gap: 8px;
}

.iconbtn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.iconbtn:hover:not([disabled]) {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.iconbtn[disabled] {
  opacity: 0.35;
  cursor: default;
}

.iconbtn--close {
  font-size: 21px;
}

.sheet__body {
  max-height: calc(min(86vh, 900px) - 59px);
  overflow-y: auto;
  padding: clamp(22px, 3.4vw, 38px);
}

.sheet__preview {
  aspect-ratio: 16 / 7;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper-3);
  display: grid;
  place-items: center;
  gap: 0;
  padding: 22px;
  margin-bottom: 24px;
}

.sheet__preview[data-type="logo"] {
  background: var(--brand-surface);
}

.sheet__preview[data-type="logo"][data-tone="ink"] {
  background: var(--inverse-surface);
  color: var(--inverse-fg);
}

.sheet__preview[data-type="data"] {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  align-items: center;
}

.sheet__preview img {
  max-width: 46%;
  max-height: 70%;
  width: auto;
  height: auto;
}

.sheet__preview .stat {
  text-align: center;
  padding: 0 8px;
}

.sheet__preview .stat + .stat {
  border-left: 1px solid var(--rule);
}

.sheet__preview .stat b {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 40px);
  letter-spacing: -0.015em;
  line-height: 1;
}

.sheet__preview .stat small {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.sheet__cat {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}

.sheet__title {
  font-size: clamp(27px, 4vw, 40px);
  letter-spacing: -0.015em;
  margin-top: 10px;
}

.sheet__orgline {
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
}

.sheet__sections {
  margin-top: 28px;
  border-top: 1px solid var(--rule);
}

.sheet__sections > div {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.sheet__sections h3 {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.sheet__sections p {
  font-size: 15px;
  color: var(--ink-2);
  max-width: 66ch;
}

.sheet__sections p + p {
  margin-top: 10px;
}

.sheet__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.sheet__tags li {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 5px 10px;
}

.sheet__note {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
  max-width: 68ch;
}

.sheet__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.sheet__foot .button {
  margin-top: 0;
}

.button--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}

.button--ghost:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

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

.colophon {
  padding-bottom: 44px;
}

.colophon__rule {
  border-top: 1px solid var(--rule);
  margin-bottom: 22px;
}

.colophon__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(16px, 3vw, 40px);
  align-items: start;
}

.colophon__name {
  font-family: var(--serif);
  font-size: 16px;
}

.colophon__top a {
  display: inline-block;
  padding: 4px 0;
}

.colophon__top {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

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

@media (max-width: 1180px) {
  .page-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    position: static;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
    border-top: 1px solid var(--rule);
    padding-top: 34px;
  }
  /* One block per row: each nav link needs its own scroll destination. */
  .rail__block {
    max-width: 760px;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }
  .hero__right {
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 28px;
  }
  .portrait {
    width: 104px;
  }
}

@media (max-width: 660px) {
  html {
    scroll-behavior: auto;
  }
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .masthead__inner {
    align-items: flex-start;
    gap: 14px;
    padding-block: 12px;
  }
  .identity {
    margin-right: auto;
    min-width: 0;
  }
  .masthead__actions {
    gap: 6px;
    flex: none;
  }
  .theme {
    padding: 7px 10px;
  }
  .theme__state {
    display: none;
  }
  .sections {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .sections ul {
    flex-wrap: nowrap;
    gap: 18px;
  }
  .figures__item {
    padding-right: 0;
  }
  .sheet {
    width: calc(100vw - 20px);
    max-height: 92vh;
  }
  .sheet__body {
    max-height: calc(92vh - 59px);
    padding: 20px 18px 26px;
  }
  .status li,
  .contact li {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .colophon__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .card__open:hover {
    transform: none;
  }
}
