/* Monocard landing page: the zone scale.
   Colours are the app's tokens (crates/greycard-slint/ui/theme.slint).
   Unit 8 px (0.5rem). Lines are 1px, never scaled. */

:root {
  --canvas: #0f0f0f;
  --base: #171717;
  --raised: #262626;
  --border: #303030;
  --border-strong: #3d3d3d;
  --text: #ececec;
  --secondary: #a9a9a9;
  --accent: #d8a24a;
  --accent-hover: #e6b866;
  --accent-pressed: #c08f3d;
  --ink: #101010;

  --sans: "Helvetica Neue", Helvetica, "Liberation Sans", Arial, sans-serif;
  --mono: Menlo, Consolas, "DejaVu Sans Mono", monospace;

  --rail: 0rem;
  --strip: 2.75rem;
  --pad: clamp(1rem, 4vw, 2.5rem);
  --gap: 1.5rem;
  --line: var(--border);
  color-scheme: dark;
}

@media (min-width: 64rem) {
  :root {
    --rail: 2.5rem;
    --strip: 0rem;
    --pad: clamp(4.5rem, 6vw, 7rem);
  }
}

@media (min-width: 2200px) {
  html { font-size: 125%; }
}

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

html {
  background: var(--canvas);
  scroll-padding-top: calc(var(--strip) + 0.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 400 1.0625rem/1.625rem var(--sans);
  font-variant-numeric: tabular-nums;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, p, dl, dd, ol, ul, figure, pre, table { margin: 0; padding: 0; }
ol, ul { list-style: none; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: #fff; text-decoration-color: var(--accent); }

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

.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip { position: absolute; left: -999rem; z-index: 30; }
.skip:focus {
  left: var(--rail); top: 0; height: 4rem; min-width: 16rem;
  display: flex; align-items: center;
  padding: 0 1.5rem 0 max(var(--pad), calc((100vw - var(--rail) - 84rem) / 2));
  background: var(--raised);
  outline-offset: -2px;
}

kbd, code, .c-n {
  font-family: var(--mono);
  font-size: 0.8125em;
  font-variant-ligatures: none;
}
kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 0.3125em;
  border: 1px solid var(--border-strong);
  color: var(--text);
  line-height: 1.375;
  text-align: center;
}
.fig { white-space: nowrap; color: var(--text); }

/* Page frame ----------------------------------------------------------- */

.wrap {
  margin-left: var(--rail);
  padding-inline: max(var(--pad), calc((100vw - var(--rail) - 84rem) / 2));
}

.top { background: var(--canvas); }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.625rem;
  font-weight: 500; text-decoration: none; letter-spacing: -0.005em;
}
.brand img { width: 1.75rem; height: 1.75rem; }
.top-link { font-size: 0.875rem; line-height: 1.25rem; color: var(--secondary); }

/* The step wedge ------------------------------------------------------- */

.rail {
  position: sticky; top: 0; z-index: 20;
  background: var(--canvas);
  padding-bottom: 3px;
}
.rail ol { display: grid; grid-template-columns: repeat(11, 1fr); height: var(--strip); }
.rail li { display: grid; }
.rail a {
  position: relative;
  display: grid; place-items: center;
  background: var(--z);
  color: #fff;
  font: 0.6875rem/1 var(--sans);
  text-decoration: none;
}
.rail a.lt { color: #000; }
.rail a:focus-visible { outline-offset: -2px; box-shadow: inset 0 0 0 4px var(--ink); z-index: 1; }
.rail .t {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.rail a[aria-current]::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 3px;
  background: var(--accent);
}
/* In the first view the download button is the one amber mark. */
.rail li:first-child a[aria-current]::after { background: var(--text); }

@media (min-width: 64rem) {
  .rail {
    position: fixed; inset: 0 auto 0 0; width: var(--rail);
    padding: 0;
  }
  .rail ol { grid-template-columns: none; grid-template-rows: repeat(11, 1fr); height: 100%; }
  .rail a[aria-current]::after { left: 100%; right: auto; top: 0; bottom: 0; width: 3px; height: auto; }
  .rail a:hover .t, .rail a:focus-visible .t {
    width: auto; height: auto; overflow: visible; clip-path: none;
    left: calc(100% + 0.75rem); top: 50%; translate: 0 -50%;
    padding: 0.375rem 0.625rem;
    background: var(--raised); border: 1px solid var(--border-strong);
    color: var(--text); font: 0.875rem/1.25rem var(--sans);
  }
}

/* Sections ------------------------------------------------------------- */

.zone, .off {
  background: var(--g, var(--canvas));
  padding-block: clamp(3.5rem, 7vw, 6rem);
}
.zone.hi { --line: var(--border-strong); }
.hero { padding-top: clamp(1rem, 3vw, 2.5rem); }

h1, h2 { font-weight: 500; text-wrap: balance; }
h1 {
  font-size: clamp(2.5rem, 1.1rem + 5.4vw, 5.0625rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-left: -0.02em; /* optical: the T's arm starts inside its box */
}
h2 {
  --h2: clamp(1.75rem, 1.3rem + 1.5vw, 2.5625rem);
  font-size: var(--h2);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
p { text-wrap: pretty; }

.num {
  display: inline-block;
  padding-right: 0.75rem;
  color: var(--secondary);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}
@media (min-width: 64rem) {
  .num {
    width: 4rem; margin-left: -4rem; padding-right: 1.25rem;
    text-align: right;
  }
}

.head { display: grid; gap: 2rem var(--gap); }
.head-main > p { margin-top: 1rem; max-width: 34rem; font-size: 1.1875rem; line-height: 1.75rem; }
@media (min-width: 44rem) {
  .head-main > p { margin-top: 1.25rem; font-size: 1.3125rem; line-height: 1.875rem; }
}
.head-side { max-width: 30rem; color: var(--secondary); }

@media (min-width: 72rem) {
  .head { grid-template-columns: repeat(12, 1fr); align-items: start; }
  .head-main { grid-column: 1 / span 6; }
  .head > :nth-child(2) { grid-column: 8 / -1; }
  /* The note's first line sits on the lead's first baseline: heading, gap, and 3 px for the smaller size. */
  .head > .head-side { margin-top: calc(clamp(1.75rem, 1.3rem + 1.5vw, 2.5625rem) * 1.1 + 1.25rem + 0.1875rem); }
}

/* Lists of controls */
.spec { border-bottom: 1px solid var(--line); }
.spec > div {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 0 1rem;
  padding-block: 0.6875rem 0.75rem;
  border-top: 1px solid var(--line);
}
.spec dt { font-weight: 500; }
.spec dd { color: var(--secondary); }
.spec .limit dt { font-weight: 400; color: var(--secondary); }
.head-main > .spec { margin-top: 2.5rem; max-width: 34rem; }
@media (max-width: 26rem) {
  .spec > div { grid-template-columns: 1fr; }
}
@media (min-width: 72rem) and (max-width: 89.99rem) {
  .spec > div { grid-template-columns: 7.5rem 1fr; }
}

/* Screenshots ---------------------------------------------------------- */

.frame {
  position: relative;
  aspect-ratio: var(--ar);
  background: var(--raised);
  overflow: hidden;
}
.frame picture { display: contents; }
.frame img { width: 100%; height: 100%; object-fit: cover; }
/* On a phone a whole window is too small to read: show part of it, larger. */
@media (max-width: 40rem) {
  .frame.app { aspect-ratio: 4 / 3; }
  .frame.app img { object-position: var(--pos, 50% 50%); }
}
.shot .frame { outline: 1px solid var(--border-strong); outline-offset: -1px; }
.wrap > .shot, .wrap > .compare, .wrap > .strip, .wrap > .pair, .wrap > .prints, .wrap > .looks { margin-top: 3rem; }
.wrap > .shot + .shot, .wrap > .compare + .shot { margin-top: 4rem; }

figcaption, .cap {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 0.75rem;
  color: var(--secondary);
  font-size: 0.875rem; line-height: 1.25rem;
}

/* Hero ----------------------------------------------------------------- */

.hero-head { display: grid; gap: 1.75rem var(--gap); }
.hero-side p { max-width: 30rem; }
.hero-act { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.5rem; }
.note { color: var(--secondary); font-size: 0.875rem; line-height: 1.25rem; }
.hero .shot { margin-top: clamp(2rem, 4vw, 3.5rem); }

@media (min-width: 72rem) {
  .hero-head { grid-template-columns: repeat(12, 1fr); align-items: end; align-items: last baseline; }
  .hero-head h1 { grid-column: 1 / span 8; }
  .hero-side { grid-column: 9 / -1; }
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem 0.5625rem;
  border: 1px solid var(--secondary);
  color: var(--text);
  font-weight: 500; font-size: 0.9375rem; line-height: 1.25rem;
  text-decoration: none;
}
.logos { position: absolute; }
.os { width: 1.125em; height: 1.125em; margin-right: 0.5em; vertical-align: -0.1875em; fill: currentColor; }
.btn:hover { border-color: var(--accent); color: #fff; }
.btn-main { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-main:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--ink); }
.btn-main:active { background: var(--accent-pressed); border-color: var(--accent-pressed); }
.btn-main:focus-visible { outline-color: var(--text); }

.facts { display: grid; gap: 0 var(--gap); margin-top: 3rem; border-top: 1px solid var(--line); }
.facts > div { padding-block: 0.875rem 1rem; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 500; }
.facts dd { color: var(--secondary); max-width: 24rem; }
@media (min-width: 44rem) {
  .facts { grid-template-columns: repeat(3, 1fr); }
  .facts > div { border-bottom: 0; }
}

/* The split ------------------------------------------------------------ */

.compare { --split: 30%; }
.compare-frame { outline: 1px solid var(--border-strong); outline-offset: -1px; }
.compare-frame img { position: absolute; inset: 0; }
.compare-over { clip-path: inset(0 0 0 var(--split)); }
.compare-line {
  position: absolute; top: 0; bottom: 0; left: var(--split);
  width: 1px; margin-left: -0.5px;
  background: var(--accent);
  pointer-events: none;
}
/* The grip: a 44 px target on the line. Only it takes the pointer, so a swipe on the picture scrolls. */
.compare-grip { display: none; }
.js .compare-grip {
  display: block;
  position: absolute; left: -22px; top: 0; bottom: 0; width: 44px;
  pointer-events: auto; touch-action: none; cursor: ew-resize;
}
.js .compare-grip::after {
  content: ""; position: absolute; top: 50%; left: 18px;
  width: 9px; height: 3rem; margin-top: -1.5rem;
  background: var(--accent);
}
@media (hover: none) {
  .js .compare-grip { top: 50%; bottom: auto; height: 5.5rem; margin-top: -2.75rem; }
}
.if-touch { display: none; }
@media (hover: none) {
  .if-fine { display: none; }
  .if-touch { display: inline; }
}
.compare-tag {
  position: absolute; bottom: 0.75rem;
  padding: 0.125rem 0.5rem;
  background: var(--ink); color: var(--text);
  font-size: 0.875rem; line-height: 1.25rem;
  pointer-events: none;
}
.compare-tag-l { left: 0.75rem; }
.compare-tag-r { right: 0.75rem; }

.compare-range { display: none; }
.js .compare-range {
  display: block;
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0; border-radius: 0;
  appearance: none; -webkit-appearance: none;
  background: transparent;
  pointer-events: none; /* the keyboard's control; the pointer uses the grip */
}
.compare-range::-webkit-slider-runnable-track { height: 100%; background: transparent; border: 0; }
.compare-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 1px; height: 100%; border: 0; background: transparent; }
.compare-range::-moz-range-track { height: 100%; background: transparent; border: 0; }
.compare-range::-moz-range-thumb { width: 1px; height: 100%; border: 0; border-radius: 0; background: transparent; }
.compare-range:focus-visible { outline: none; }
.compare-frame:has(.compare-range:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
html:not(.js) .js-only { display: none; }

/* The legend: the app's own, with its numbers */
.legend {
  width: 100%; margin-top: 0.75rem;
  border-collapse: collapse; table-layout: fixed;
  font: 0.875rem/1.25rem var(--mono);
  color: var(--secondary);
  text-align: center;
}
.legend th { width: 3.5rem; font: 0.875rem/1.25rem var(--sans); font-weight: 400; text-align: left; }
.legend td { padding: 0.25rem 0 0; }
.legend-zone td { height: 2rem; padding: 0; background: var(--z); color: #fff; font-family: var(--sans); }
.legend-zone td.lt { color: #000; }
@media (max-width: 34rem) {
  .legend { font-size: 0.6875rem; }
  .legend th { width: 2.5rem; font-size: 0.6875rem; }
}

/* The test strip ------------------------------------------------------- */

.strip-frame { outline: 1px solid var(--border-strong); outline-offset: -1px; }
.strip-key {
  display: grid; grid-template-columns: repeat(11, 1fr);
  margin-top: 0.5rem;
  color: var(--secondary); font: 0.875rem/1.25rem var(--mono); text-align: center;
}
.strip-key b { display: block; font-weight: 400; }
.strip-key span { display: none; font-family: var(--sans); color: var(--text); white-space: nowrap; }
@media (min-width: 72rem) {
  .strip-key span { display: block; }
}

.looks { display: grid; gap: 3rem var(--gap); }
@media (min-width: 56rem) {
  .looks { grid-template-columns: repeat(12, 1fr); align-items: start; }
  .looks .tbl { grid-column: 1 / span 7; }
  .looks .shot-panel { grid-column: 9 / -1; }
}

.tbl { width: 100%; border-collapse: collapse; text-align: left; }
.tbl th, .tbl td { padding: 0.6875rem 1rem 0.75rem 0; border-top: 1px solid var(--line); vertical-align: baseline; }
.tbl thead th { border-top: 0; padding-block: 0 0.5rem; color: var(--secondary); font-weight: 400; font-size: 0.875rem; line-height: 1.25rem; }
.tbl tbody th { font-weight: 500; white-space: nowrap; }
.tbl tbody td { color: var(--secondary); }
.tbl tbody tr:last-child > * { border-bottom: 1px solid var(--line); }
.tbl tfoot td { border-top: 0; padding-top: 0.75rem; color: var(--secondary); font-size: 0.875rem; line-height: 1.25rem; }
.tbl .c-n { width: 3.5rem; text-align: right; padding-right: 1.5rem; color: var(--secondary); }
.tbl thead .c-n { font-family: var(--sans); font-size: 0.875rem; }
.tbl-modes th { width: 11rem; }

.shot-panel .frame, .shot-panel figcaption { max-width: 22.5rem; }
.shot-sheet .frame { max-width: 35.875rem; }
.head-main > .tbl { margin-top: 2.5rem; max-width: 34rem; }

/* Tone and Camera modes: text beside the figure */
@media (min-width: 72rem) {
  .head-fig > .shot-panel { grid-column: 9 / -1; }
  .head-fig > .shot-sheet { grid-column: 8 / -1; }
  .head-fig > .panels { grid-column: 7 / -1; }
}
@media (max-width: 71.99rem) {
  .panels { max-width: 46.5rem; }
}
/* Under 56rem the settings sheet is cut to its table, at the size the app draws it. */
@media (max-width: 55.99rem) {
  .shot-sheet .frame { aspect-ratio: 820 / 1010; max-width: 25.625rem; }
  .shot-sheet .frame img {
    position: absolute; max-width: none; object-fit: fill;
    width: calc(1148 / 820 * 100%); height: auto;
    left: calc(-312 / 820 * 100%); top: calc(-24 / 1010 * 100%);
  }
}
/* Tone: the two panels, side by side */
.panels { display: grid; gap: 2rem var(--gap); align-items: start; }
@media (min-width: 30rem) {
  .panels { grid-template-columns: 1fr 1fr; }
}

/* Camera window and library */
.pair { display: grid; gap: 3rem var(--gap); align-items: end; }
@media (min-width: 56rem) {
  .pair { grid-template-columns: repeat(12, 1fr); }
  .pair > :first-child { grid-column: 1 / span 7; }
  .pair > :last-child { grid-column: 8 / -1; }
  /* The library is cut to its grid and drawn at the height of the camera window. */
  .shot-lib .frame { aspect-ratio: 9 / 8; }
  .shot-lib .frame img { object-position: 45% 0; }
}

/* Prints: equal heights, widths by ratio */
.prints { display: flex; flex-direction: column; gap: var(--gap); }
.prints-row { display: flex; gap: var(--gap); }
.prints figure { flex: var(--ar) 1 0; min-width: 0; }
.prints .frame { aspect-ratio: var(--ar); }

/* Off the scale -------------------------------------------------------- */

.off { --line: var(--border); border-top: 1px solid var(--border); }
.off-grid { display: grid; gap: 3.5rem var(--gap); }
.off-grid > * { min-width: 0; }
.off h2 { font-size: 1.3125rem; line-height: 1.875rem; letter-spacing: -0.01em; margin-bottom: 1.25rem; }
.plain li { padding-block: 0.6875rem 0.75rem; border-top: 1px solid var(--line); color: var(--secondary); max-width: 36rem; }
.plain li:last-child { border-bottom: 1px solid var(--line); }
.off-build p { max-width: 30rem; color: var(--secondary); }
.off-build p:last-child { margin-top: 1.5rem; }
.off-build .off-act { margin: 0 0 1.75rem; max-width: none; }
.off-others { max-width: 36rem; }
.off-others + .off-new { margin: 1rem 0 3rem; }
@media (min-width: 56rem) {
  .off-grid { grid-template-columns: repeat(12, 1fr); }
  .off-limits { grid-column: 1 / span 5; }
  .off-build { grid-column: 7 / -1; }
}

.foot { background: var(--canvas); border-top: 1px solid var(--border); padding-block: 2.5rem 4rem; }
.foot-grid { display: grid; gap: 1rem var(--gap); color: var(--secondary); font-size: 0.875rem; line-height: 1.375rem; }
@media (min-width: 56rem) {
  .foot-grid { grid-template-columns: repeat(3, 1fr); }
  .foot-grid p { max-width: 24rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, a { transition: color 120ms, border-color 120ms; }
}

