/* ================================================================
   MIND YOUR BUSINESS — The Reading Room
   Palette + type from the Mind Your Business Academy brand kit.
   ================================================================ */

@font-face { font-family: 'Freight Display'; src: url('/fonts/freight-display-book.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Freight Display'; src: url('/fonts/freight-display-bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Freight Display'; src: url('/fonts/freight-display-black.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Freight Display'; src: url('/fonts/freight-display-medium-italic.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Sofia Pro'; src: url('/fonts/sofia-pro-light.otf') format('opentype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Sofia Pro'; src: url('/fonts/sofia-pro-regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Sofia Pro'; src: url('/fonts/sofia-pro-medium.otf') format('opentype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Sofia Pro'; src: url('/fonts/sofia-pro-semibold.otf') format('opentype'); font-weight: 600; font-display: swap; }

:root {
  --ink: #0A1712;
  --verdant: #0D1F17;
  --emerald: #0F2E1F;
  --estate: #1A3C2A;
  --moss: #4A6B5A;
  --sage: #8FA898;
  --gold: #B5985A;
  --gold-deep: #8B7340;
  --linen: #F5F0E8;
  --parchment: #E8E0D0;
  --paper-ink: #22211C;
  --paper-soft: #54534A;
  --display: 'Freight Display', Georgia, serif;
  --body: 'Sofia Pro', -apple-system, 'Helvetica Neue', sans-serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  background-image: radial-gradient(ellipse at 50% -10%, rgba(26,60,42,.55), rgba(10,23,18,0) 65%), var(--grain);
  background-size: auto, 160px 160px;
  color: var(--linen);
  font-family: var(--body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- shared bits ---------- */
.eyebrow {
  font-family: var(--body); font-weight: 500;
  font-size: .62rem; letter-spacing: .34em; text-transform: uppercase;
  color: var(--gold);
}
.rule-diamond { display: flex; align-items: center; justify-content: center; gap: 12px; }
.rule-diamond::before, .rule-diamond::after {
  content: ''; width: 64px; height: 1px; background: rgba(181,152,90,.38);
}
.rule-diamond span { color: var(--gold); font-size: .7rem; line-height: 1; }

.btn-gold {
  display: inline-block; padding: .95rem 2.2rem; cursor: pointer; white-space: nowrap;
  background: linear-gradient(135deg, #C8AC6E, var(--gold) 45%, var(--gold-deep));
  color: var(--ink); border: 0; border-radius: 2px;
  font-family: var(--body); font-weight: 600; font-size: .68rem;
  letter-spacing: .22em; text-transform: uppercase;
  box-shadow: 0 4px 18px rgba(181,152,90,.25);
  transition: transform .3s ease, box-shadow .3s ease;
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(181,152,90,.35); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: rgba(10,23,18,.78);
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border-bottom: 1px solid rgba(181,152,90,.16);
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
.nav-brand { display: flex; align-items: center; gap: 11px; }
.nav-brand img { width: 30px; height: 30px; }
.nav-brand .word {
  font-family: var(--body); font-weight: 600; font-size: .68rem;
  letter-spacing: .3em; text-transform: uppercase; color: var(--linen);
}
.nav-links { display: flex; align-items: center; gap: 1.8rem; }
.nav-links a:not(.btn-gold) {
  font-size: .62rem; font-weight: 500; letter-spacing: .24em; text-transform: uppercase;
  color: var(--sage); transition: color .3s ease;
}
.nav-links a:not(.btn-gold):hover { color: var(--linen); }
.nav .btn-gold { padding: .6rem 1.4rem; }
@media (max-width: 680px) { .nav-links a:not(.btn-gold) { display: none; } }

/* ---------- masthead ---------- */
.masthead { padding: 11.5rem 20px 5rem; text-align: center; }
.masthead .crest { width: 74px; margin: 0 auto 1.6rem; filter: drop-shadow(0 6px 24px rgba(181,152,90,.3)); }
.masthead h1 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(2.7rem, 7.5vw, 5.4rem); line-height: .98; letter-spacing: .01em;
  margin: 1.25rem 0 1.1rem; color: var(--linen);
}
.masthead h1 em { font-style: italic; font-weight: 500; color: var(--gold); }
.masthead .dek {
  max-width: 560px; margin: 0 auto; color: var(--sage);
  font-size: 1.02rem; line-height: 1.8; font-weight: 300;
}
.masthead .dek strong { color: var(--linen); font-weight: 500; }

/* ---------- subscribe ---------- */
.sub-form { max-width: 460px; margin: 2.4rem auto 0; }
.sub-row { display: flex; gap: 10px; }
.sub-row input[type=email] {
  flex: 1; min-width: 0; padding: .95rem 1.1rem;
  background: rgba(245,240,232,.05); color: var(--linen);
  border: 1px solid rgba(181,152,90,.35); border-radius: 2px;
  font-family: var(--body); font-weight: 300; font-size: .92rem;
  outline: none; transition: border-color .3s ease, background .3s ease;
}
.sub-row input[type=email]::placeholder { color: rgba(143,168,152,.7); }
.sub-row input[type=email]:focus { border-color: var(--gold); background: rgba(245,240,232,.08); }
.sub-note { margin-top: .85rem; font-size: .68rem; letter-spacing: .12em; color: var(--moss); text-transform: uppercase; }
.sub-msg { margin-top: .9rem; font-size: .86rem; min-height: 1.2em; }
.sub-msg.ok { color: var(--gold); }
.sub-msg.err { color: #C98B8B; }
.hp { position: absolute; left: -9999px; opacity: 0; }

/* ---------- mail tray ---------- */
.tray { max-width: 1160px; margin: 0 auto; padding: 2rem 20px 7rem; }
.tray-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.tray-head h2 { font-family: var(--display); font-weight: 400; font-size: 1.7rem; color: var(--linen); }
.tray-head .next-seal { font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; color: var(--moss); }
.tray-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px; }

.envelope {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(168deg, var(--linen), var(--parchment) 80%);
  background-image: linear-gradient(168deg, rgba(245,240,232,1), rgba(232,224,208,1) 80%), var(--grain);
  background-size: auto, 160px 160px;
  border-radius: 3px; padding: 1.9rem 1.7rem 1.5rem;
  color: var(--paper-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 14px 34px rgba(0,0,0,.42);
  transition: transform .35s ease, box-shadow .35s ease;
  overflow: hidden;
}
.envelope::before { /* flap crease */
  content: ''; position: absolute; inset: 0 0 auto 0; height: 54px;
  background: linear-gradient(180deg, rgba(139,115,64,.14), rgba(139,115,64,0));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}
.envelope:hover { transform: translateY(-5px); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 22px 44px rgba(0,0,0,.55); }
.env-route {
  display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem;
  font-size: .6rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-deep);
}
.env-route .no { font-weight: 600; }
.env-route .date { color: #8d8a7e; letter-spacing: .14em; margin-left: auto; }
.envelope h3 {
  font-family: var(--display); font-weight: 700; font-size: 1.38rem; line-height: 1.18;
  letter-spacing: -.005em; margin-bottom: .7rem; color: var(--paper-ink);
}
.envelope p { font-size: .87rem; line-height: 1.66; color: var(--paper-soft); flex: 1; }
.env-open {
  margin-top: 1.3rem; display: flex; align-items: center; justify-content: space-between;
  font-size: .62rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-deep);
}
.env-seal {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #C8AC6E, var(--gold) 55%, var(--gold-deep));
  display: grid; place-items: center;
  box-shadow: 0 2px 7px rgba(139,115,64,.45);
}
.env-seal img { width: 20px; height: 20px; }

.envelope.sealed { pointer-events: none; }
.envelope.sealed h3, .envelope.sealed p { filter: blur(7px); user-select: none; }
.envelope.sealed .env-open { color: #8d8a7e; }

/* ---------- letter page ---------- */
.letter-wrap { max-width: 780px; margin: 0 auto; padding: 8.5rem 16px 4rem; }
.paper {
  position: relative;
  background: linear-gradient(176deg, var(--linen), var(--parchment) 90%);
  background-image: linear-gradient(176deg, rgba(245,240,232,1), rgba(232,224,208,1) 90%), var(--grain);
  background-size: auto, 160px 160px;
  color: var(--paper-ink);
  border-radius: 3px;
  padding: clamp(2.2rem, 6vw, 4.2rem) clamp(1.3rem, 6vw, 4.6rem) clamp(2.6rem, 6vw, 4rem);
  box-shadow: 0 1px 0 rgba(255,255,255,.1) inset, 0 30px 70px rgba(0,0,0,.5);
}
@media (prefers-reduced-motion: no-preference) {
  .paper { animation: unfold .9s cubic-bezier(.22,.9,.3,1) both; }
  @keyframes unfold { from { opacity: 0; transform: translateY(34px) scale(.985); } to { opacity: 1; transform: none; } }
}
.letterhead { text-align: center; margin-bottom: 2.4rem; }
.letterhead img { width: 52px; margin: 0 auto 1rem; }
.letterhead .word {
  font-weight: 600; font-size: .66rem; letter-spacing: .4em; text-transform: uppercase; color: var(--gold-deep);
}
.letterhead .sub { margin-top: .45rem; font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: #8d8a7e; }
.letterhead .lh-rule { width: 76px; height: 1px; background: rgba(139,115,64,.4); margin: 1.2rem auto 0; }

.route-row {
  display: flex; flex-wrap: wrap; gap: .55rem 1.3rem; justify-content: center;
  font-size: .6rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-deep); margin-bottom: 2rem;
}
.route-row .dim { color: #8d8a7e; letter-spacing: .14em; }

.paper h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.8rem, 4.6vw, 2.7rem); line-height: 1.12; letter-spacing: -.01em;
  text-align: center; margin-bottom: 1.3rem;
}
.paper .dek {
  font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: 1.12rem; line-height: 1.6; color: #6a6557; text-align: center;
  max-width: 560px; margin: 0 auto 2.6rem;
}
.letter-body { font-size: 1.03rem; line-height: 1.85; }
.letter-body p { margin-bottom: 1.4rem; color: #33322B; font-weight: 300; }
.letter-body p strong { font-weight: 600; color: var(--paper-ink); }
.letter-body em { color: #514e42; }
.letter-body h2 {
  font-family: var(--display); font-weight: 700; font-size: 1.55rem; line-height: 1.22;
  margin: 2.7rem 0 1.1rem; color: var(--paper-ink);
}
.letter-body h2::before { content: ''; display: block; width: 36px; height: 2px; background: var(--gold); margin-bottom: .85rem; }
.letter-body h3 { font-family: var(--display); font-weight: 700; font-size: 1.2rem; margin: 2rem 0 .8rem; }
.letter-body ol, .letter-body ul { margin: 0 0 1.5rem 1.25rem; }
.letter-body li { margin-bottom: .8rem; color: #33322B; padding-left: .3rem; }
.letter-body li::marker { color: var(--gold-deep); font-weight: 600; }
.letter-body blockquote {
  border-left: 2px solid var(--gold); margin: 2rem 0; padding: .15rem 0 .15rem 1.3rem;
}
.letter-body blockquote p {
  font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: 1.2rem; line-height: 1.5; color: #4a463a; margin-bottom: 0;
}
.letter-body .dropcap::first-letter {
  font-family: var(--display); font-weight: 900; font-size: 3.6em; line-height: .82;
  float: left; padding: .06em .12em 0 0; color: var(--gold-deep);
}

.signoff { margin-top: 2.8rem; padding-top: 1.8rem; border-top: 1px solid rgba(139,115,64,.28); }
.signoff .name { font-family: var(--display); font-weight: 700; font-size: 1.25rem; }
.signoff .role { margin-top: .3rem; font-size: .6rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: #8d8a7e; }
.plate { margin-top: 1.5rem; font-size: .82rem; color: #6a6557; font-style: italic; }
.plate a { color: var(--gold-deep); border-bottom: 1px solid rgba(139,115,64,.4); }

/* CTA below the paper */
.after-letter { max-width: 780px; margin: 2.2rem auto 0; padding: 0 16px; }
.cta-card {
  background: linear-gradient(170deg, rgba(15,46,31,.92), rgba(13,31,23,.96));
  background-image: linear-gradient(170deg, rgba(15,46,31,.92), rgba(13,31,23,.96)), var(--grain);
  background-size: auto, 160px 160px;
  border: 1px solid rgba(181,152,90,.4); border-radius: 3px;
  text-align: center; padding: 2.8rem 1.6rem 2.6rem;
}
.cta-card h3 { font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: var(--linen); margin: .9rem 0 .7rem; }
.cta-card p { max-width: 460px; margin: 0 auto 1.7rem; color: var(--sage); font-size: .92rem; line-height: 1.7; }
.letter-nav { display: flex; justify-content: space-between; align-items: center; margin: 2rem auto 5rem; max-width: 780px; padding: 0 16px; }
.letter-nav a { font-size: .62rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--sage); transition: color .3s; }
.letter-nav a:hover { color: var(--linen); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid rgba(181,152,90,.15); padding: 3.2rem 20px 3rem; text-align: center; }
.footer .crest { width: 34px; margin: 0 auto 1rem; opacity: .9; }
.footer .word { font-size: .62rem; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: var(--gold); }
.footer .fine { margin-top: 1rem; font-size: .72rem; line-height: 1.8; color: var(--moss); }
.footer .fine a { color: var(--sage); border-bottom: 1px solid rgba(143,168,152,.3); }
.footer .fine a:hover { color: var(--linen); }

/* preferences page */
.prefs-wrap { max-width: 520px; margin: 0 auto; padding: 9rem 20px 6rem; }
.prefs-card { background: rgba(245,240,232,.04); border: 1px solid rgba(181,152,90,.25); border-radius: 3px; padding: 2.4rem 2rem; }
.prefs-card h1 { font-family: var(--display); font-weight: 700; font-size: 1.8rem; margin-bottom: .7rem; }
.prefs-card .hint { color: var(--sage); font-size: .9rem; line-height: 1.7; margin-bottom: 1.8rem; }
.prefs-card label.letter-opt {
  display: flex; gap: .8rem; align-items: flex-start; padding: 1rem; border: 1px solid rgba(181,152,90,.2);
  border-radius: 3px; margin-bottom: .9rem; cursor: pointer; transition: border-color .3s;
}
.prefs-card label.letter-opt:hover { border-color: rgba(181,152,90,.5); }
.prefs-card input[type=checkbox] { accent-color: var(--gold); margin-top: .2rem; }
.prefs-card .opt-name { font-weight: 500; font-size: .92rem; color: var(--linen); }
.prefs-card .opt-sub { font-size: .76rem; color: var(--moss); margin-top: .2rem; line-height: 1.5; }
.prefs-card input[type=email] {
  width: 100%; padding: .9rem 1rem; margin-bottom: 1.1rem;
  background: rgba(245,240,232,.05); color: var(--linen);
  border: 1px solid rgba(181,152,90,.35); border-radius: 2px; font-family: var(--body); font-size: .92rem; outline: none;
}
