/* ══════════════════════════════════════════════════════════
   HubiForm
   Set as a printed leaf: hairline rules, an asymmetric book
   grid, and ink on stock. No cards, no shadows, no radii.
   ══════════════════════════════════════════════════════════ */

:root {
  --stock:   #fbfaf7;   /* book stock, barely warm */
  --ink:     #171a21;   /* navy-black, drawn from the wordmark */
  --ink-2:   #4a4f5a;
  --ink-3:   #8f8f8c;
  --rule:    #dfdcd5;
  --rule-2:  #ebe8e1;
  --maroon:  #7f1d2b;   /* spent three times on the whole page */

  --measure: 62ch;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

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

body {
  margin: 0;
  background: var(--stock);
  color: var(--ink);
  font-family: 'Jost', system-ui, sans-serif;
  font-weight: 300;
  font-size: 1.02rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Sections take focus when scrolled to so keyboard users keep
   their place, but shouldn't show a ring for it. */
section:focus, main:focus { outline: none; }

.leaf {
  width: 100%;
  max-width: 1060px;
  margin-inline: auto;
  padding-inline: clamp(22px, 6vw, 60px);
}

/* Hairline rules do all the dividing */
.rule {
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

/* ─────────── Masthead ─────────── */

.masthead { padding-block: clamp(26px, 4vw, 40px) clamp(20px, 3vw, 28px); }
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: clamp(18px, 2.4vw, 24px);
  border-bottom: 1px solid var(--rule);
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-word {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.68rem;
  font-weight: 500;
  letter-spacing: -0.006em;
}
.brand-sm { gap: 9px; }
.brand-sm .brand-word { font-size: 1.06rem; }
.brand-a { color: var(--maroon); }          /* maroon — 1 of 3 */
.brand-b { color: var(--ink); }

.masthead-note {
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ─────────── Opening ─────────── */

.opening { padding-block: clamp(58px, 9vw, 118px) clamp(56px, 8vw, 104px); }

.kicker {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: clamp(26px, 3.4vw, 40px);
}

.title {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.7rem, 7vw, 5.15rem);
  line-height: 1.04;
  letter-spacing: -0.021em;
  margin: 0;
  max-width: 17ch;
  text-wrap: balance;
}
.title em { font-style: italic; color: var(--maroon); }   /* maroon — 2 of 3 */

.opening-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(28px, 4vw, 56px);
  margin-top: clamp(38px, 4.6vw, 60px);
  max-width: 900px;
}
.standfirst {
  font-size: clamp(1rem, 1.15vw, 1.09rem);
  color: var(--ink-2);
  max-width: 54ch;
}

/* The action: a ruled rectangle, not a filled pill */
.action {
  display: inline-block;
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 15px 30px;
  border: 1px solid var(--ink);
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: color .35s var(--ease), background-color .35s var(--ease);
}
.action:hover, .action:focus-visible { background: var(--ink); color: var(--stock); }
.action:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.action-btn { font-family: 'Jost', sans-serif; }
.action[disabled] { opacity: .45; cursor: default; }

/* ─────────── Chapters (book grid) ─────────── */

.chapter { padding-block: clamp(62px, 8vw, 108px); }

.spread {
  display: grid;
  grid-template-columns: 132px minmax(0, var(--measure));
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.margin-col { padding-top: .5rem; }
.folio {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: .06em;
}
.margin-label {
  margin-top: 6px;
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.chapter-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 0;
  max-width: 22ch;
  text-wrap: balance;
}
.chapter-title em { font-style: italic; color: var(--ink-2); }
.chapter-lede {
  margin-top: 18px;
  color: var(--ink-2);
  max-width: 52ch;
}

/* ─────────── Entries ─────────── */

.entries {
  list-style: none;
  margin: clamp(34px, 4vw, 52px) 0 0;
  padding: 0;
}
.entry {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 4px 18px;
  padding-block: clamp(24px, 2.6vw, 32px);
  border-top: 1px solid var(--rule-2);
}
.entry:first-child { border-top: 0; padding-top: 0; }

.entry-num {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.02rem;
  font-style: italic;
  color: var(--ink-3);
  line-height: 1.55;
}
.entry h3 {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 1.32rem;
  line-height: 1.3;
  margin: 0 0 7px;
  letter-spacing: -0.006em;
}
.entry p { color: var(--ink-2); font-size: .99rem; max-width: 50ch; }

/* ─────────── Enquiry ─────────── */

.enquiry { margin-top: clamp(34px, 4vw, 48px); }

.line { margin-bottom: 28px; }
.line label {
  display: block;
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 9px;
}

/* Fields are ruled, not boxed */
.line input,
.line textarea {
  width: 100%;
  font: inherit;
  font-size: 1.02rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 6px 0 10px;
  resize: vertical;
  transition: border-color .3s var(--ease);
}
.line input::placeholder,
.line textarea::placeholder { color: #b9b7b0; }
.line input:focus,
.line textarea:focus {
  outline: none;
  border-bottom-color: var(--maroon);   /* maroon — 3 of 3 */
}

.enquiry-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 26px;
  margin-top: 34px;
}
.aside { font-size: 0.82rem; color: var(--ink-3); }
.form-status { min-height: 1.4em; margin-top: 16px; font-size: .88rem; color: var(--ink-2); }
.form-status.err { color: var(--maroon); }

/* ─────────── Colophon ─────────── */

.colophon { padding-block: clamp(30px, 4vw, 44px) clamp(36px, 5vw, 56px); }
.colophon-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 26px;
  padding-top: clamp(22px, 3vw, 30px);
  border-top: 1px solid var(--rule);
}
.colophon-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--ink-3);
  letter-spacing: .01em;
}
.sep { color: var(--rule); }

/* ─────────── Motion ─────────── */
/* Visible by default; the `js` class is what hides, so a failed
   script leaves the page readable rather than blank.           */

.js .rise { opacity: 0; transform: translateY(9px); }
.js .rise.in {
  opacity: 1;
  transform: none;
  transition: opacity 1s var(--ease) var(--d, 0ms), transform 1s var(--ease) var(--d, 0ms);
}

.js .entry { opacity: 0; transform: translateY(9px); }
.js .entry.in {
  opacity: 1;
  transform: none;
  transition: opacity .9s var(--ease) var(--d, 0ms), transform .9s var(--ease) var(--d, 0ms);
}

/* Rules draw themselves in */
.js .rule-draw { transform: scaleX(0); transform-origin: left; }
.js .rule-draw.in { transform: scaleX(1); transition: transform 1.3s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .js .rise, .js .entry { opacity: 1 !important; transform: none !important; }
  .js .rule-draw { transform: none !important; }
}

/* ─────────── Narrower leaves ─────────── */

@media (max-width: 860px) {
  .spread { grid-template-columns: 1fr; gap: 20px; }
  .margin-col {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding-top: 0;
  }
  .margin-label { margin-top: 0; }
  .opening-foot { grid-template-columns: 1fr; align-items: start; gap: 32px; }
  .action { display: inline-block; }
}

@media (max-width: 560px) {
  body { font-size: .99rem; }
  .masthead-note { display: none; }
  .title { max-width: none; }
  .entry { grid-template-columns: 32px minmax(0, 1fr); gap: 2px 12px; }
  .colophon-inner { flex-direction: column; align-items: flex-start; }
  .colophon-line { flex-wrap: wrap; gap: 4px 10px; }
  .sep { display: none; }
  .enquiry-foot { flex-direction: column; align-items: flex-start; }
  .action { width: 100%; text-align: center; }
}
