/* =====================================================================
   Diginotes — platform styles (everything that isn't a scrapbook page)
   Layout idea: an editorial, type-led page. Big serif statements set
   asymmetrically against the live scrapbook, with lots of air.
   ===================================================================== */

@font-face { font-family: "Instrument Serif"; src: url("/assets/fonts/instrument-serif-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/assets/fonts/instrument-serif-400i.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument-sans-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument-sans-700.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Crimson Pro"; src: url("/assets/fonts/crimson-pro-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Crimson Pro"; src: url("/assets/fonts/crimson-pro-400i.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Italiana"; src: url("/assets/fonts/italiana-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nothing You Could Do"; src: url("/assets/fonts/nothing-you-could-do.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("/assets/fonts/dm-mono-400.woff") format("woff"); font-weight: 400; font-display: swap; }

:root {
  --paper: #F4F0E8;
  --paper-2: #EAE4D8;
  --paper-3: #FBF9F4;
  --ink: #1C1A17;
  --ink-2: #5E594F;
  --ink-3: #8C8577;
  --line: #D8D0C1;
  --accent: #7A2E3A;
  --good: #3E6B48;
  --bad: #A5372B;

  --display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4.5vw, 64px);
  --ease: cubic-bezier(.2, .7, .15, 1);
  --radius: 4px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.display { font-family: var(--display); font-weight: 400; font-size: clamp(3rem, 7.2vw, 7rem); line-height: .93; letter-spacing: -.018em; margin: 0; text-wrap: balance; }
.display em, .display-2 em { font-style: italic; }
.display-2 { font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 6vw, 5.6rem); line-height: .98; letter-spacing: -.012em; margin: 0; text-wrap: balance; }
.display-3 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4.2vw, 3.6rem); line-height: 1.02; margin: 0; text-wrap: balance; }
.eyebrow { font: 400 12px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.5; color: var(--ink-2); max-width: 32ch; margin: 0; text-wrap: pretty; }
.fine { font-size: 14px; color: var(--ink-3); margin: 0; }

/* ---------- brand ---------- */
.logo { font-family: var(--display); font-size: 30px; line-height: 1; text-decoration: none; letter-spacing: -.01em; display: inline-flex; align-items: baseline; gap: 1px; }
.logo-seal { display: inline-block; width: .26em; height: .26em; border-radius: 50%; background: var(--accent); transform: translateY(-.02em); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: var(--radius);
  background: var(--ink); color: var(--paper-3); border: 1px solid var(--ink);
  font: 700 15px/1 var(--sans); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: transform .3s var(--ease), background .3s, box-shadow .3s;
}
.btn .arr { transition: transform .3s var(--ease); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -14px rgba(28, 26, 23, .7); }
.btn:hover .arr { transform: translateX(3px); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-light { background: transparent; color: var(--ink); border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.btn-light:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.link-btn { background: none; border: 0; padding: 12px 2px; cursor: pointer; font: 700 15px/1 var(--sans); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; border-bottom: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); transition: border-color .25s; }
.link-btn:hover { border-color: var(--ink); }
.text-btn { background: none; border: 0; padding: 8px 0; cursor: pointer; font: 400 14px/1.2 var(--sans); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.text-btn:hover { color: var(--ink); }

/* ---------- header ---------- */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px var(--gutter); position: relative; z-index: 5; }
.site-nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); font-size: 15px; }
.site-nav a:not(.btn) { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.site-nav a:not(.btn):hover { color: var(--ink); }
@media (max-width: 640px) { .site-nav a:not(.btn) { display: none; } }

/* ---------- homepage hero ---------- */
.hero { display: grid; gap: clamp(36px, 5vw, 72px); padding: clamp(16px, 4vw, 48px) var(--gutter) clamp(56px, 8vw, 120px); align-items: center; }
.hero-copy { display: grid; gap: 28px; align-content: center; max-width: 780px; }
.hero-copy .display em { color: var(--accent); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
@media (min-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); padding-top: clamp(24px, 4vw, 56px); }
  .hero-copy { padding-bottom: 40px; }
}

/* the live book */
.book { display: grid; gap: 16px; justify-items: center; }
.book-frame {
  position: relative; width: 100%; max-width: 540px; aspect-ratio: 4 / 5;
  border-radius: 3px; background: var(--paper-2);
  box-shadow: 0 1px 1px rgba(28, 26, 23, .08), 0 30px 60px -30px rgba(28, 26, 23, .55), 0 18px 30px -24px rgba(28, 26, 23, .3);
}
.book-frame::before, .book-frame::after { content: ""; position: absolute; inset: 0; border-radius: 3px; background: var(--paper-3); z-index: -1; box-shadow: 0 1px 2px rgba(28, 26, 23, .12); }
.book-frame::before { transform: translate(8px, 7px) rotate(1.2deg); }
.book-frame::after { transform: translate(15px, 13px) rotate(2.2deg); background: #E3DCCE; }
.book-frame > .sb { border-radius: 3px; }
@media (max-width: 560px) {
  .book-frame { aspect-ratio: 3 / 4.3; }
  .book-frame::before { transform: translate(5px, 5px) rotate(1deg); }
  .book-frame::after { transform: translate(9px, 9px) rotate(1.8deg); }
}
.theme-switch { display: inline-flex; padding: 4px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-3); }
.theme-switch button { border: 0; background: none; cursor: pointer; padding: 9px 16px; border-radius: 999px; font: 400 14px/1 var(--sans); color: var(--ink-2); transition: background .25s, color .25s; min-height: 38px; }
.theme-switch button[aria-checked="true"] { background: var(--ink); color: var(--paper-3); }
.theme-switch button:hover:not([aria-checked="true"]) { color: var(--ink); }
.book-caption { font-size: 13px; color: var(--ink-3); margin: 0; text-align: center; }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 10vw, 150px) var(--gutter); border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 18px; max-width: 900px; margin-bottom: clamp(36px, 5vw, 72px); }
.section-head p:not(.eyebrow) { color: var(--ink-2); max-width: 44ch; margin: 0; font-size: 1.1rem; }

.style-row { display: grid; gap: clamp(40px, 4vw, 56px); }
@media (min-width: 820px) { .style-row { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; } .style-row > :nth-child(2) { margin-top: 72px; } }
.style-card { display: grid; gap: 18px; }
.style-card .mini-holder { border-radius: 3px; box-shadow: 0 24px 50px -30px rgba(28, 26, 23, .6); cursor: pointer; transition: transform .5s var(--ease); }
.style-card:hover .mini-holder { transform: translateY(-4px) rotate(-.4deg); }
.style-meta { display: grid; gap: 6px; }
.style-meta h3 { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1; margin: 0; }
.style-meta p { margin: 0; color: var(--ink-2); }
.traits { font: 12px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

.how { display: grid; gap: 48px; }
@media (min-width: 900px) { .how { grid-template-columns: .8fr 1.2fr; align-items: start; } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { display: grid; grid-template-columns: 64px 1fr; gap: 12px 20px; padding: 26px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.step-n { font: 13px/1.9 var(--mono); color: var(--accent); letter-spacing: .1em; }
.steps h3 { font-family: var(--display); font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.05; margin: 0 0 6px; }
.steps p { margin: 0; color: var(--ink-2); max-width: 46ch; }

.occ-cloud { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 .35em; font-family: var(--display); font-size: clamp(2.2rem, 6.4vw, 6rem); line-height: 1.12; letter-spacing: -.01em; }
.occ-cloud li:not(:last-child)::after { content: "/"; color: var(--line); margin-left: .35em; }
.occ-cloud a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 92% / 0 1px no-repeat; transition: background-size .45s var(--ease), color .25s; }
.occ-cloud a:hover { background-size: 100% 1px; color: var(--accent); }
.occ-cloud li:nth-child(even) a { font-style: italic; }

.closing { text-align: left; display: grid; gap: 34px; justify-items: start; }
.closing .display-2 { max-width: 14ch; }

.site-foot { padding: 40px var(--gutter) calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; font-size: 14px; color: var(--ink-2); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }

/* ---------- full-screen example overlay ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: #0D0C0B; }
.overlay-bar { position: absolute; top: 0; left: 0; right: 0; height: calc(56px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 8px 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #F2ECE3; background: #0D0C0B; border-bottom: 1px solid rgba(242, 236, 227, .12); }
.overlay-tag { font: 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overlay-close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(242, 236, 227, .25); background: none; color: inherit; cursor: pointer; display: grid; place-items: center; flex: none; }
.overlay-close:hover { border-color: #F2ECE3; }
.overlay-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.overlay-book { position: absolute; left: 0; right: 0; bottom: 0; top: calc(56px + env(safe-area-inset-top, 0px)); }
.overlay .viewer-full .vw-bar { top: calc(56px + env(safe-area-inset-top, 0px)); }

/* ---------- forms ---------- */
.field { display: grid; gap: 10px; }
.field > label, .field > .label { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.05; }
.field .hint { font-size: 14px; color: var(--ink-3); margin: -4px 0 0; }
.input, .textarea {
  width: 100%; font: 400 1.15rem/1.45 var(--sans); color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  border-radius: 0; padding: 10px 0 12px; transition: border-color .25s, background .25s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: .8; }
.input:focus, .textarea:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
.textarea { resize: vertical; min-height: 7.5em; border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); padding: 14px 16px; border-radius: var(--radius); background: var(--paper-3); }
.textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field.has-error .input, .field.has-error .textarea { border-color: var(--bad); }
.field-error { color: var(--bad); font-size: 14px; margin: 0; }
.count { font: 12px var(--mono); color: var(--ink-3); justify-self: end; font-variant-numeric: tabular-nums; }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--paper-3); padding: 13px 18px; border-radius: var(--radius); font-size: 15px; display: flex; gap: 16px; align-items: center; transition: opacity .3s, transform .3s var(--ease); pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px; }

/* ---------- share sheet ---------- */
.share { display: grid; gap: 12px; }
.share-link { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-3); overflow: hidden; }
.share-link input { flex: 1; min-width: 0; border: 0; background: none; padding: 12px 14px; font: 14px var(--mono); color: var(--ink); }
.share-link input:focus { outline: none; }
.share-link button { border: 0; border-left: 1px solid var(--line); background: none; padding: 0 16px; cursor: pointer; font-weight: 700; font-size: 14px; white-space: nowrap; }
.share-link button:hover { background: var(--paper-2); }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.share-actions .btn { min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
