:root {
    /* ---- Spacing scale. The only permitted values. ---- */
    --space-3xs: 4px;
    --space-2xs: 8px;
    --space-xs:  12px;
    --space-s:   16px;
    --space-m:   24px;
    --space-l:   32px;
    --space-xl:  48px;
    --space-2xl: 64px;
    --space-3xl: 96px;
    --space-4xl: 144px;

    --section-y: var(--space-2xl);
    --gutter:    var(--space-l);

    /* ---- Type scale ---- */
    --text-xs:  11px;
    --text-s:   13px;
    --text-m:   16.5px;
    --text-l:   20px;
    --text-xl:  clamp(25px, 2.8vw, 31px);
    --text-2xl: clamp(31px, 4.2vw, 46px);
    --text-3xl: clamp(42px, 6.2vw, 76px);

    --track-wide: .26em;
    --track-mid:  .16em;

    /* ---- Colour ---- */
    --navy:      #172B46;
    --cream:     #F8F8F6;
    --surface:   #FFFFFF;
    --teal:      #00B4A6;
    --teal-deep: #07786D;

    --ink:       #172B46;
    --muted:     #5A6B84;
    --line:      #E1E0D9;

    --band-bg:   #172B46;
    --band-fg:   #F3F4F1;
    --band-mute: #A6B4C9;
    --band-line: #2E4463;

    --mark-filter: none;
    --lift: 0 24px 60px -30px rgba(23, 43, 70, .5);

    --measure: 58ch;
    --max: 1160px;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --navy:      #0C1828;
      --cream:     #0C1828;
      --surface:   #142131;
      --teal:      #35CFC0;
      --teal-deep: #5EDCCE;

      --ink:       #EAEEF4;
      --muted:     #93A4BD;
      --line:      #23344B;

      --band-bg:   #08111E;
      --band-fg:   #EAEEF4;
      --band-mute: #93A4BD;
      --band-line: #22354E;

      --mark-filter: brightness(0) invert(0.93);
      --lift: 0 24px 60px -30px rgba(0, 0, 0, .9);
    }
  }

  :root[data-theme="dark"] {
    --navy:      #0C1828;
    --cream:     #0C1828;
    --surface:   #142131;
    --teal:      #35CFC0;
    --teal-deep: #5EDCCE;

    --ink:       #EAEEF4;
    --muted:     #93A4BD;
    --line:      #23344B;

    --band-bg:   #08111E;
    --band-fg:   #EAEEF4;
    --band-mute: #93A4BD;
    --band-line: #22354E;

    --mark-filter: brightness(0) invert(0.93);
    --lift: 0 24px 60px -30px rgba(0, 0, 0, .9);
  }

  @media (max-width: 900px) {
    :root {
      --section-y: var(--space-2xl);
      --gutter: var(--space-m);
    }
  }

  * { box-sizing: border-box; }

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

  html { scroll-behavior: smooth; }

  body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, sans-serif;
    font-size: var(--text-m);
    font-weight: 400;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  h1, h2, h3 {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.005em;
    text-wrap: balance;
    margin: 0;
  }

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

  a { color: var(--teal-deep); text-underline-offset: 3px; }

  .wrap {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  /* The wordmark's wide tracking is the brand's one signature gesture.
     Every label on the page carries it. Nothing else does. */
  .label {
    font-family: "Montserrat", sans-serif;
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: var(--track-wide);
    line-height: 1.6;
    color: var(--muted);
    margin: 0;
  }

  .lede {
    font-family: "Playfair Display", Georgia, serif;
    font-size: var(--text-l);
    font-weight: 400;
    line-height: 1.55;
    color: var(--muted);
  }

  /* ---------- Header ---------- */

  .site-header {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 30;
    background: color-mix(in srgb, var(--cream) 92%, transparent);
    backdrop-filter: blur(14px);
  }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-m);
    padding-block: var(--space-s);
    border-bottom: 1px solid var(--line);
  }

  .brand { display: flex; align-items: center; gap: var(--space-xs); text-decoration: none; min-height: 44px; }
  .brand img { height: 30px; width: auto; filter: var(--mark-filter); }

  .brand span {
    font-family: "Montserrat", sans-serif;
    font-size: 11.5px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: var(--track-wide);
    color: var(--ink);
    padding-top: var(--space-3xs);
  }

  .nav { display: flex; align-items: center; gap: var(--space-l); }

  .nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: var(--space-xs);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: var(--track-mid);
    color: var(--muted);
    text-decoration: none;
    transition: color .2s ease;
  }

  @media (hover: hover) { .nav a:hover { color: var(--ink); } }

  @media (max-width: 720px) {
    .nav .nav-hide { display: none; }
    .brand span { display: none; }
  }

  /* ---------- Links and actions ---------- */

  .action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    font-family: "Montserrat", sans-serif;
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: var(--track-mid);
    text-decoration: none;
    color: var(--ink);
    padding-block: var(--space-2xs);
    border-bottom: 1px solid var(--ink);
    transition: color .25s ease, border-color .25s ease, gap .25s ease;
    position: relative;
  }

  /* The visible rule stays where it is; the tappable area grows behind it to
     44px so a thumb does not have to be precise. */
  .action::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 44px;
    transform: translateY(-50%);
  }

  .action:active { opacity: .6; }

  @media (hover: hover) {
    .action:hover { color: var(--teal-deep); border-color: var(--teal); gap: var(--space-xs); }
  }
  .action .arrow { font-family: Georgia, serif; font-size: 14px; line-height: 1; }

  .action-quiet { color: var(--muted); border-color: var(--line); }
  @media (hover: hover) {
    .action-quiet:hover { color: var(--ink); border-color: var(--ink); }
  }

  .action-invert { color: var(--band-fg); border-color: var(--band-fg); }
  @media (hover: hover) {
    .action-invert:hover { color: var(--teal); border-color: var(--teal); }
  }

  a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: var(--space-3xs);
  }

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

  .hero { padding-block: var(--space-3xl) var(--space-2xl); }

  .hero-grid {
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    gap: var(--space-3xl);
    align-items: center;
  }

  .hero-copy { display: grid; gap: var(--space-l); align-content: start; }

  .hero h1 { font-size: var(--text-3xl); }
  .hero h1 em { font-style: italic; color: var(--teal-deep); }

  .hero .lede { max-width: 38ch; }

  .hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-l); }

  .credentials {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-l);
    padding-top: var(--space-l);
    border-top: 1px solid var(--line);
  }

  .credentials p { display: inline-flex; align-items: center; gap: var(--space-2xs); }

  .credentials p::before {
    content: "";
    width: var(--space-3xs);
    height: var(--space-3xs);
    background: var(--teal);
    transform: rotate(45deg);
    flex: none;
  }

  .hero-book { display: flex; justify-content: center; }

  .hero-book img {
    width: 100%;
    max-width: 300px;
    box-shadow: var(--lift);
  }

  @media (max-width: 900px) {
    .hero { padding-block: var(--space-2xl) var(--space-xl); }
    .hero-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
    /* The 38ch lede suits the two-column hero. Once it stacks it reads as a
       narrow off-centre stripe, so let it breathe. */
    .hero .lede { max-width: 54ch; }
    /* Left-aligned so the cover sits on the same axis as the copy rather
       than floating in symmetrical dead space. */
    .hero-book { justify-content: flex-start; }
    .hero-book img { max-width: 236px; }
  }

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

  .section { padding-block: var(--section-y); scroll-margin-top: var(--space-3xl); }

  .section-intro {
    display: grid;
    gap: var(--space-s);
    max-width: var(--measure);
    margin-bottom: var(--space-xl);
  }

  .section-intro h2 { font-size: var(--text-2xl); }

  @media (max-width: 900px) {
    .section-intro { margin-bottom: var(--space-l); }
  }

  /* ---------- Catalogue ---------- */

  .catalogue { display: grid; }

  .entry {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: var(--space-2xl);
    padding-block: var(--space-xl);
    border-top: 1px solid var(--line);
  }


  .entry-head {
    display: grid;
    gap: var(--space-s);
    align-content: start;
    position: sticky;
    top: var(--space-3xl);
  }
  .entry-head h3 { font-size: var(--text-xl); }

  .entry-sub {
    font-family: "Playfair Display", Georgia, serif;
    font-style: italic;
    font-size: var(--text-m);
    line-height: 1.5;
    color: var(--muted);
  }

  .entry-status { color: var(--teal-deep); }

  .entry-body { display: grid; gap: var(--space-l); align-content: start; }
  .entry-body > p { color: var(--muted); max-width: var(--measure); }

  .contents { display: grid; gap: var(--space-s); margin: 0; }

  .contents > div {
    display: grid;
    grid-template-columns: var(--space-4xl) 1fr;
    gap: var(--space-m);
    align-items: baseline;
    padding-top: var(--space-s);
    border-top: 1px solid var(--line);
    font-size: var(--text-s);
    line-height: 1.65;
    color: var(--muted);
  }

  .contents dt {
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: var(--track-mid);
    color: var(--ink);
    line-height: 1.6;
  }

  .contents dd { margin: 0; }

  .spec {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .spec li {
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: var(--track-mid);
    color: var(--muted);
    padding: var(--space-3xs) var(--space-xs);
    border: 1px solid var(--line);
  }


  .entry-links { display: flex; flex-wrap: wrap; gap: var(--space-l); }

  @media (max-width: 900px) {
    .entry { grid-template-columns: 1fr; gap: var(--space-l); padding-block: var(--space-xl); }
    .entry-head { position: static; }
    .contents > div { grid-template-columns: 1fr; gap: var(--space-3xs); }
  }

  /* ---------- Deck showcase ---------- */

  .deck-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-s);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .deck-grid li { margin: 0; }

  .deck-grid img {
    width: 100%;
    box-shadow: 0 2px 4px rgba(23,43,70,.06), 0 14px 28px -20px rgba(23,43,70,.4);
  }

  .deck-cta { padding-top: var(--space-l); }

  @media (max-width: 900px) {
    .deck-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-xs); }
  }

  @media (max-width: 460px) {
    .deck-grid { grid-template-columns: repeat(2, 1fr); }
  }

  /* ---------- Loose pages ---------- */

  .leaves {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 880px;
    margin-inline: auto;
    padding-block: var(--space-s) var(--space-l);
  }

  .leaf {
    width: 33%;
    flex: none;
    background: #FFFFFF;
    /* Contact shadow plus a wide soft one, so each sheet reads as paper
       resting on the page rather than an image pasted onto it. */
    box-shadow:
      0 1px 2px rgba(23, 43, 70, .14),
      0 10px 18px -12px rgba(23, 43, 70, .30),
      0 30px 54px -34px rgba(23, 43, 70, .45);
    transition: transform .35s ease, box-shadow .35s ease;
  }

  .leaf + .leaf { margin-left: -3%; }

  .leaf:nth-child(1) { transform: rotate(-2.2deg) translateY(var(--space-xs)); z-index: 1; }
  .leaf:nth-child(2) { transform: rotate(0.5deg)  translateY(calc(var(--space-s) * -1)); z-index: 3; }
  .leaf:nth-child(3) { transform: rotate(2deg)    translateY(var(--space-s)); z-index: 2; }

  @media (hover: hover) {
    .leaf:nth-child(1):hover { transform: rotate(-2.2deg) translateY(calc(var(--space-2xs) * -1)); z-index: 4; }
    .leaf:nth-child(2):hover { transform: rotate(0.5deg)  translateY(calc(var(--space-m) * -1)); z-index: 4; }
    .leaf:nth-child(3):hover { transform: rotate(2deg)    translateY(0); z-index: 4; }
  }

  .leaves-caption { text-align: center; }

  /* 5. Three sheets side by side on a phone come out ~117px wide, which is
        too small to read as pages at all. Stack them instead. */
  @media (max-width: 720px) {
    .leaves {
      flex-direction: column;
      align-items: center;
      max-width: none;
      padding-block: var(--space-2xs) var(--space-m);
      gap: var(--space-l);
    }
    .leaf { width: 74%; }
    .leaf + .leaf { margin-left: 0; }
    .leaf:nth-child(1) { transform: rotate(-1.6deg); }
    .leaf:nth-child(2) { transform: rotate(1.1deg); }
    .leaf:nth-child(3) { transform: rotate(-0.7deg); }
    .leaf:hover { transform: none; }
  }

  /* ---------- About ---------- */

  .about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
  }

  .about-body { display: grid; gap: var(--space-m); max-width: var(--measure); }
  .about-body p { color: var(--muted); }
  .about-body strong { color: var(--ink); font-weight: 500; }

  .pull { display: grid; gap: var(--space-m); padding-top: var(--space-2xs); }

  .pull blockquote {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-style: italic;
    font-size: var(--text-xl);
    line-height: 1.4;
    color: var(--ink);
  }

  @media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
  }

  /* ---------- Band ---------- */

  .band {
    scroll-margin-top: var(--space-3xl);
    position: relative;
    isolation: isolate;
    background: var(--band-bg);
    color: var(--band-fg);
    padding-block: var(--space-2xl);
    overflow: hidden;
  }

  .band-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 70% 40%;
    z-index: -2;
  }

  /* Same scrim logic as the book cover: dark at the reading edge,
     letting the image through on the side the subject sits on. */
  .band-scrim {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
      linear-gradient(90deg,
        color-mix(in srgb, var(--band-bg) 96%, transparent) 0%,
        color-mix(in srgb, var(--band-bg) 88%, transparent) 42%,
        color-mix(in srgb, var(--band-bg) 45%, transparent) 100%);
  }

  .band-inner {
    display: grid;
    gap: var(--space-m);
    justify-items: start;
    text-align: left;
    max-width: 44ch;
  }

  .band .label { color: var(--band-mute); }
  .band h2 { font-size: var(--text-2xl); color: var(--band-fg); }
  .band-inner > p { color: var(--band-mute); }

  .signup-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s);
    width: 100%;
    max-width: 440px;
    justify-content: flex-start;
    margin-top: var(--space-2xs);
  }

  .signup-form input {
    flex: 1 1 220px;
    min-width: 0;
    padding: var(--space-xs) 0;
    border: 0;
    border-bottom: 1px solid var(--band-line);
    background: transparent;
    color: var(--band-fg);
    font-family: inherit;
    font-size: var(--text-m);
    transition: border-color .25s ease;
  }

  .signup-form input::placeholder { color: var(--band-mute); }
  .signup-form input:focus { outline: 0; border-bottom-color: var(--teal); }

  .signup-form button {
    background: transparent;
    cursor: pointer;
    border: 0;
    border-bottom: 1px solid var(--band-fg);
  }

  /* The only warm colour on the site. It is here because an error that reads
     as the same teal as a success is not an error state at all. */
  .form-note {
    font-size: var(--text-s);
    line-height: 1.6;
    color: var(--band-fg);
  }
  .form-note:empty { display: none; }
  .form-note[data-tone="ok"]    { color: var(--teal); }
  .form-note[data-tone="error"] { color: #F0A99B; }

  .signup-form button[disabled] { opacity: .5; cursor: default; }
  .signup-form[hidden] { display: none; }
  .fineprint { font-size: var(--text-s); color: var(--band-mute); }

  /* ---------- Footer ---------- */

  .site-footer { padding-block: var(--space-2xl) var(--space-xl); }

  .footer-inner {
    display: grid;
    gap: var(--space-xl);
    justify-items: center;
    text-align: center;
  }

  .footer-inner img { width: 100%; max-width: 240px; filter: var(--mark-filter); }

  .footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-l); justify-content: center; }

  .footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: var(--space-2xs);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: var(--track-mid);
    color: var(--muted);
    text-decoration: none;
    transition: color .2s ease;
  }

  @media (hover: hover) { .footer-links a:hover { color: var(--ink); } }

  .disclaimer {
    padding-top: var(--space-l);
    border-top: 1px solid var(--line);
    font-size: 11.5px;
    line-height: 1.75;
    color: var(--muted);
    max-width: 76ch;
  }

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