/* ArcIndex -- "New Form" editorial broadsheet.
 *
 * A printed financial broadsheet rebuilt for the web: the page is
 * overwhelmingly typographic, the canvas is warm bone white rather than pure
 * white, and one saturated green acts as a highlighter pen over an otherwise
 * monochrome sheet. Structure comes from type, spacing and hairlines --
 * elevation exists only on the green button, and nowhere else.
 *
 * Faces. The system asks for TWK Lausanne, PP Mondwest and Editorial New, none
 * of which are licensed here, so the two Fontshare faces already in the repo
 * stand in on the substitution the spec allows: Switzer Variable carries the
 * grotesque role (it reaches 200/350/400/550, which the micro-labels and
 * display sizes all need), Gambarino carries the display serif, and the system
 * Times handles the editorial italic. The tokens keep the original names so
 * the mapping stays legible. */

@font-face {
  font-family: "Switzer";
  src: url("/fonts/Switzer-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gambarino";
  src: url("/fonts/Gambarino-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colours */
  --color-bone-white: #fafffa;
  --color-press-black: #121613;
  --color-typesetter-ink: #000000;
  --color-slate-verdant: #232924;
  --color-newsprint-gray: #516254;
  --color-muted-sage: #c8d2c8;
  --color-highlighter-green: #2bee4b;
  --color-shadow-moss: #93b799;
  --color-echo-green: #c4e4c9;

  /* Faces */
  --font-twk-lausanne: "Switzer", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-pp-mondwest: "Gambarino", "Iowan Old Style", Georgia, serif;
  --font-times: Times, "Times New Roman", serif;

  /* Scale. The spec's values are the ceiling; each one clamps down so the
   * broadsheet survives a phone without a horizontal scrollbar. */
  --text-caption: 11px;
  --text-body-sm: 14px;
  --text-body: 18px;
  --text-subheading: clamp(34px, 5vw, 60px);
  --text-heading-sm: clamp(38px, 6vw, 72px);
  --text-heading: clamp(42px, 7.4vw, 96px);
  --text-heading-lg: clamp(46px, 10.4vw, 155px);
  --text-display: clamp(120px, 26vw, 295px);

  --font-weight-extralight: 200;
  --font-weight-light: 300;
  --font-weight-w350: 350;
  --font-weight-regular: 400;
  --font-weight-w550: 550;

  /* Spacing */
  --spacing-10: 10px;
  --spacing-15: 15px;
  --spacing-20: 20px;
  --spacing-30: 30px;
  --spacing-40: 40px;
  --spacing-50: 50px;
  --spacing-60: 60px;
  --spacing-120: 120px;
  --spacing-190: 190px;

  /* Layout */
  --page-max-width: 1400px;
  --section-gap: 80px;
  --element-gap: 20px;
  --page-pad: clamp(20px, 4vw, 50px);

  /* Radii */
  --radius-pills: 10px;
  --radius-images: 14px;
  --radius-buttons: 5px;

  /* Elevation -- the accent only */
  --shadow-lg: rgba(16, 94, 29, 0.45) 1px 8px 20px 0px;

  /* Surfaces */
  --surface-canvas: #fafffa;
  --surface-dark-section: #121613;
  --surface-accent-band: #2bee4b;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--surface-canvas);
  color: var(--color-typesetter-ink);
  font-family: var(--font-twk-lausanne);
  font-weight: var(--font-weight-regular);
  font-size: var(--text-body);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ------------------------------------------------------------------ *
 * Micro-typography -- the chrome of the whole page
 * ------------------------------------------------------------------ */

/* 11px / 550 uppercase. Every nav item, button label and field label is set
 * from this one rule; there is no other UI furniture on the page. */
.micro,
.btn-green,
.nav-links a,
.tag {
  font-family: var(--font-twk-lausanne);
  font-size: var(--text-caption);
  font-weight: var(--font-weight-w550);
  line-height: 1.1;
  letter-spacing: 0.11px;
  text-transform: uppercase;
}

/* Category tags sit a step larger and lighter -- a tinted label, no chip. */
.tag {
  font-size: var(--text-body-sm);
  font-weight: var(--font-weight-w350);
  letter-spacing: 0.14px;
  color: var(--color-newsprint-gray);
  margin: 0 0 var(--spacing-30);
  display: block;
}

.tag-inverse {
  color: var(--color-muted-sage);
}

/* ------------------------------------------------------------------ *
 * Display type
 * ------------------------------------------------------------------ */

.hero-head {
  margin: 0 0 var(--spacing-60);
  font-size: var(--text-heading-lg);
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-weight: var(--font-weight-regular);
}

/* Each line is its own block so the serif and the grotesque alternate down
 * the wall at one physical size. That contrast is the whole voice. */
.line {
  display: block;
}

.serif {
  font-family: var(--font-pp-mondwest);
  font-weight: var(--font-weight-regular);
}

.grot {
  font-family: var(--font-twk-lausanne);
  font-weight: var(--font-weight-w550);
}

.head-grot,
.head-serif {
  margin: 0 0 var(--spacing-40);
  font-size: var(--text-heading);
  line-height: 1;
  letter-spacing: -0.02em;
}

.head-grot {
  font-family: var(--font-twk-lausanne);
  font-weight: var(--font-weight-w550);
}

.head-serif {
  font-family: var(--font-pp-mondwest);
  font-weight: var(--font-weight-regular);
  letter-spacing: -0.04em;
}

.head-inverse {
  color: var(--color-bone-white);
}

.lede {
  font-size: var(--text-body);
  font-weight: var(--font-weight-extralight);
  line-height: 1.35;
  letter-spacing: -0.36px;
  color: var(--color-typesetter-ink);
  max-width: 46ch;
  margin: 0;
}

.lede-inverse {
  color: var(--color-bone-white);
  margin-bottom: var(--spacing-60);
}

/* ------------------------------------------------------------------ *
 * Buttons and links
 * ------------------------------------------------------------------ */

/* The only filled, saturated element on the site. The shadow is green so the
 * elevation belongs to the accent rather than reading as generic grey UI. */
.btn-green {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-10);
  padding: var(--spacing-20) var(--spacing-30);
  background: var(--color-highlighter-green);
  color: var(--color-typesetter-ink);
  border: 0;
  border-radius: var(--radius-buttons);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-green:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: rgba(16, 94, 29, 0.55) 1px 10px 24px 0px;
}

.btn-green:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.btn-arrow {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--color-typesetter-ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: var(--spacing-10);
}

/* Underline is the only structural treatment -- links never change weight
 * or colour. */
.link {
  font-family: var(--font-times);
  font-size: 16px;
  font-weight: var(--font-weight-regular);
  line-height: 1.2;
  color: var(--color-typesetter-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--color-typesetter-ink);
  padding-bottom: 1px;
  text-transform: none;
  letter-spacing: 0;
}

.link-inverse {
  color: var(--color-bone-white);
  border-bottom-color: var(--color-bone-white);
  display: inline-block;
  margin-bottom: var(--spacing-10);
}

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

/* ------------------------------------------------------------------ *
 * Masthead
 * ------------------------------------------------------------------ */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--spacing-40);
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: var(--spacing-20) var(--page-pad);
  background: var(--surface-canvas);
}

.wordmark {
  margin-right: auto;
  font-family: var(--font-twk-lausanne);
  font-weight: var(--font-weight-w550);
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--color-typesetter-ink);
  text-decoration: none;
}

/* The green rule under "Arc" is the entire logo. */
.wordmark-stem {
  border-bottom: 3px solid var(--color-highlighter-green);
  padding-bottom: 2px;
}

.nav-links {
  display: flex;
  gap: var(--spacing-30);
}

.nav-links a {
  color: var(--color-typesetter-ink);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover {
  border-bottom-color: var(--color-highlighter-green);
}

/* ------------------------------------------------------------------ *
 * Page rhythm
 * ------------------------------------------------------------------ */

main {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.hero {
  padding: var(--spacing-60) 0 var(--section-gap);
}

.hero .micro {
  color: var(--color-newsprint-gray);
  margin: 0 0 var(--spacing-40);
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--spacing-40);
  margin-bottom: var(--spacing-120);
}

.actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-30);
}

/* Stat callouts: the muted newsprint colour is what makes these read as
 * editorial data rather than hero numbers. */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--spacing-40) var(--spacing-20);
  margin: 0;
  padding-top: var(--spacing-40);
  border-top: 1px solid var(--color-typesetter-ink);
}

.stat .tag {
  margin-bottom: var(--spacing-20);
}

.figure {
  margin: 0;
  font-family: var(--font-twk-lausanne);
  font-weight: var(--font-weight-w550);
  font-size: var(--text-heading-sm);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-newsprint-gray);
}

/* The year is a date, not a metric -- it gets the subheading size so it does
 * not pretend to be a figure. */
.figure-sm {
  font-size: var(--text-subheading);
  font-family: var(--font-pp-mondwest);
  font-weight: var(--font-weight-regular);
  letter-spacing: -0.04em;
}

.band {
  padding: var(--section-gap) 0;
}

.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-30) var(--spacing-60);
  max-width: 1000px;
  font-size: var(--text-body);
  font-weight: var(--font-weight-extralight);
  line-height: 1.35;
  letter-spacing: -0.36px;
}

.cols p {
  margin: 0;
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--spacing-60) var(--spacing-40);
  margin: 0;
  padding: var(--spacing-40) 0 0;
  border-top: 1px solid var(--color-typesetter-ink);
}

.steps h3 {
  font-family: var(--font-pp-mondwest);
  font-weight: var(--font-weight-regular);
  font-size: var(--text-subheading);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin: var(--spacing-20) 0 var(--spacing-20);
}

.steps p {
  margin: 0;
  font-size: 16px;
  font-weight: var(--font-weight-extralight);
  line-height: 1.35;
  letter-spacing: -0.3px;
}

/* ------------------------------------------------------------------ *
 * Dark editorial break
 * ------------------------------------------------------------------ */

/* Full width, so it has to break out of main's max-width column. */
.dark {
  background: var(--surface-dark-section);
  margin: var(--section-gap) calc(50% - 50vw);
  padding: var(--spacing-120) 0;
}

.dark-inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

/* Ghost buttons on the dark surface. The tall vertical padding is what makes
 * these read as full-height menu items rather than compact controls. */
.ghosts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--element-gap);
  margin: 0;
  padding: 0;
}

/* The label stays at micro size; the statement itself is body copy, because
 * 11px uppercase is a nav item, not a sentence. The tall padding still does
 * the work of making the box read as a full-height menu item. */
.ghost {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--spacing-40);
  padding: var(--spacing-50) var(--spacing-20);
  min-height: 240px;
  background: transparent;
  border: 1px solid var(--color-bone-white);
  border-radius: var(--radius-pills);
  color: var(--color-bone-white);
}

.ghost .micro {
  color: var(--color-muted-sage);
}

.ghost p {
  margin: 0;
  text-transform: none;
  font-size: var(--text-body);
  font-weight: var(--font-weight-extralight);
  line-height: 1.35;
  letter-spacing: -0.36px;
}

/* ------------------------------------------------------------------ *
 * Catalogs
 * ------------------------------------------------------------------ */

.catalog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-typesetter-ink);
}

.catalog-list li {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-20);
  padding: var(--spacing-30) 0;
  border-bottom: 1px solid var(--color-slate-verdant);
}

.catalog-name {
  margin-right: auto;
  font-family: var(--font-pp-mondwest);
  font-weight: var(--font-weight-regular);
  font-size: var(--text-subheading);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.catalog-short,
.catalog-year {
  font-family: var(--font-twk-lausanne);
  font-size: var(--text-body-sm);
  font-weight: var(--font-weight-w350);
  letter-spacing: 0.14px;
  text-transform: uppercase;
  color: var(--color-muted-sage);
  white-space: nowrap;
}

.close-head {
  margin-bottom: var(--spacing-60);
}

.close .hero-foot {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ *
 * Footer, then the signature band
 * ------------------------------------------------------------------ */

.foot {
  background: var(--surface-dark-section);
  color: var(--color-bone-white);
  padding: var(--spacing-120) var(--page-pad) var(--spacing-60);
}

.foot-inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--spacing-40);
}

.foot-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.foot-body {
  margin: 0;
  font-size: var(--text-body);
  font-weight: var(--font-weight-extralight);
  line-height: 1.35;
  letter-spacing: -0.36px;
  max-width: 34ch;
}

.foot-note {
  max-width: var(--page-max-width);
  margin: var(--spacing-120) auto 0;
  font-size: var(--text-caption);
  font-weight: var(--font-weight-w550);
  letter-spacing: 0.11px;
  text-transform: uppercase;
  color: var(--color-muted-sage);
}

/* Edge to edge, and the last thing on the page. */
.band-accent {
  background: var(--surface-accent-band);
  height: clamp(280px, 45vw, 640px);
  padding: var(--spacing-50);
}

.band-accent span {
  font-family: var(--font-pp-mondwest);
  font-weight: var(--font-weight-regular);
  font-size: var(--text-display);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--color-bone-white);
  display: block;
}

/* ------------------------------------------------------------------ *
 * Sign in
 * ------------------------------------------------------------------ */

.gate[hidden] {
  display: none;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: var(--spacing-20);
}

.gate-scrim {
  position: absolute;
  inset: 0;
  background: rgba(18, 22, 19, 0.82);
}

/* The card stays on the light canvas -- it is the one place the reader has to
 * type, so it gets paper rather than the dark section. Flat, hairline border,
 * no shadow: elevation belongs to the green button inside it. */
.gate-card {
  position: relative;
  width: min(440px, 100%);
  padding: var(--spacing-50) var(--spacing-40) var(--spacing-40);
  background: var(--surface-canvas);
  border: 1px solid var(--color-typesetter-ink);
  border-radius: var(--radius-buttons);
}

.gate-head {
  font-size: var(--text-subheading);
  margin-bottom: var(--spacing-40);
}

.gate-card .tag {
  margin-bottom: var(--spacing-10);
}

.gate-close {
  position: absolute;
  top: var(--spacing-20);
  right: var(--spacing-20);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--color-typesetter-ink);
}

.gate-close:hover {
  color: var(--color-newsprint-gray);
}

.gate-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.field {
  display: block;
  margin-bottom: var(--spacing-30);
}

.field .micro {
  display: block;
  margin-bottom: var(--spacing-10);
  color: var(--color-newsprint-gray);
}

.select-wrap {
  position: relative;
}

.gate-card select,
.gate-card input {
  width: 100%;
  font-family: var(--font-twk-lausanne);
  font-size: 16px;
  font-weight: var(--font-weight-regular);
  letter-spacing: -0.2px;
  color: var(--color-typesetter-ink);
  padding: var(--spacing-15) var(--spacing-15);
  background: var(--surface-canvas);
  border: 1px solid var(--color-slate-verdant);
  border-radius: var(--radius-buttons);
  outline: none;
  appearance: none;
}

.gate-card select {
  padding-right: 40px;
  cursor: pointer;
}

.gate-card select:invalid {
  color: var(--color-newsprint-gray);
}

.gate-card select:focus,
.gate-card input:focus {
  border-color: var(--color-highlighter-green);
  box-shadow: 0 0 0 3px rgba(43, 238, 75, 0.22);
}

.gate-card input::placeholder {
  color: var(--color-newsprint-gray);
  letter-spacing: 0.2em;
}

.select-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  pointer-events: none;
  fill: none;
  stroke: var(--color-typesetter-ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gate-error {
  margin: var(--spacing-20) 0 0;
  font-family: var(--font-twk-lausanne);
  font-size: var(--text-body-sm);
  font-weight: var(--font-weight-w550);
  letter-spacing: 0.14px;
  text-transform: uppercase;
  color: #8c1d1d;
}

.gate-error[hidden] {
  display: none;
}

.gate-note {
  margin: var(--spacing-30) 0 0;
  font-family: var(--font-times);
  font-size: 16px;
  line-height: 1.2;
  color: var(--color-newsprint-gray);
}

/* ------------------------------------------------------------------ *
 * Editorial photo insert
 * ------------------------------------------------------------------ *
 * Unused until there is documentary photography to place. Any <img class=
 * "insert"> dropped between lines of display type picks up the duotone so it
 * belongs to the same tonal family as the page. */

.insert {
  width: 200px;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-images);
  vertical-align: middle;
  margin: 0 var(--spacing-20);
  filter: grayscale(1) saturate(1) invert(0.27) sepia(0.07) saturate(10.67) hue-rotate(80deg)
    brightness(1.02) contrast(0.83);
}

/* ------------------------------------------------------------------ *
 * Narrow
 * ------------------------------------------------------------------ */

@media (max-width: 1000px) {
  .stats,
  .ghosts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps,
  .foot-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .ghost {
    min-height: 0;
    padding: var(--spacing-30) var(--spacing-20);
  }
}

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

  /* The masthead instance tightens up; the hero and close CTAs keep the
   * spec's full 20/30 padding, so the primary action still reads as the
   * largest thing you can press. */
  .nav .btn-green {
    padding: 14px 18px;
  }

  .stats {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-30);
  }

  .ghosts {
    grid-template-columns: minmax(0, 1fr);
  }

  .cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-foot {
    margin-bottom: var(--spacing-60);
  }

  .catalog-list li {
    flex-wrap: wrap;
    gap: var(--spacing-10);
  }

  .catalog-name {
    flex: 1 0 100%;
    margin-bottom: var(--spacing-10);
  }

  .actions {
    flex-wrap: wrap;
    gap: var(--spacing-20);
  }
}
