/* Developing Taste — landing page
   Editorial, print-rooted restraint. Architectural grey, true ink, one sharp red.
   Tokens, type and components follow DESIGN.md.
   Type reality: Freight (serif) ships 400/700 only on Adobe Fonts; Neue Haas Grotesk
   carries weight (500 for UI, 900 for graphic statements). */

:root {
  --canvas:    #EBEDEE;
  --surface-1: #F4F6F6;
  --surface-2: #FBFCFC;
  --hairline:  #D6D8DA;

  --ink:        #181A1C;
  --ink-muted:  #51555A;
  --ink-subtle: #5E6266;
  --paper:      #EBEDEE;

  --red-signal: #E5331F;
  --red-deep:   #C8281A;
  --red-focus:  rgba(229, 51, 31, 0.40);

  --font-display:   "freight-display-pro", Georgia, "Times New Roman", serif;
  --font-text:      "freight-text-pro", Georgia, "Times New Roman", serif;
  --font-read:      "freight-text-pro", Georgia, "Times New Roman", serif;  /* reading cut; weight 500 = Medium once added to the kit */
  --font-statement: "neue-haas-grotesk-display", "Helvetica Neue", Arial, sans-serif;
  --font-ui:        "neue-haas-grotesk-text", "Helvetica Neue", Arial, sans-serif;
  --font-mono:      "ibm-plex-mono", ui-monospace, "SF Mono", Menlo, monospace;

  --xxs: 4px; --xs: 8px; --sm: 12px; --md: 16px;
  --lg: 24px; --xl: 32px; --xxl: 48px; --section: 80px;

  --measure: 60ch;
  --pad: clamp(1.5rem, 3.2vw, 3.25rem);  /* stream horizontal padding */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-read);
  font-weight: 500;            /* renders Book until FreightText Medium is added to the kit, then upgrades automatically */
  font-size: 19px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

img { display: block; max-width: 100%; }
a { color: var(--red-deep); }
::selection { background: var(--red-signal); color: var(--ink); }
:focus-visible { outline: 2px solid var(--red-signal); outline-offset: 2px; }

/* ---------- Shell: locked visual + scrolling stream ---------- */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 42vw) 1fr;
}

.visual {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: var(--ink);
  overflow: hidden;
}
.visual__figure { position: relative; margin: 0; width: 100%; height: 100%; }
.visual__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 42%;
}
.visual__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--lg) var(--xl);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--paper);
  background: linear-gradient(to top, rgba(10,11,12,0.86), rgba(10,11,12,0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease-out, transform 220ms ease-out;
  pointer-events: none;
}
.visual:hover .visual__caption,
.visual:focus-within .visual__caption { opacity: 1; transform: none; }

/* ---------- Stream ---------- */
.stream {
  min-width: 0;
}

/* Masthead: tight, gridded, not generic nav */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--md) var(--pad);
  border-bottom: 1px solid var(--hairline);
}
.masthead__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-decoration: none;
}
/* Hero */
.hero {
  padding: clamp(1.75rem, 3.5vw, 3rem) var(--pad);
  border-bottom: 1px solid var(--hairline);
}
.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.hero__sub {
  margin: var(--lg) 0 0;
  font-family: var(--font-read);
  font-size: clamp(1.0625rem, 1.4vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 46ch;
}
.hero__cta { margin-top: var(--xl); }

/* ---------- Essay ---------- */
.essay {
  max-width: var(--measure);
  padding: clamp(2.25rem, 5vw, 3.5rem) var(--pad);
}
.statement + .essay { padding-top: clamp(2.25rem, 5vw, 4.25rem); }
.essay p { margin: 0 0 var(--lg); }
.essay p:last-child { margin-bottom: 0; }

.essay__lead { font-size: 22px; line-height: 1.5; }

.essay__quote {
  margin: var(--xl) 0;
  padding-left: var(--lg);
  border-left: 2px solid var(--red-signal);
}
.essay__quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 23px;
  line-height: 1.35;
  margin: 0 0 var(--xs);
}
.essay__quote cite {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-subtle);
}

.essay__heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: var(--xxl) 0 var(--lg);
}
.essay > .essay__heading:first-child { margin-top: 0; }

/* Inline footnote reference — hover/focus popover */
.ref { position: relative; }
.ref__marker {
  font-family: var(--font-mono);
  font-size: 0.8em;
  line-height: 1;
  vertical-align: super;
  color: var(--red-deep);
  background: none;
  border: 0;
  padding: 0 1px;
  cursor: pointer;
}
.ref__marker:hover { color: var(--ink); }

.ref__card {
  position: absolute;
  left: 0;
  bottom: 1.7em;
  z-index: 30;
  display: block;
  width: min(320px, calc(100vw - 2.5rem));
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: var(--lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 180ms ease-out, transform 180ms ease-out, visibility 180ms;
}
/* invisible bridge so the pointer can travel marker -> card without a gap */
.ref__card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 1.7em;
}
.ref:hover .ref__card,
.ref:focus-within .ref__card {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.ref__kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red-deep);
  margin-bottom: var(--sm);
}
.ref__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.ref__meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-subtle);
  margin: var(--xs) 0 var(--sm);
}
.ref__desc {
  display: block;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin-bottom: var(--md);
}
.ref__link {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  color: var(--red-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--red-deep);
  padding-bottom: 1px;
}
.ref__link:hover { color: var(--ink); border-color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .ref__card { transition: opacity 1ms, visibility 1ms; }
}

/* ---------- Statement (full-bleed within stream, red-drench) ---------- */
.statement {
  background: var(--red-signal);
  color: var(--ink);
  padding: clamp(2.5rem, 6vw, 5.5rem) var(--pad);
}
.statement__text {
  max-width: 20ch;
  margin: 0;
  font-family: var(--font-statement);
  font-weight: 900;
  font-size: clamp(1.6rem, 4vw, 3.4rem);
  line-height: 1.0;
  letter-spacing: -0.025em;
}

/* ---------- Join / membership (app, not newsletter) ---------- */
.join {
  padding: clamp(2.75rem, 5vw, 4rem) var(--pad);
  background: var(--ink);
  color: var(--paper);
}
.join__head { max-width: 52ch; }
.join__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}
.join__intro {
  margin: var(--md) 0 0;
  color: rgba(235, 237, 238, 0.74);
  font-size: 18px;
}

.join__list {
  margin: var(--xxl) 0 0;
  border-top: 1px solid rgba(235, 237, 238, 0.18);
}
.join__row {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: var(--lg);
  padding: var(--lg) 0;
  border-bottom: 1px solid rgba(235, 237, 238, 0.18);
}
.join__row dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.join__row dd {
  margin: 0;
  color: rgba(235, 237, 238, 0.74);
  font-size: 17px;
  line-height: 1.55;
  max-width: 52ch;
}

/* Application form, styled like product onboarding */
.join__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--md);
  margin-top: var(--xxl);
  max-width: 40rem;
}
.field { display: flex; flex-direction: column; gap: var(--xs); }
.field label {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 13px;
  color: rgba(235, 237, 238, 0.74);
}
.field--full { grid-column: 1 / -1; }
.field input,
.field select {
  font-family: var(--font-read);
  font-size: 17px;
  color: var(--ink);
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 13px 14px;
  min-height: 48px;
}
.field input::placeholder { color: var(--ink-subtle); }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23181A1C' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.field input:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--red-focus);
  outline-offset: 0;
  border-color: var(--ink);
}
.join__form .btn { grid-column: 1 / -1; justify-self: start; }
.join__meta {
  grid-column: 1 / -1;
  margin: var(--xs) 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(235, 237, 238, 0.6);
}

/* Honeypot: removed from layout and the accessibility tree, off-screen for bots */
.field--hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Inline error: one quiet mono line, signal red, under the form */
.join__error {
  grid-column: 1 / -1;
  margin: var(--xs) 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--red-signal);
}

/* Confirmation: replaces the form inside the ink panel, same rhythm */
.join__done {
  margin-top: var(--xxl);
  padding-top: var(--lg);
  border-top: 1px solid rgba(235, 237, 238, 0.18);
  max-width: 40rem;
}
.join__done-title {
  margin: 0 0 var(--xs);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.join__done-text {
  margin: 0;
  color: rgba(235, 237, 238, 0.74);
  font-size: 17px;
  line-height: 1.55;
}

/* ---------- Button ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 0;
  border-radius: 2px;
  padding: 13px 22px;
  min-height: 48px;
  line-height: 22px;
  cursor: pointer;
  transition: background-color 170ms ease-out, color 170ms ease-out;
}
.btn--accent { background: var(--red-signal); color: var(--ink); }
.btn--accent:hover { background: var(--red-deep); color: var(--paper); }
.btn--accent:active { background: #A81F12; color: var(--paper); }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--lg);
  flex-wrap: wrap;
  padding: var(--xl) var(--pad);
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid rgba(235, 237, 238, 0.18);
}
.footer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.005em;
}
.footer__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(235, 237, 238, 0.6);
}

/* ---------- Page-load motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__title, .hero__sub, .hero__cta {
    opacity: 0;
    transform: translateY(12px);
    animation: rise 720ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .hero__title { animation-delay: 80ms; }
  .hero__sub   { animation-delay: 220ms; }
  .hero__cta   { animation-delay: 340ms; }
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Responsive: stack below the split ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .visual {
    position: static;
    height: 56vh;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }
  .visual__caption { opacity: 1; transform: none; }   /* no hover on touch */
  .stream { border-left: 0; margin-left: 0; }
  .join__row { grid-template-columns: 1fr; gap: var(--xs); }
  .join__form { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  body { font-size: 18px; }
  .join__form .btn { justify-self: stretch; width: 100%; text-align: center; }
}
