/* ============================================================
   Marginalia studio site — single stylesheet.
   Design tokens carried over from wendapp.co so the family of
   properties (Marginalia, Wend, future apps) reads as one studio.
   ============================================================ */

:root {
  --forest:       #1C3D2E;
  --forest-light: #2A5A42;
  --forest-deep:  #0F2418;

  --terra:        #4D2E5C;   /* Iris ink — same as wendapp.co */
  --terra-light:  #6B4A7E;
  --terra-deep:   #2E1A38;

  --amber:        #A6843A;
  --amber-light:  #C49E54;

  --ink:          #241632;   /* Iris-deep — dark sections */
  --ink-light:    #3A2750;

  --parchment:    #E9E0CB;
  --parch-dark:   #DCD2BB;
  --card:         #FFFFFF;

  --text:         #1A1810;
  --text-muted:   #7A7060;
  --text-light:   #B8AB94;

  --hair:         #E0D8CA;
  --hair-strong:  #C8BCA4;

  --display: 'Cormorant Garamond', Georgia, serif;
  --ui:      'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max-w:  860px;     /* studio site is narrower than wendapp.co */
  --pad-x:  clamp(24px, 6vw, 56px);
  --pad-y:  clamp(80px, 14vh, 140px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--parchment);
  color: var(--text);
  font-family: var(--ui);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; transition: color 180ms ease; }
a:hover { color: var(--terra); }

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

/* ---------- Brand mark ---------- */
.mark {
  font-family: var(--display);
  font-size: 1.55em;
  line-height: 1;
  color: var(--terra);
  font-weight: 600;
  display: inline-block;
  transform: translateY(2px);
}
.wordmark {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Top nav ---------- */
.nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px var(--pad-x) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__link {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

/* ---------- Hero ----------
   The hero is the dark hardcover. Everything below it is the
   book opening up onto parchment. Deep forest-green slab + cream
   type + brass-amber italics — a Penguin-Classics register that
   signals "this is a press, not a SaaS landing page."
   The watermark pilcrow on the right is the cover device. */
.hero {
  background: var(--forest-deep);
  color: #FBF7EC;
  padding: clamp(80px, 14vh, 160px) var(--pad-x) clamp(70px, 10vh, 110px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  /* Watermark pilcrow on the right edge — set big, set faint.
     The cover device. Sits behind everything. */
  content: "¶";
  position: absolute;
  right: clamp(-40px, -2vw, 0px);
  top: 50%;
  transform: translateY(-52%);
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(380px, 56vw, 720px);
  line-height: 0.78;
  color: var(--amber);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  letter-spacing: -0.04em;
}
.hero::after {
  /* A subtle warm radial vignette so the slab has dimension —
     stops the dark bg reading as flat black. */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 30% 35%,
    rgba(196, 158, 84, 0.10) 0%,
    rgba(196, 158, 84, 0) 70%
  );
  pointer-events: none;
  z-index: 0;
}
.hero__inner {
  position: relative;
  z-index: 1;
}
.hero__flourish {
  color: var(--amber-light);
  margin: -8px 0 32px;
  opacity: 0.8;
}
.hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}
.kicker__rule {
  flex: 0 0 32px;
  height: 1px;
  /* on the dark hero the kicker rules need to be light, not hair */
  background: rgba(196, 158, 84, 0.5);
}
.kicker__text {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  /* brass-amber sits more legibly on forest-deep than iris does */
  color: var(--amber-light);
}
.hero__title {
  font-family: var(--display);
  font-size: clamp(46px, 8.5vw, 92px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -1.2px;
  color: #FBF7EC;
  margin: 0 0 36px;
}
.hero__title em {
  font-style: italic;
  font-weight: 400;
  /* italic emphasis switches to brass-amber on the dark cover */
  color: var(--amber-light);
}
.hero__lede {
  font-family: var(--display);
  font-size: clamp(20px, 2.5vw, 26px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.45;
  color: rgba(251, 247, 236, 0.72);
  margin: 0 0 56px;
  max-width: 640px;
}
.hero__credo {
  border-top: 1px dashed rgba(196, 158, 84, 0.32);
  border-bottom: 1px dashed rgba(196, 158, 84, 0.32);
  padding: 22px 0;
  margin-top: 20px;
}
.hero__credo p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(251, 247, 236, 0.66);
  max-width: 580px;
}

/* ---------- Plate (editorial illustration band) ----------
   A framed full-width band that sits between the hero text and
   the apps section. The illustration inside is centred and
   capped to a max width so it never feels stretched on wide
   screens. The band itself has a slightly darker parchment so
   the page-on-page composition reads as a "framed plate" — the
   way an art book sets a tipped-in illustration on the page. */
.plate {
  background:
    linear-gradient(180deg, var(--parchment) 0%, var(--parch-dark) 50%, var(--parchment) 100%);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  padding: clamp(48px, 8vh, 96px) var(--pad-x);
  position: relative;
}
.plate__inner {
  max-width: 760px;
  margin: 0 auto;
}
.plate__svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 28px rgba(36, 22, 50, 0.10))
          drop-shadow(0 4px 10px rgba(36, 22, 50, 0.06));
}

/* ---------- Section primitives ---------- */
.section {
  padding: clamp(80px, 12vh, 130px) var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}
.section--ink {
  background: var(--ink);
  max-width: none;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}
.section--ink > * {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.section-head {
  margin-bottom: 56px;
}
.section-head--centered { text-align: center; }

.chapter {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--terra);
  text-transform: uppercase;
}
.chapter__num {
  display: inline-block;
  min-width: 22px;
}
.chapter__rule {
  flex: 0 0 36px;
  height: 1px;
  background: var(--hair-strong);
}
.chapter--light { color: var(--amber-light); }
.chapter--light .chapter__rule { background: rgba(255,255,255,0.18); }

.section-title {
  font-family: var(--display);
  font-size: clamp(36px, 5.6vw, 56px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.8px;
  color: var(--text);
  margin: 0;
  max-width: 600px;
}
.section-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--terra);
}
.section-title--light {
  color: #FBF7EC;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}
.section-title--light em {
  color: var(--amber-light);
}

/* ---------- Apps grid ---------- */
.apps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}
@media (max-width: 720px) {
  .apps { grid-template-columns: 1fr; gap: 28px; }
}

.app {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* The illustrated device mockup at the top of each app card.
   The background gradient is per-app so Wend and Clarus read as
   distinctly different surfaces despite using the same shell. */
.app__mock {
  position: relative;
  margin: -28px -28px 24px;
  padding: 36px 32px 8px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 280px;
  border-bottom: 1px solid var(--hair);
}
.app__mock svg {
  width: 200px;
  height: auto;
  max-height: 380px;
  display: block;
  filter: drop-shadow(0 18px 24px rgba(36, 22, 50, 0.15))
          drop-shadow(0 6px 8px rgba(36, 22, 50, 0.10));
  transform: translateY(8px);
  transition: transform 380ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.app:hover .app__mock svg { transform: translateY(0); }
.app__mock--wend {
  background:
    radial-gradient(ellipse at 50% 0%, #F2DDB0 0%, #E9D49A 60%, #DCC288 100%);
}
.app__mock--clarus {
  background:
    radial-gradient(ellipse at 50% 0%, #D9E4D4 0%, #B7CCB2 60%, #97B391 100%);
}
.app::before {
  content: "";
  position: absolute;
  /* the iris-ink stripe runs only along the text portion of the card,
     starting beneath the illustrated mockup. The mockup is the visual
     anchor up top; the stripe is the "page binding" down the spine. */
  left: 0; top: 320px; bottom: 24px;
  width: 3px;
  background: var(--terra);
  border-radius: 0 2px 2px 0;
}
.app__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 6px;
}
.app__num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-light);
}
.app__name {
  font-family: var(--display);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.6px;
  color: var(--text);
  margin: 0;
  line-height: 1;
}
.app__tag {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 19px;
  color: var(--terra);
  margin: 4px 0 18px;
  line-height: 1.3;
}
.app__body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 24px;
  flex-grow: 1;
}
.placeholder {
  background: var(--parchment);
  padding: 1px 6px;
  border-radius: 3px;
  font-style: italic;
  color: var(--terra);
  font-size: 13px;
}
.app__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--hair-strong);
}
.app__meta-cell {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}
.app__meta-cell strong {
  color: var(--text-light);
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-right: 8px;
  font-size: 10px;
}
.app__link {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--terra);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.app__link:hover { color: var(--terra-deep); }
.app__link[aria-disabled="true"] {
  color: var(--text-light);
  pointer-events: none;
}
.app__link-arrow {
  display: inline-block;
  transform: translateY(-1px);
  font-size: 13px;
}

/* ---------- Principles (ink section) ---------- */
.principles {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}
@media (max-width: 720px) {
  .principles { grid-template-columns: 1fr; gap: 36px; }
}
.principle {
  text-align: left;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 28px 4px 0;
}
.principle__num {
  font-family: var(--display);
  font-style: italic;
  font-size: 24px;
  color: var(--amber-light);
  display: block;
  margin-bottom: 12px;
}
.principle__name {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  color: #FBF7EC;
  margin: 0 0 12px;
  letter-spacing: -0.3px;
  line-height: 1.15;
}
.principle__body {
  font-size: 14.5px;
  line-height: 1.65;
  color: rgba(251, 247, 236, 0.7);
  margin: 0;
}

/* ---------- Contact ---------- */
.contact {
  text-align: left;
  max-width: 620px;
}
.contact__title {
  font-family: var(--display);
  font-size: clamp(56px, 9vw, 96px);
  font-weight: 500;
  letter-spacing: -1.2px;
  line-height: 1;
  color: var(--text);
  margin: 8px 0 28px;
}
.contact__body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 36px;
}
.contact__email {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 500;
  color: var(--terra);
  border-bottom: 1px solid var(--hair-strong);
  padding-bottom: 4px;
  display: inline-block;
}
.contact__email:hover {
  color: var(--terra-deep);
  border-bottom-color: var(--terra);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--parch-dark);
  border-top: 1px solid var(--hair-strong);
  padding: 36px var(--pad-x);
  margin-top: 0;
}
.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer__brand .wordmark { font-size: 16px; }
.footer__brand .mark { font-size: 1.3em; }

.footer__meta,
.footer__links {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer__links a:hover { color: var(--terra); }
.footer__sep { color: var(--hair-strong); }

/* ---------- Ribbon (margin-note pull-quote) ----------
   A literary aside between apps and principles. One sentence
   set big and italic, the pilcrow as a drop-cap mark in the
   left margin. Hairlines top and bottom — like the dedication
   page of a book, framed and quiet. */
.ribbon {
  border-top: 1px solid var(--hair-strong);
  border-bottom: 1px solid var(--hair-strong);
  background: var(--parch-dark);
  padding: clamp(64px, 10vh, 110px) var(--pad-x);
  position: relative;
}
.ribbon__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: start;
  gap: clamp(20px, 4vw, 40px);
}
.ribbon__pilcrow {
  font-family: var(--display);
  font-size: clamp(70px, 9vw, 110px);
  font-weight: 500;
  color: var(--terra);
  line-height: 0.78;
  display: block;
  transform: translateY(-6px);
  opacity: 0.92;
}
.ribbon__quote {
  margin: 0;
}
.ribbon__quote p {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.28;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 0 0 18px;
  max-width: 640px;
}
.ribbon__quote cite {
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Colophon (typographic specimen) ----------
   The publisher's colophon. The system, made visible: palette
   swatches, type specimens, the mark. A craft moment for the
   reader who actually reads the last page. */
.colophon {
  padding-bottom: clamp(80px, 12vh, 130px);
}
.colophon__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: start;
}
@media (max-width: 720px) {
  .colophon__grid { grid-template-columns: 1fr; gap: 48px; }
}
.colophon__col {
  position: relative;
}
.colophon__caption {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair-strong);
}

/* Palette swatches */
.swatches {
  list-style: none;
  margin: 0;
  padding: 0;
}
.swatches li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--hair);
}
.swatches li:last-child { border-bottom: 0; }
.swatch {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.swatch__name {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.1px;
}
.swatch__hex {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

/* Type specimens */
.specimen {
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--hair);
  letter-spacing: -0.2px;
  color: var(--text);
}
.specimen:last-of-type { border-bottom: 0; }
.specimen--display {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}
.specimen--display em {
  font-style: italic;
  font-weight: 400;
  color: var(--terra);
}
.specimen--ui {
  font-family: var(--ui);
  font-size: 19px;
  font-weight: 500;
}
.specimen--mono {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}
.colophon__note {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}
.colophon__note em {
  font-family: var(--display);
  font-size: 14px;
  color: var(--terra);
}

/* The mark column */
.colophon__col--mark {
  text-align: left;
}
.pilcrow-xl {
  font-family: var(--display);
  font-size: 132px;
  font-weight: 500;
  line-height: 0.82;
  color: var(--terra);
  margin: 0 0 18px;
  letter-spacing: -2px;
}

/* ---------- Entrance motion ----------
   Motion is now JS-driven, opt-in per page paint. The
   [data-reveal] attribute is retained for future use (we leave
   the hooks in place) but no CSS rule binds to it by default —
   content is visible immediately, which is the right floor for
   a print-set page like this. If we ever want to bring back the
   scroll-revealed fade, it goes here. */

/* ---------- Mobile tightening ---------- */
@media (max-width: 720px) {
  .app__mock { min-height: 240px; padding-top: 28px; }
  .app__mock svg { width: 168px; }
  .app::before { top: 280px; }
}
@media (max-width: 560px) {
  .nav { flex-direction: column; gap: 14px; align-items: flex-start; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .kicker__rule { flex: 0 0 18px; }
  .ribbon__inner { grid-template-columns: 1fr; gap: 12px; }
  .ribbon__pilcrow { transform: none; font-size: 88px; line-height: 1; }
  .pilcrow-xl { font-size: 96px; }
  .plate { padding-left: 16px; padding-right: 16px; }
}
