/* Penwright Studio: shared styles for every page on the site.
   Colours are tokens. Dark mode redefines the neutral tokens, and each app
   sets its own accent with <html data-app="..."> (see "App accents" below).
   Page-specific rules stay in each page's <style> block. */

:root {
    --bg: #F5EFE4;
    --surface: #FBF7EE;
    --surface-2: #EEE7D6;
    --line: #D8D0BE;
    --rule: #9A9082;
    --ink: #1F1B16;
    --text: #3D372E;
    --muted: #6A655B;
    --faint: #9A9082;
    --accent: #2D6A4F;
    --accent-strong: #1B4332;
    --accent-ink: #F5EFE4;
    --tint: #EAF2EC;
    --tint-line: #D5E3D8;
    --tint-ink: #1B4332;
    --danger: #A94B37;
    --danger-bg: rgba(169,75,55,0.08);
    --danger-line: rgba(169,75,55,0.35);
    --shadow: 0 6px 24px rgba(45,106,79,0.14);
    --radius: 16px;
    --serif: 'Newsreader', Georgia, serif;
    --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
}

[data-theme="dark"] {
    --bg: #15140F;
    --surface: #1F1D16;
    --surface-2: #2A271E;
    --line: #3D372E;
    --rule: #6A655B;
    --ink: #EDE6D3;
    --text: #C7BFA8;
    --muted: #999283;
    --faint: #6A655B;
    --accent: #74C69D;
    --accent-strong: #95D5B2;
    --accent-ink: #15140F;
    --tint: #22302A;
    --tint-line: #2A3B33;
    --tint-ink: #95D5B2;
    --danger: #E0876A;
    --danger-bg: rgba(224,135,106,0.08);
    --danger-line: rgba(224,135,106,0.35);
    --shadow: 0 6px 24px rgba(0,0,0,0.35);
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--sans); background: var(--bg); color: var(--ink);
    line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column;
}
body::before {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.028;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; box-shadow: 0 0 0 2px var(--bg); border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: 0.87em; background: var(--surface-2); color: var(--ink); padding: 2px 6px; border-radius: 4px; }
main { flex: 1; }
[id] { scroll-margin-top: 84px; }

/* ---------- Launch phase ----------
   pw-boot.js sets data-phase="live" on <html> from launch day.
   .pre = pre-launch only, .live = after launch only. Without JS, pre-launch shows. */
.live { display: none !important; }
[data-phase="live"] .pre { display: none !important; }
[data-phase="live"] .live { display: revert !important; }

/* ---------- Top bar ---------- */
.topbar {
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
    position: sticky; top: 0; z-index: 50;
}
.topbar a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; transition: color 0.2s; }
.topbar a:hover { color: var(--accent); }
.topbar a[aria-current="page"] { color: var(--ink); }
.topbar .studio-name { font-family: var(--serif); font-weight: 600; color: var(--ink); font-size: 16px; }
.topbar-nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.theme-toggle {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink);
    cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), border-color 0.2s;
}
.theme-toggle:hover { transform: rotate(-15deg); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .topbar { background: var(--surface); }
@media (max-width: 560px) {
    .topbar { padding: 12px 16px; }
    .topbar-nav { order: 3; width: 100%; gap: 18px; }
    .topbar .contact-link { display: none; }
}

/* ---------- Type ---------- */
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
h1 { font-family: var(--serif); font-size: 34px; color: var(--ink); margin-bottom: 6px; font-weight: 600; line-height: 1.2; }
h2 { font-family: var(--serif); font-size: 21px; color: var(--ink); font-weight: 600; line-height: 1.3; }
h3 { color: var(--ink); }
.subtitle, .last-updated { color: var(--muted); font-size: 16px; margin-bottom: 12px; }
.last-updated { font-size: 14px; font-style: italic; }
.double-rule { border: 0; border-top: 1px solid var(--line); border-bottom: 2px solid var(--rule); height: 4px; margin: 0 0 32px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none;
    padding: 13px 26px; border-radius: 12px; font-weight: 600; font-size: 16px; border: 0; cursor: pointer;
    font-family: var(--sans); transition: background 0.2s;
}
.btn:hover { background: var(--accent-strong); text-decoration: none; }
.btn-soft {
    display: inline-block; color: var(--tint-ink); background: var(--tint); border: 1px solid var(--tint-line);
    padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; text-decoration: none;
}
.btn-soft:hover { background: var(--tint-line); text-decoration: none; }

/* ---------- Document pages (FAQ, support, legal, press) ---------- */
.doc-main { padding: 48px 24px 60px; }
.container { max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); padding: 48px; border-radius: var(--radius); }
.container h2 { margin-top: 32px; margin-bottom: 12px; }
.container h3 { font-size: 16px; margin-top: 20px; margin-bottom: 8px; font-weight: 600; }
.container p { margin-bottom: 16px; color: var(--text); font-size: 15px; }
.container ul { margin: 16px 0; padding-left: 24px; }
.container li { margin-bottom: 8px; color: var(--text); }
.back-link { display: inline-block; margin-bottom: 24px; font-size: 14px; font-weight: 500; }
.callout, .contact, .contact-card { background: var(--tint); border: 1px solid var(--tint-line); padding: 20px 24px; border-radius: 12px; margin-top: 32px; }
.callout p:last-child, .contact p:last-child, .contact-card p:last-child { margin-bottom: 0; }
.contact-card { margin-top: 0; margin-bottom: 8px; }
.contact-card h2 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; margin: 16px 0 8px; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: top; }
th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
@media (max-width: 768px) {
    .doc-main { padding: 28px 16px 48px; }
    .container { padding: 28px 22px; }
    h1 { font-size: 26px; }
    .container h2 { font-size: 18px; }
    table { font-size: 13px; }
}

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 28px 24px; text-align: center; color: var(--muted); font-size: 13px; }
footer .legal-links { margin-bottom: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }
footer .legal-links a { color: var(--accent); font-weight: 500; }
footer .legal-links a + a::before { content: '\00b7'; color: var(--faint); margin: 0 10px; display: inline-block; }
footer img { max-width: 165px; height: auto !important; margin-top: 14px; filter: grayscale(1); opacity: 0.5; transition: filter 0.3s ease, opacity 0.3s ease; }
footer a:hover img { filter: none; opacity: 1; }

/* ---------- App accents ----------
   The same attribute also works on any element (e.g. an app card on the
   home page), so a card can carry its app's colour inside a neutral page.
   Neutrals come from :root. Each app page sets data-app on <html>.
   Penwright is the default accent (forest green). */
[data-app="penwright"] {
    --accent: #2D6A4F; --accent-strong: #1B4332; --accent-ink: #F5EFE4;
    --tint: #EAF2EC; --tint-line: #D5E3D8; --tint-ink: #1B4332;
}
[data-theme="dark"][data-app="penwright"],
[data-theme="dark"] [data-app="penwright"] {
    --accent: #74C69D; --accent-strong: #95D5B2; --accent-ink: #15140F;
    --tint: #22302A; --tint-line: #2A3B33; --tint-ink: #95D5B2;
}
[data-app="qwiksprint"] {
    --accent: #C2481C; --accent-strong: #9A3712; --accent-ink: #FFF8F2;
    --tint: #FCEBE2; --tint-line: #F6D2BF; --tint-ink: #8A3210;
    --shadow: 0 6px 24px rgba(194,72,28,0.14);
}
[data-theme="dark"][data-app="qwiksprint"],
[data-theme="dark"] [data-app="qwiksprint"] {
    --accent: #FF8A5C; --accent-strong: #FFB08F; --accent-ink: #1A0E08;
    --tint: #3A231A; --tint-line: #4E2E20; --tint-ink: #FFB08F;
    --shadow: 0 6px 24px rgba(0,0,0,0.35);
}
[data-app="lorebible"] {
    --accent: #4A7A55; --accent-strong: #365C3F; --accent-ink: #FBF7EE;
    --tint: #EDF3EA; --tint-line: #D3E3D2; --tint-ink: #2F5337;
    --shadow: 0 6px 24px rgba(74,122,85,0.14);
}
[data-theme="dark"][data-app="lorebible"],
[data-theme="dark"] [data-app="lorebible"] {
    --accent: #9CCBA6; --accent-strong: #BFE0C5; --accent-ink: #13170F;
    --tint: #222C23; --tint-line: #2E3B2F; --tint-ink: #BFE0C5;
    --shadow: 0 6px 24px rgba(0,0,0,0.35);
}

/* ---------- Product pages (app landing pages) ---------- */
.section { max-width: 1040px; margin: 0 auto; padding: 0 24px 72px; }
.section-head { max-width: 620px; margin-bottom: 28px; }
.section-head h2 { font-size: 30px; margin-bottom: 8px; }
.section-head p { color: var(--muted); font-size: 16px; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; padding-top: 64px; }
.hero .icon { width: 72px; height: 72px; border-radius: 17px; box-shadow: var(--shadow); margin-bottom: 20px; }
.hero h1 { font-size: 54px; line-height: 1.08; margin-bottom: 16px; letter-spacing: -0.01em; }
.hero .desc { font-size: 18px; color: var(--muted); line-height: 1.7; margin-bottom: 28px; max-width: 520px; }
.cta-note { font-size: 13px; color: var(--muted); margin: 10px 0 24px; }
.signup-label { font-size: 14px; color: var(--text); margin-bottom: 8px; }
.signup { display: flex; gap: 8px; flex-wrap: wrap; max-width: 440px; }
.signup input { flex: 1 1 220px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; font-size: 15px; color: var(--ink); }
.signup button { padding: 11px 18px; border: 0; border-radius: 10px; background: var(--ink); color: var(--bg); font: inherit; font-weight: 600; cursor: pointer; }
.signup-msg { font-size: 14px; color: var(--accent); font-weight: 600; }
.hero-shot { justify-self: center; width: 100%; max-width: 330px; }
.hero-shot img { display: block; width: 100%; height: auto; border-radius: 20px; box-shadow: var(--shadow); }

/* Promises */
.promises { display: flex; flex-wrap: wrap; gap: 8px 10px; list-style: none; margin-top: 28px; }
.promises li { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tint-ink); background: var(--tint); border: 1px solid var(--tint-line); padding: 5px 10px; border-radius: 20px; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 20px; }
.feature h3 { font-family: var(--serif); font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.feature p { font-size: 14.5px; color: var(--text); }
.feature .pro { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--accent); border: 1px solid var(--accent); border-radius: 10px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.also { margin-top: 18px; font-size: 14.5px; color: var(--muted); }

/* Gallery */
.gallery { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; list-style: none; scrollbar-width: thin; }
.gallery li { flex: 0 0 220px; scroll-snap-align: start; }
.gallery img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); }

/* Pricing summary: one line per plan, details live on pricing.html */
.plans-lite { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plan-lite { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.plan-lite.pro { border-color: var(--accent); }
.plan-lite h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.plan-lite .price { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 2px 0 8px; }
.plan-lite .price span { font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--muted); }
.plan-lite p { font-size: 14.5px; color: var(--text); }
.plans-more { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Developer note */
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 36px; max-width: 720px; }
.note h2 { margin-bottom: 4px; }
.note .double-rule { margin: 12px 0 18px; }
.note p { font-size: 16px; color: var(--text); line-height: 1.75; margin-bottom: 12px; }
.note p:last-child { margin-bottom: 0; }

/* Closing call to action */
.closing { text-align: center; background: var(--tint); border: 1px solid var(--tint-line); border-radius: var(--radius); padding: 44px 24px; }
.closing h2 { font-size: 30px; margin-bottom: 8px; }
.closing p { color: var(--text); margin-bottom: 20px; }

@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; }
    .hero-shot { max-width: 260px; }
    .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .section { padding: 0 16px 56px; }
    .hero h1 { font-size: 40px; }
    .hero .desc { font-size: 16px; }
    .section-head h2, .closing h2 { font-size: 25px; }
    .features, .plans-lite { grid-template-columns: 1fr; }
    .note { padding: 24px 22px; }
    .gallery li { flex-basis: 200px; }
}

/* Promise chips and badges reused on the home page */
.pill { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; font-weight: 600; }
.pill.ok { color: var(--tint-ink); background: var(--tint); border: 1px solid var(--tint-line); }
.pill.soon { color: #7A5A1E; background: #F7ECD6; border: 1px solid #EBD8B0; }
[data-theme="dark"] .pill.soon { color: #E3C48A; background: #33291B; border-color: #4A3B24; }

/* Tier list with ticks, for pricing cards */
.ticks { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ticks li { font-size: 14.5px; color: var(--text); padding-left: 22px; position: relative; }
.ticks li::before { content: '\2713'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
