/* Quill & Lantern — site styles. Fonts are self-hosted (SIL Open Font License). */
@font-face { font-family: "Alegreya"; font-weight: 500; font-display: swap; src: url("/fonts/alegreya-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-weight: 700; font-display: swap; src: url("/fonts/alegreya-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-weight: 800; font-display: swap; src: url("/fonts/alegreya-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-display: swap; src: url("/fonts/alegreya-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 500; font-display: swap; src: url("/fonts/alegreya-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 700; font-display: swap; src: url("/fonts/alegreya-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --wood: #22180F;
  --wood-2: #2C2015;
  --wood-3: #3A2A1B;
  --line: #4A3724;
  --ink-light: #F5E9D3;
  --ink-soft: #E3D3B6;
  --ink-quiet: #C9B08A;
  --lantern: #F2B54A;
  --lantern-hi: #FFD58A;
  --parchment: #F3E6CC;
  --parchment-2: #FBF4E6;
  --parchment-line: #DCC69E;
  --ink-dark: #2A1D12;
  --ink-dark-soft: #4A3726;
  --rust: #8A4F1C;
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --sans: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--wood);
  color: var(--ink-light);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
}
img, svg { display: block; }
a { color: var(--lantern); }
a:hover { color: var(--lantern-hi); }
:focus-visible { outline: 3px solid var(--lantern); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1160px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--parchment); color: var(--ink-dark); padding: 8px 14px; border-radius: 8px; z-index: 10; }

/* Header */
.site-header { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-light); }
.brand:hover { color: var(--ink-light); }
.brand .tm { font-family: var(--sans); font-size: 11px; font-weight: 700; vertical-align: super; margin-left: 2px; color: var(--ink-quiet); }
.brand span { font-family: var(--serif); font-size: 24px; font-weight: 800; }
.site-nav { display: flex; flex-wrap: wrap; gap: 24px; font-size: 17px; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* Type */
.eyebrow { font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-quiet); }
h1, h2, h3 { font-family: var(--serif); margin: 0; }
h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; font-weight: 800; }
h2 { font-size: clamp(32px, 4.2vw, 44px); line-height: 1.1; font-weight: 800; }
h3 { font-size: 25px; font-weight: 700; }
p { margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px; border-radius: 12px; font-weight: 700; text-decoration: none; }
.btn-primary { background: var(--lantern); color: var(--wood); }
.btn-primary:hover { background: var(--lantern-hi); color: var(--wood); }
.btn-ghost { border: 2px solid var(--lantern); color: var(--ink-light); }
.btn-ghost:hover { color: var(--ink-light); background: var(--wood-3); }
.btn-dark { background: var(--ink-dark); color: #F7C95C; }
.btn-dark:hover { color: var(--lantern-hi); }

/* Hero */
.hero { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; padding-top: 48px; padding-bottom: 80px; }
.hero-copy { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero-copy .lede { font-size: 21px; color: var(--ink-soft); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { font-size: 15px; color: var(--ink-quiet); }
.hero-art { flex: 1 1 420px; min-width: 0; display: flex; justify-content: center; }
.scene-frame { margin: 0; width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 12px; }
.scene { position: relative; aspect-ratio: 3 / 2; border-radius: 20px; overflow: hidden; border: 2px solid var(--line); background: var(--wood-2); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); }
.scene-base { width: 100%; height: 100%; }
.scene-motion, .scene-motion > * { position: absolute; pointer-events: none; }
.scene-motion { inset: 0; }
.ql-screen, .ql-glow { mix-blend-mode: screen; }
.ql-glow { aspect-ratio: 1; border-radius: 50%; }
.ql-glow.ql-fire { background: radial-gradient(circle, rgba(255, 160, 60, 0.35) 0%, rgba(242, 181, 74, 0) 70%); }
.ql-glow.ql-lamp { background: radial-gradient(circle, rgba(255, 205, 120, 0.35) 0%, rgba(242, 181, 74, 0) 70%); }
.ql-glow.ql-candle { background: radial-gradient(circle, rgba(255, 215, 140, 0.4) 0%, rgba(242, 181, 74, 0) 70%); }
.scene-chips { display: flex; flex-direction: column; gap: 10px; }

/* Common room motion (timings match the style guide) */
@keyframes ql-fire { 0%, 100% { opacity: .55 } 18% { opacity: .85 } 37% { opacity: .6 } 55% { opacity: .9 } 78% { opacity: .62 } }
@keyframes ql-flame { 0%, 100% { opacity: .15; transform: scale(1, 1) } 20% { opacity: .5; transform: scale(1.02, 1.05) } 40% { opacity: .25; transform: scale(.99, .98) } 60% { opacity: .55; transform: scale(1.01, 1.04) } 80% { opacity: .2; transform: scale(1, 1.01) } }
@keyframes ql-lamp { 0%, 100% { opacity: .4 } 40% { opacity: .75 } 70% { opacity: .5 } }
@keyframes ql-candle { 0%, 100% { opacity: .35 } 25% { opacity: .75 } 50% { opacity: .45 } 80% { opacity: .7 } }
@keyframes ql-cat { 0%, 100% { transform: scale(1, 1) } 50% { transform: scale(1.008, 1.03) } }
.ql-glow.ql-fire { animation: ql-fire 3.7s ease-in-out infinite; }
.ql-flame { transform-origin: 50% 85%; animation: ql-flame 2.4s ease-in-out infinite; }
.ql-lamp { animation: ql-lamp 4.2s ease-in-out infinite; }
.ql-candle { animation: ql-candle 3.1s ease-in-out infinite; }
.ql-cat { transform-origin: 50% 90%; animation: ql-cat 4.5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .scene-motion { display: none; } }
.chip-row { width: 100%; border-radius: 14px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chip-row.parchment { background: var(--parchment); color: var(--ink-dark); }
.chip-row.parchment small { color: #6B3E12; font-weight: 700; font-size: 15px; }
.chip-row.wood { background: var(--wood-3); }
.chip-row.wood small { color: var(--ink-quiet); font-size: 15px; }
.chip-row strong { font-weight: 700; white-space: nowrap; }
.chip-row small { text-align: right; }

/* Features */
.parchment-band { background: var(--parchment); color: var(--ink-dark); }
.section { padding-top: 88px; padding-bottom: 88px; display: flex; flex-direction: column; gap: 40px; }
.section-head { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.parchment-band .section-head p { color: #5A4330; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.feature { background: var(--parchment-2); border: 1px solid var(--parchment-line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.feature p { font-size: 17px; color: var(--ink-dark-soft); }

/* Privacy */
.split { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.split > * { flex: 1 1 380px; min-width: 0; }
.split-copy { display: flex; flex-direction: column; gap: 14px; }
.split-copy p { color: var(--ink-soft); }
.checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.checks li { display: flex; gap: 14px; align-items: flex-start; background: var(--wood-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.checks svg { flex-shrink: 0; margin-top: 3px; }

/* Tip jar */
.tip { background: var(--parchment); color: var(--ink-dark); border-radius: 24px; padding: 40px; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; justify-content: space-between; }
.tip-copy { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tip-copy p { color: var(--ink-dark-soft); }
.tip-section { padding-bottom: 88px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { padding-top: 32px; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; font-size: 16px; color: var(--ink-quiet); }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }

/* Long-form pages (privacy, support) */
.page { max-width: 760px; margin: 0 auto; padding: 40px 24px 88px; display: flex; flex-direction: column; gap: 20px; }
.page h1 { font-size: clamp(36px, 5vw, 52px); }
.page h2 { font-size: 30px; margin-top: 24px; }
.page p, .page li { color: var(--ink-soft); }
.page ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.page .meta { color: var(--ink-quiet); font-size: 16px; }
.page strong { color: var(--ink-light); }
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq details { background: var(--wood-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink-light); padding: 12px 0; min-height: 44px; }
.faq details p { padding-bottom: 14px; }
.callout { background: var(--wood-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }

/* Recipe viewer */
.recipe-card { background: var(--parchment); color: var(--ink-dark); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.recipe-card h1 { color: var(--ink-dark); }
.recipe-card .meta { color: #5A4330; }
.recipe-card h2 { color: var(--ink-dark); font-size: 24px; margin-top: 8px; }
.recipe-card li, .recipe-card p { color: var(--ink-dark-soft); }
.recipe-card ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.recipe-instructions { white-space: pre-line; }
.macros { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; }
.macros div { background: #E8D6B3; border-radius: 10px; padding: 10px 4px; }
.recipe-card .macros strong { display: block; font-size: 19px; color: var(--ink-dark); }
.macros span { font-size: 14px; color: #5A4330; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.recipe-card .eyebrow-ink { color: #6B4A2E; }
.btn-ink { background: var(--ink-dark); color: #F7C95C; }
.btn-ink:hover { color: var(--lantern-hi); }
.btn-outline { background: transparent; border: 2px solid #8A4F0C; color: #6B3E12; font: inherit; font-weight: 700; cursor: pointer; }
.btn-outline:hover { background: #E8D6B3; }
.recipe-card .recipe-tags { list-style: none; padding: 0; flex-direction: row; flex-wrap: wrap; gap: 8px; }
.recipe-tags li { border: 1px solid var(--parchment-line); border-radius: 8px; padding: 2px 10px; font-size: 15px; }
.recipe-card ul li { overflow-wrap: anywhere; }
.recipe-card h1 { overflow-wrap: anywhere; }
.page code { font-size: 0.95em; color: var(--ink-light); }
@media print {
  body { background: #fff; }
  .site-header, .site-footer, .recipe-actions, #get-app, .skip { display: none !important; }
  .recipe-card { padding: 0; border-radius: 0; }
  .page > .meta { color: #333; }
}
[hidden] { display: none !important; }

@media (max-width: 520px) {
  .macros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tip { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Safety: images never grow past their container */
img { max-width: 100%; height: auto; }
.scene-base { height: 100%; object-fit: cover; }
.brand-mark { width: auto; height: 44px; filter: drop-shadow(0 0 10px rgba(242, 181, 74, 0.35)); }
