/* ==========================================================================
   Typeface specimen page (sansman/index.html)
   Loaded AFTER style.css, so it can reuse its colours and fonts.
   --------------------------------------------------------------------------
   1. Accent colour + grid
   2. Section headers
   3. Hero
   4. Controls (buttons, sliders)
   5. 01 Styles
   6. 02 Tester
   7. 03 Waterfall
   8. 04 Glyphs
   9. 05 Features
   10. 06 Specimens (posters)
   11. 07 Information
   12. Mobile
   13. Serifman page: colours, poster gallery, Serifman posters
   ========================================================================== */


/* 1. ACCENT COLOUR + GRID ------------------------------------------------- */

:root {
  --accent: #ff3b1f;          /* the Swiss red. Change it here. */
  --on-accent: #ffffff;
  --panel: #f2f2f2;           /* light grey boxes */
}
@media (prefers-color-scheme: dark) {
  :root { --panel: #161616; }
}

/* The typeface being shown. Each specimen page sets --specimen-font on its
   <body> (see section 13); everything else on the page stays in Sansman. */
.sp-hero-word, .style-row .sample, .tester-output, .waterfall-row .sample,
.glyph-grid, .inspector-glyph, .feature-sample {
  font-family: var(--specimen-font, "Sansman"), serif;
}

/* A 12-column grid. Children choose their columns with e.g. class="c-1-6"
   (start at column 1, end after column 6). */
.grid12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gap);
}
.c-1-3  { grid-column: 1 / 4; }
.c-1-4  { grid-column: 1 / 5; }
.c-1-6  { grid-column: 1 / 7; }
.c-1-12 { grid-column: 1 / 13; }
.c-4-6  { grid-column: 4 / 7; }
.c-4-12 { grid-column: 4 / 13; }
.c-5-12 { grid-column: 5 / 13; }
.c-7-9  { grid-column: 7 / 10; }
.c-7-12 { grid-column: 7 / 13; }
.c-10-12 { grid-column: 10 / 13; }

.small { font-size: 14px; line-height: 1.3; }
.accent { color: var(--accent); }


/* 2. SECTION HEADERS ------------------------------------------------------ */

.sp-section { padding: 0 0 160px; scroll-margin-top: 80px; }

.sp-section-head {
  border-top: 2px solid var(--text);
  padding-top: 12px;
  margin-bottom: 64px;
  align-items: start;
}
.sp-section-head .num { font-weight: 700; }
.sp-section-head h2 {
  font-weight: 700;
  font-size: 56px;
  line-height: 0.95;
  letter-spacing: -0.04em;
}


/* 3. HERO ----------------------------------------------------------------- */

.sp-hero { padding-top: 120px; padding-bottom: 120px; }

.sp-meta {
  border-top: 2px solid var(--text);
  padding-top: 12px;
  font-size: 14px;
}
.sp-meta p:first-child { font-weight: 700; }

/* The giant word. Its size is set by specimen.js so it always fills the width. */
.sp-hero-word {
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.045em;
  white-space: nowrap;
  margin: 48px 0 24px -0.05em;
  cursor: ew-resize;
  user-select: none;
  display: flex;
  align-items: flex-end;   /* sits on the line below, whatever the weight */
}

.sp-hero-readout {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.sp-weight-bar { height: 4px; background: var(--line); margin-top: 8px; position: relative; }
.sp-weight-bar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); transition: width 0.15s; }

.sp-intro { margin-top: 96px; }
.sp-intro p { font-size: 32px; line-height: 1.1; letter-spacing: -0.02em; }

.sp-index { list-style: none; font-size: 14px; }
.sp-index li { border-top: 1px solid var(--line); }
.sp-index a { display: flex; justify-content: space-between; padding: 8px 0; }
.sp-index a:hover { color: var(--accent); opacity: 1; }


/* 4. CONTROLS ------------------------------------------------------------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
  align-items: end;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.control { display: flex; flex-direction: column; gap: 8px; }
.control-label { color: var(--muted); display: flex; justify-content: space-between; gap: 16px; }
.control-label output { color: var(--text); font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.chip:hover { border-color: var(--text); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 2px;
  background: var(--text);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
}

.text-input {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--text);
  padding: 6px 0;
  width: 260px;
  outline: none;
}
.text-input:focus { border-color: var(--accent); }

[contenteditable] { outline: none; }
[contenteditable]:focus { caret-color: var(--accent); }


/* 5. 01 STYLES ------------------------------------------------------------ */

.style-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--gap);
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.style-row .label { font-size: 14px; }
.style-row .sample {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.style-row:hover .label { color: var(--accent); }


/* 6. 02 TESTER ------------------------------------------------------------ */

.tester {
  margin-top: 24px;
  padding: 48px 32px;
  min-height: 420px;
  background: var(--panel);
  transition: background 0.2s, color 0.2s;
}
.tester.is-inverted { background: var(--accent); color: var(--on-accent); }
.tester-output { overflow-wrap: break-word; }

.css-readout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.css-readout code { font-family: ui-monospace, Menlo, monospace; overflow-x: auto; white-space: nowrap; }


/* 7. 03 WATERFALL --------------------------------------------------------- */

.waterfall-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--gap);
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.waterfall-row .px { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.waterfall-row .sample { white-space: nowrap; overflow: hidden; line-height: 1.15; }


/* 8. 04 GLYPHS ------------------------------------------------------------ */

.glyphs { margin-top: 24px; align-items: start; }

/* The big glyph with its guide lines.
   The numbers come from the font's own measurements (out of 1000 units):
   ascender 950, cap height 712, x-height 516, descender -238. */
.inspector {
  position: sticky;
  top: 96px;
  background: var(--panel);
  padding: 24px;
  --size: 300px;
}
.inspector-stage {
  position: relative;
  height: calc(var(--size) * 1.188);
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.inspector-glyph {
  font-size: var(--size);
  line-height: 1.188;
  position: relative;
  z-index: 1;
}
.guide {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--accent);
  font-size: 11px;
  color: var(--accent);
  padding-top: 2px;
}
.guide.ascender  { top: 0; }
.guide.cap       { top: calc(var(--size) * 0.238); }
.guide.xheight   { top: calc(var(--size) * 0.434); }
.guide.baseline  { top: calc(var(--size) * 0.95); }
.guide.descender { top: calc(var(--size) * 1.188 - 1px); }
.guide span { position: absolute; right: 0; }
.guide.descender span { top: -16px; }   /* label above the line, so it isn't cut off */

.inspector-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px var(--gap);
  margin-top: 16px;
  font-size: 14px;
}
.inspector-info dt { color: var(--muted); }

.glyph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin-top: 16px;
}
.glyph-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  font-family: inherit;
  font-weight: inherit;
  cursor: pointer;
}
.glyph-cell:hover { background: var(--panel); }
.glyph-cell.is-active { background: var(--accent); color: var(--on-accent); }
.glyph-count { font-size: 14px; color: var(--muted); }


/* 9. 05 FEATURES ---------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.feature {
  background: var(--panel);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 420px;
}
.feature-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.feature-tag { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--muted); }
.feature-sample { font-size: 72px; line-height: 1; letter-spacing: -0.02em; flex: 1; display: flex; align-items: center; }
.feature p.small { color: var(--muted); }


/* Toggle switch */
.switch {
  font: inherit; font-size: 14px;
  background: none; color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; cursor: pointer;
}
.switch[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }


/* 10. 06 SPECIMENS (posters) ---------------------------------------------- */

.posters {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}
.poster {
  position: relative;
  overflow: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}
.poster .small { position: relative; z-index: 1; }

/* Poster 1: red, giant "Aa" */
.poster-aa {
  grid-column: span 7;
  aspect-ratio: 4 / 5;
  background: var(--accent);
  color: #fff;
}
.poster-aa .huge {
  font-weight: 900;
  font-size: 36vw;
  line-height: 0.72;
  letter-spacing: -0.07em;
  margin-left: -0.06em;
}
.poster-aa .meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }

/* Poster 2: weights stacked */
.poster-stack {
  grid-column: span 5;
  background: #0a0a0a;
  color: #f2f2f2;
}
.poster-stack .lines p {
  font-size: 4.6vw;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

/* Poster 3: editorial page */
.poster-editorial {
  grid-column: span 5;
  background: var(--panel);
  color: var(--text);
  gap: 32px;
}
.poster-editorial h3 { font-size: 52px; font-weight: 700; line-height: 0.92; letter-spacing: -0.04em; }
.poster-editorial .cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); font-size: 12px; line-height: 1.35; }
.poster-editorial .cols p + p { margin-top: 8px; }
.poster-editorial .dropline { border-top: 2px solid var(--accent); padding-top: 8px; }

/* Poster 4: numerals */
.poster-numerals {
  grid-column: span 7;
  background: #f2f2f2;
  color: #0a0a0a;
  aspect-ratio: 7 / 5;
}
.poster-numerals .digits {
  font-weight: 100;
  font-size: 13.4vw;
  line-height: 0.8;
  letter-spacing: -0.05em;
}
.poster-numerals .digits b { font-weight: 900; color: var(--accent); }

/* Poster 5: wayfinding sign */
.poster-sign {
  grid-column: span 6;
  background: #0a0a0a;
  color: #fff;
  gap: 0;
  padding: 0;
}
.sign-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  border-bottom: 1px solid #333;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sign-row .pill {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900;
}
.sign-row .time { font-weight: 300; font-variant-numeric: tabular-nums; }

/* Poster 6: app interface */
.poster-ui {
  grid-column: span 6;
  background: var(--accent);
  align-items: center;
  justify-content: center;
}
.phone {
  width: 300px;
  background: #fff;
  color: #0a0a0a;
  border-radius: 36px;
  padding: 28px 22px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}
.phone .greeting { font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; margin: 12px 0 24px; }
.phone .card { background: #f2f2f2; border-radius: 16px; padding: 16px; margin-bottom: 8px; }
.phone .card .big { font-size: 40px; font-weight: 900; letter-spacing: -0.04em; }
.phone .row-ui { display: flex; justify-content: space-between; font-size: 14px; padding: 10px 0; border-bottom: 1px solid #e3e3e3; }
.phone .button { margin-top: 16px; background: #0a0a0a; color: #fff; border-radius: 999px; text-align: center; padding: 14px; font-weight: 500; }


/* 11. 07 INFORMATION ------------------------------------------------------ */

.spec-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.spec-table th, .spec-table td { text-align: left; font-weight: 400; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { color: var(--muted); width: 40%; }

.about-type p { font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
.about-type p + p { margin-top: 24px; }

.cta {
  display: inline-block;
  margin-top: 48px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 18px 28px;
  border-radius: 999px;
  font-size: 20px;
}
.cta:hover { opacity: 0.85; }


/* 12. MOBILE -------------------------------------------------------------- */

@media (max-width: 810px) {
  .grid12 > * { grid-column: 1 / -1; }
  .grid12 { row-gap: 12px; }
  .sp-section-head h2 { font-size: 40px; }
  .sp-intro p { font-size: 24px; }
  .style-row { grid-template-columns: 1fr; gap: 4px; }
  .waterfall-row { grid-template-columns: 48px 1fr; }
  .tester { padding: 24px 16px; min-height: 300px; }
  .inspector { position: static; --size: 200px; }
  .features { grid-template-columns: 1fr; }
  .feature { min-height: 0; }
  .feature-sample { font-size: 48px; }
  .posters > .poster { grid-column: 1 / -1; }
  .poster-aa .huge { font-size: 78vw; }
  .poster-stack .lines p { font-size: 10vw; }
  .poster-numerals { aspect-ratio: auto; }
  .poster-numerals .digits { font-size: 21vw; }
  .sign-row { font-size: 24px; grid-template-columns: 44px 1fr auto; gap: 12px; padding: 14px 16px; }
  .sign-row .pill { width: 40px; height: 40px; font-size: 20px; }
  .poster-ui { padding: 48px 16px; }
  .phone { width: 100%; max-width: 300px; }
  input[type="range"] { width: 120px; }
}


/* 13. SERIFMAN PAGE ------------------------------------------------------- */

.page-serifman {
  --specimen-font: "Serifman";
  --accent: #0066c7;          /* the sky blue from the Serifman launch poster */
  --cream: #fbf6ee;
  --green: #0d8e69;
  --orange: #ff581a;
}

/* Serifman is a display face: set the big samples a little looser */
.page-serifman .sp-hero-word { letter-spacing: -0.03em; line-height: 0.85; }
.page-serifman .style-row .sample { letter-spacing: -0.01em; }

/* --- Original campaign: Aachman's posters, click to enlarge --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* 2 posters per row */
  gap: var(--gap);
}
.gallery-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}
.gallery-grid img:hover { transform: scale(1.03); }
.gallery-note { margin-top: 16px; font-size: 14px; color: var(--muted); }

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(90vw, 90vh);
  margin: auto;
  cursor: zoom-out;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.85); }
.lightbox:focus, .lightbox:focus-visible { outline: none; }
.lightbox img { width: 100%; height: auto; }

/* --- Serifman posters (made in code) --- */
.sf { font-family: "Serifman", serif; }
.sf-poster { color: #111; }

/* Magazine cover */
.sf-cover { grid-column: span 7; aspect-ratio: 4 / 5; background: var(--cream); }
.sf-cover .masthead {
  font-weight: 300;
  font-size: 11.6vw;
  line-height: 0.8;
  letter-spacing: -0.03em;
  text-align: center;
}
.sf-cover .issue { display: flex; justify-content: space-between; font-variant: small-caps; font-feature-settings: "smcp" 1; }
.sf-cover .lead { font-style: italic; font-weight: 600; font-size: 4.4vw; line-height: 0.95; letter-spacing: -0.02em; max-width: 80%; }
.sf-cover .lines { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); font-size: 18px; line-height: 1.15; }
.sf-cover .lines b { font-weight: 700; display: block; font-size: 22px; }

/* Two ampersands */
.sf-amp { grid-column: span 5; background: var(--green); color: var(--cream); }
.sf-amp .pair { display: flex; justify-content: space-around; align-items: baseline; font-size: 15vw; line-height: 1; }
.sf-amp .pair span:last-child { font-style: italic; font-feature-settings: "ss01" 1; }
.sf-amp .labels { display: flex; justify-content: space-around; }

/* Perfume label */
.sf-perfume { grid-column: span 5; background: #111; color: var(--cream); align-items: center; text-align: center; }
.sf-perfume .name { font-style: italic; font-weight: 300; font-size: 6.2vw; line-height: 0.9; }
.sf-perfume .name b { font-style: normal; font-weight: 700; display: block; }
.sf-perfume .sc { font-feature-settings: "smcp" 1, "c2sc" 1; letter-spacing: 0.12em; font-size: 18px; }
.sf-perfume .rule { width: 48px; height: 1px; background: currentColor; margin: 0 auto; }

/* Restaurant menu */
.sf-menu { grid-column: span 7; background: var(--cream); padding: 48px; gap: 24px; }
.sf-menu h3 { font-size: 64px; font-weight: 500; text-align: center; line-height: 1; letter-spacing: -0.02em; }
.sf-menu .sc { font-feature-settings: "smcp" 1, "c2sc" 1; letter-spacing: 0.1em; text-align: center; font-size: 18px; }
.sf-menu ul { list-style: none; display: grid; gap: 16px; }
.sf-menu li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline; font-size: 24px; }
.sf-menu li::after { content: none; }
.sf-menu .dots { border-bottom: 1px dotted #999; transform: translateY(-6px); }
.sf-menu .desc { grid-column: 1 / -1; font-style: italic; font-size: 16px; color: #666; margin-top: -10px; }
.sf-menu .price { font-feature-settings: "frac" 1; }

/* Big italic quote */
.sf-quote { grid-column: span 6; aspect-ratio: 1; background: var(--accent); color: #fff; }
.sf-quote .q { font-style: italic; font-weight: 700; font-size: 8.4vw; line-height: 0.88; letter-spacing: -0.03em; }
.sf-quote .who { font-feature-settings: "smcp" 1, "c2sc" 1; letter-spacing: 0.1em; font-size: 18px; }

/* Editorial page with a drop cap */
.sf-editorial { grid-column: span 6; aspect-ratio: 1; background: #fff; border: 1px solid var(--line); gap: 20px; }
.sf-editorial h3 { font-size: 48px; font-weight: 600; line-height: 0.95; letter-spacing: -0.02em; }
.sf-editorial h3 i { font-weight: 300; }
.sf-editorial .cols { columns: 2; column-gap: 24px; font-size: 15px; line-height: 1.45; text-align: justify; hyphens: auto; }
.sf-editorial .cols p + p { text-indent: 1.5em; }
.sf-editorial .drop::first-letter { float: left; font-size: 5.4em; line-height: 0.8; font-weight: 700; padding: 6px 8px 0 0; color: var(--orange); }
.sf-editorial .kicker { font-feature-settings: "smcp" 1, "c2sc" 1; letter-spacing: 0.1em; font-size: 14px; color: var(--orange); }

@media (prefers-color-scheme: dark) {
  .sf-editorial { background: #fbf6ee; }
}

@media (max-width: 810px) {
  .sf-cover .masthead { font-size: 18vw; }
  .sf-cover .lead { font-size: 9vw; }
  .sf-cover .lines { font-size: 14px; }
  .sf-cover .lines b { font-size: 16px; }
  .sf-amp .pair { font-size: 36vw; }
  .sf-perfume { padding: 64px 16px; }
  .sf-perfume .name { font-size: 14vw; }
  .sf-menu { padding: 24px 16px; }
  .sf-menu h3 { font-size: 40px; }
  .sf-menu li { font-size: 18px; }
  .sf-quote .q { font-size: 17vw; }
  .sf-editorial { aspect-ratio: auto; }
  .sf-editorial .cols { columns: 1; }
}
