/* Sealed Envelope studio site. Values are the Sealed Envelope design system's
   tokens (Paper, Ink and Print themes); change them there first, then here. */

@font-face { font-family: "Libre Baskerville"; src: url(fonts/libre-baskerville-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url(fonts/libre-baskerville-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url(fonts/libre-baskerville-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url(fonts/courier-prime-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url(fonts/courier-prime-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #fbf8f1; --paper-raised: #ffffff; --manila: #eadcb8; --kraft: #c9a978;
  --ink: #1b1814; --ink-muted: #5c5247; --oxblood: #7a1f24; --seal: #7a1f24; --on-seal: #fbf8f1;
  --on-manila: #1b1814; --field: #ffffff; --rule: #1b1814; --line: #8f8170; --focus: var(--oxblood);
  --evening-bg: #1b1814;
  --font-serif: "Libre Baskerville", Baskerville, Georgia, serif;
  --font-mono: "Courier Prime", "Courier New", Courier, monospace;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --gutter: var(--space-4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #1b1814; --paper-raised: #27221d; --ink: #f2ead9; --ink-muted: #b8aa93;
    --oxblood: #d9737a; --seal: #a3343b; --rule: #f2ead9; --line: #7d705f; --evening-bg: #0f0d0b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1b1814; --paper-raised: #27221d; --ink: #f2ead9; --ink-muted: #b8aa93;
  --oxblood: #d9737a; --seal: #a3343b; --rule: #f2ead9; --line: #7d705f; --evening-bg: #0f0d0b;
}
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --paper: #ffffff; --paper-raised: #ffffff; --manila: #e6e6e6; --ink: #000000; --ink-muted: #333333;
    --oxblood: #000000; --seal: #000000; --on-seal: #ffffff; --rule: #000000; --line: #767676; --evening-bg: #ffffff;
  }
}
@media (min-width: 720px) { :root { --gutter: var(--space-6); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-serif); font-size: 17px; line-height: 28px; overflow-x: hidden;
}
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Type scale */
.display { font-size: clamp(36px, 7vw, 56px); line-height: 1.08; font-weight: 400; letter-spacing: -0.01em; margin: 0; }
.display-sm { font-size: clamp(30px, 4.5vw, 44px); line-height: 1.15; font-weight: 400; margin: 0 0 var(--space-3); padding: 0; border: 0; }
h2, .heading { font-size: 22px; line-height: 30px; font-weight: 700; margin: 0 0 var(--space-4); padding-bottom: var(--space-2); border-bottom: 2px solid var(--rule); }
h2.title { font-size: clamp(26px, 4vw, 32px); line-height: 1.25; padding: 0; border: 0; margin: 0 0 var(--space-6); }
h3 { font-size: 22px; line-height: 30px; font-weight: 700; margin: 0 0 var(--space-2); }
.caption { font-size: 13px; line-height: 20px; font-style: italic; color: var(--ink-muted); margin: 0; }
.label { font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: 0.16em; color: var(--ink-muted); margin: 0 0 var(--space-2); }
.stat { font-family: var(--font-mono); font-size: 15px; line-height: 22px; }
.stamp { font-family: var(--font-mono); font-size: 13px; line-height: 18px; font-weight: 700; letter-spacing: 0.14em; }
.doc-ref { font-family: var(--font-mono); font-weight: 700; }
.muted { color: var(--ink-muted); }
.sep { color: var(--ink-muted); }
.intro { max-width: 40em; margin: calc(-1 * var(--space-4)) 0 var(--space-6); }
p { margin: 0 0 var(--space-4); }

/* Masthead */
.masthead { padding: var(--space-4) 0; border-bottom: 1px solid var(--line); position: relative; z-index: 1; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; font-weight: 400; font-size: 21px; letter-spacing: -0.01em; }
.wordmark em { font-style: italic; }
.seal { display: block; flex: none; }
.seal-disc { fill: var(--seal); }
.seal-mark { fill: var(--on-seal); }
.seal-bold { stroke: var(--on-seal); }

/* Sections */
section { padding: var(--space-8) 0; }
.band { background: var(--manila); color: var(--on-manila); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band h2 { border-color: var(--on-manila); }
.band .label, .band .caption, .band .sep { color: var(--on-manila); }
.band-kraft { background: var(--kraft); }

/* Dark sections (masthead, hero, the closing signup): ink-dark in every theme. */
.dark {
  --paper: #1b1814; --paper-raised: #27221d; --ink: #f2ead9; --ink-muted: #b8aa93; --rule: #f2ead9; --line: #5c5247;
  --oxblood: #d9737a; --focus: #d9737a;
  background: var(--evening-bg); color: var(--ink);
}

/* Paper grain: a noise tile multiplied over manila and kraft */
.grain { position: relative; overflow: hidden; }
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.16; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.band > .wrap { position: relative; z-index: 1; }

/* Hero: the evening photo (site/image-prompts/evening.txt) full bleed, papers on the right;
   the copy keeps to its dark left side. On narrow screens the photo is under the copy, so a
   heavier scrim keeps the text readable. Captioned per BRAND.md's honesty rule. */
.hero { padding: clamp(40px, 7vw, 64px) 0 var(--space-8); }
.hero-photo {
  --scrim: linear-gradient(rgba(15, 13, 11, 0.82), rgba(15, 13, 11, 0.82));
  background: var(--scrim), url(img/evening.jpg) 70% center / cover no-repeat, var(--evening-bg);
  padding: clamp(48px, 9vw, 112px) 0 var(--space-5);
}
@media (min-width: 900px) {
  .hero-photo {
    --scrim: linear-gradient(90deg, rgba(15, 13, 11, 0.9) 0, rgba(15, 13, 11, 0.6) 40%, rgba(15, 13, 11, 0) 62%);
    background-position: right center; min-height: 640px; display: flex; flex-direction: column; justify-content: center;
  }
  .hero-photo > .wrap { width: 100%; }
}
.hero-copy { max-width: 560px; display: flex; flex-direction: column; gap: var(--space-5); }
.hero-copy > * { margin: 0; }
.stamp-box { align-self: flex-start; border: 2px solid var(--rule); padding: var(--space-2) var(--space-3); }
.hero-photo .display { font-size: clamp(40px, 7vw, 68px); line-height: 1.04; letter-spacing: -0.015em; }
.hero .lede { font-size: 19px; line-height: 31px; max-width: 34em; }
.hero-caption { margin-top: var(--space-7); width: 100%; text-align: right; }
.rubber { display: inline-block; border: 2.5px solid #7a1f24; color: #7a1f24; padding: 6px 10px; font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.14em; text-align: center; transform: rotate(-6deg); }

/* How it works */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-6) var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.steps li { border-top: 2px solid var(--rule); padding-top: var(--space-4); }
.steps .num { font-family: var(--font-mono); font-weight: 700; font-size: clamp(44px, 6vw, 64px); line-height: 1; display: block; margin-bottom: var(--space-3); }
.steps p { margin: 0; font-size: 15px; line-height: 24px; }

/* Promises */
.pillars { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.pillars h3 { border-bottom: 2px solid var(--rule); padding-bottom: var(--space-2); margin-bottom: var(--space-3); }
.pillars p { margin: 0; }

/* The cabinet: one manila folder per series, two to a row; photo left, words right */
.cabinet { display: grid; gap: 64px var(--space-6); grid-template-columns: minmax(0, 1fr); padding-top: 26px; }
@media (min-width: 860px) { .cabinet { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.file { position: relative; display: flex; flex-direction: column; color: var(--on-manila); }
.file-tab { position: absolute; top: -26px; left: 0; height: 26px; margin: 0; padding: 0 14px; display: flex; align-items: center; background: var(--manila); border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; }
.file-body { flex: 1 1 auto; background: var(--manila); border: 1px solid var(--line); display: grid; grid-template-columns: clamp(112px, 38%, 240px) minmax(0, 1fr); align-content: start; }
.file-body .label { color: var(--on-manila); }
.file-body p { font-size: 15px; line-height: 24px; margin: 0 0 var(--space-3); }
.file-body .hook { font-style: italic; margin: 0; }
.file-text { padding: 20px 20px 48px; min-width: 0; }
.file-body:last-child .file-text { padding-bottom: 20px; }
.file-text h3 { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.25; }
/* Spot photo per series (site/image-prompts/series-*.txt); the caption under the cabinet carries the honesty line. */
.file-art { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-right: 1px solid var(--line); }
.cabinet-caption { margin-top: var(--space-6); }
/* A series' Case 00 slip, clipped over the bottom of its folder and sticking out past its right edge
   (shown when showTeasers is on).
   White paper with ink in every theme, like the kit's sheets. */
.slip {
  --paper: #fbf8f1; --paper-raised: #ffffff; --ink: #1b1814; --ink-muted: #5c5247; --rule: #1b1814;
  position: relative; margin: -28px calc(-1 * var(--space-3)) 0 var(--space-5); background: var(--paper-raised); color: var(--ink); border: 1px solid var(--rule);
  padding: var(--space-3) var(--space-4); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.slip-text { min-width: 0; flex: 1 1 14em; }
.slip .stamp { font-size: 11px; line-height: 16px; margin: 0 0 var(--space-1); }
.slip .sep { color: var(--ink-muted); }
.slip-title { font-size: 17px; line-height: 24px; font-style: italic; font-weight: 400; margin: 0; }
.slip-title .stat { font-style: normal; font-size: 13px; color: var(--ink-muted); }
.slip .button { flex: none; min-height: 44px; padding: var(--space-2) var(--space-4); font-size: 12px; }

/* The kit, laid flat */
.kit { display: grid; gap: var(--space-5); align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); margin-bottom: var(--space-5); }
.kit figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.kit figcaption { font-size: 15px; line-height: 24px; }
.sheet { background: #ffffff; color: #1b1814; border: 1px solid var(--line); aspect-ratio: 8.5 / 11; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.sheet.mono { font-family: var(--font-mono); font-size: 11px; line-height: 14px; gap: 10px; }
.sheet-head { margin: 0; font-family: var(--font-mono); font-size: 10px; line-height: 14px; font-weight: 700; letter-spacing: 0.16em; }
.sheet-head:first-child { border-bottom: 2px solid #1b1814; padding-bottom: 6px; }
.ln { display: block; height: 5px; background: #1b1814; opacity: 0.16; }
.ln.gap { margin-top: var(--space-2); }
.w60 { width: 60%; } .w66 { width: 66%; } .w74 { width: 74%; } .w80 { width: 80%; }
.w86 { width: 86%; } .w88 { width: 88%; } .w90 { width: 90%; } .w92 { width: 92%; }
.blank { display: block; border-bottom: 1px solid var(--line); height: 14px; }
.tier { font-size: 12px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.stack { position: relative; aspect-ratio: 8.5 / 11; }
.stack .sheet { position: absolute; aspect-ratio: auto; padding: var(--space-3); font-size: 13px; line-height: 18px; }
.stack .s1 { inset: 0 14% 14% 0; } .stack .s2 { inset: 7%; } .stack .s3 { inset: 14% 0 0 14%; }
.sheet.sealed { background: var(--kraft); justify-content: space-between; text-align: center; }
.sheet.sealed .sheet-head { border: 0; text-align: left; }
.rubber.big { align-self: center; position: relative; z-index: 1; font-size: 20px; line-height: 26px; letter-spacing: 0.18em; padding: 4px 12px; background: var(--manila); transform: rotate(-8deg); }
.sheet .small { font-size: 12px; line-height: 17px; }

/* Buttons and the signup */
.button {
  display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 13px; line-height: 18px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  color: var(--paper); background: var(--ink); border: 2px solid var(--ink); border-radius: 0;
  padding: var(--space-3) var(--space-4); min-height: 44px;
}
.button:hover { background: transparent; color: var(--ink); }
.button-outline { color: var(--ink); background: transparent; }
.button-outline:hover { color: var(--paper); background: var(--ink); }
.band .button { color: var(--manila); background: var(--on-manila); border-color: var(--on-manila); }
.band .button:hover { background: transparent; color: var(--on-manila); }
.band .slip .button { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.band .slip .button:hover { background: transparent; color: var(--ink); }
.signup { max-width: 520px; }
.signup > * { margin: 0 0 var(--space-2); }
.signup .label { color: var(--ink); }
.signup form { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.signup form .button { min-height: 52px; }
.signup input[type="email"] {
  flex: 1 1 15em; min-width: 0; min-height: 52px; font-family: var(--font-mono); font-size: 16px; color: var(--ink);
  background: var(--paper-raised); border: 2px solid var(--rule); border-radius: 0; padding: var(--space-3) 14px;
}
.signup input::placeholder { color: var(--ink-muted); opacity: 1; }

/* The closing signup: a short ink band that bookends the hero. */
.evening-grid { display: flex; flex-direction: column; gap: var(--space-5); max-width: 520px; }
.evening-grid > * { min-width: 0; }
.evening .label { color: var(--ink-muted); }
.evening-grid p:last-child { margin-bottom: 0; }

/* Footer, with the process statement: always plain */
footer { padding: var(--space-8) 0 var(--space-6); font-size: 15px; line-height: 24px; color: var(--ink-muted); }
.process { max-width: 44em; margin-bottom: var(--space-7); color: var(--ink); }
.process .line { font-size: 22px; line-height: 30px; font-weight: 700; margin: 0 0 var(--space-3); }
.process p:last-child { font-size: 15px; line-height: 24px; margin: 0; }
.footer-line { border-top: 1px solid var(--line); padding-top: 20px; display: flex; align-items: center; gap: var(--space-3); }
footer p { margin: 0; }

@media print {
  .grain::after, .file-art { display: none; }
  .file-body { grid-template-columns: minmax(0, 1fr); }
  .slip { --paper: #ffffff; --ink: #000000; --ink-muted: #333333; --rule: #000000; }
  .dark { --paper: #ffffff; --paper-raised: #ffffff; --ink: #000000; --ink-muted: #333333; --rule: #000000; --line: #767676; background: none; }
}
