/* The landing page (candlewriter.com), on candle.css's colours and type. */
body.landing { background: var(--window); }
.landing main { overflow: hidden; }
.top.site { max-width: 1120px; padding: 18px 24px; }
.top.site .brand { font-size: 1.3rem; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a:not(.button) { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav a:not(.button):hover { color: var(--accent); }
a.button.big { padding: 12px 20px; font-size: 1.02rem; border-radius: 10px; }
.center { text-align: center; justify-content: center; }

/* Hero */
.hero { max-width: 1120px; margin: 0 auto; padding: 56px 24px 72px; display: grid; grid-template-columns: 1.05fr 1fr;
        gap: 48px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: .82rem; margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.08; margin: 0 0 18px; letter-spacing: -.02em; }
.lead { font: 1.2rem/1.6 var(--serif); color: var(--ink); margin: 0 0 26px; max-width: 34em; }
.cta { gap: 12px; margin-bottom: 14px; }

/* A drawing of Candle's editor */
.mock { display: grid; grid-template-columns: 34px 150px 1fr; min-height: 320px; border: 1px solid var(--line); border-radius: 16px;
        overflow: hidden; background: var(--surface); box-shadow: 0 24px 60px rgb(38 36 31 / .12), var(--shadow); transform: rotate(-1deg); }
.mock-rail { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; padding: 14px 9px; }
.mock-rail span { height: 16px; border-radius: 5px; background: var(--line); }
.mock-rail span.on { background: var(--accent); }
.mock-outline { background: var(--side); border-right: 1px solid var(--line); padding: 14px 10px; font-size: .74rem; line-height: 2.1;
                color: var(--muted); display: flex; flex-direction: column; }
.mock-outline b { font: 600 .8rem var(--serif); color: var(--ink); margin-top: 6px; }
.mock-outline i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--muted); margin-right: 6px; }
.mock-outline .dot.done { background: var(--ok); border-color: var(--ok); }
.mock-outline .dot.progress { background: var(--warn); border-color: var(--warn); }
.mock-sheet { padding: 26px 26px 22px; font: .9rem/1.75 var(--serif); background: var(--sheet); }
.mock-sheet p { margin: 0 0 .7em; }
.mock-title { font-weight: 600; font-size: 1.05rem; }
.mock-break { text-align: center; color: var(--muted); letter-spacing: .3em; }
.caret { display: inline-block; width: 2px; height: 1.1em; vertical-align: -3px; margin-left: 2px; background: var(--accent);
         animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } .mock { transform: none; } }

/* Bands */
.band { max-width: 1120px; margin: 0 auto; padding: 64px 24px; }
.band.narrow { max-width: 760px; }
.band > h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); text-align: center; margin-bottom: 12px; }
.section-lead { text-align: center; color: var(--muted); font-size: 1.08rem; max-width: 40em; margin: 0 auto 36px; }
.steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.step { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--soft);
        color: var(--accent); font-weight: 700; margin-bottom: 12px; }
.steps h3, .features h3 { font-size: 1.12rem; margin: 0 0 8px; }
.steps p, .features p { color: var(--muted); margin: 0; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.features article { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
                    transition: border-color .15s, transform .15s; }
.features article:hover { border-color: var(--highlight); transform: translateY(-2px); }
.premium-band { background: var(--soft); border-radius: 28px; max-width: 1072px; margin: 32px auto; padding: 56px 40px; }
.premium-head { text-align: center; }
.premium-head .badge { margin-bottom: 14px; }
.premium-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); margin-bottom: 12px; }
.price { display: block; margin-top: 6px; color: var(--ink); font-weight: 600; }
.premium-features { margin-bottom: 30px; }

/* Lighter at work (the script in landing.html plays it) */
.lighter-demo { margin: 34px auto 40px; max-width: 880px; }
.demo-stage { display: grid; grid-template-columns: 1fr 1.15fr; gap: 18px; align-items: stretch; }
.demo-sheet, .demo-chat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.demo-sheet { padding: 22px 24px; font: .95rem/1.6 var(--serif); display: flex; flex-direction: column; }
.demo-label { margin: 0; font: 600 .75rem var(--ui); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.demo-name { margin: 4px 0 10px; font-weight: 600; font-size: 1.25rem; }
.demo-text { margin: 0 0 8px; }
.demo-new { border-radius: 6px; padding: 2px 6px; margin-left: -6px; }
.demo-new.on { background: var(--highlight); animation: settle 2.4s ease-out forwards; }
@keyframes settle { to { background: transparent; } }
.demo-goal { margin-top: auto; padding-top: 16px; font: .85rem var(--ui); color: var(--muted); }
.demo-goal p { margin: 6px 0 0; }
.demo-bar { height: 8px; border-radius: 99px; background: var(--alt); overflow: hidden; }
.demo-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ok); transition: width 1.4s ease-out; }
.met .demo-bar span { width: 100%; }
.demo-chat { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; min-height: 330px; }
.demo-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.demo-head .figure { width: 26px; height: 35px; }
.demo-head b { font: 600 1.05rem var(--serif); }
.demo-chat .bubble { margin: 0; font-size: .95rem; }
.demo-save { display: flex; flex-direction: column; gap: 8px; }
.demo-save .row { gap: 6px; }
.demo-button { font: 600 .85rem var(--ui); padding: 5px 12px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
               transition: transform .15s, filter .15s; }
.demo-button.quiet { background: var(--alt); color: var(--ink); }
.demo-button.pressed { transform: scale(.94); filter: brightness(.9); }
.lighter-demo [data-at] { opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; }
.lighter-demo [data-at].on { opacity: 1; transform: none; }
.lighter-demo [data-at].gone { display: none; }
.lighter-demo figcaption { text-align: center; color: var(--muted); margin-top: 14px; }

/* Lighter for Android, in a phone */
.phone-demo { display: flex; justify-content: center; margin: 0 auto 44px; text-align: center; }
.phone { flex: none; width: 250px; padding: 10px; border-radius: 38px; background: #26241f; box-shadow: 0 18px 44px rgb(38 36 31 / .22); }
.phone video { display: block; width: 100%; height: auto; aspect-ratio: 720 / 1600; border-radius: 29px; background: #f8f7f4; }
.phone-text { max-width: 560px; }
/* In the hero: standing in front of the editor's lower right corner */
.hero-art { position: relative; padding: 0 124px 64px 0; }
.hero-phone { position: absolute; right: 0; bottom: 0; width: 200px; padding: 8px; border-radius: 32px; transform: rotate(2deg); }
.hero-phone video { border-radius: 25px; }
.phone-text h3 { font: 600 1.4rem var(--serif); margin: 0 0 10px; }
.phone-text p { margin: 0 0 10px; }
@media (prefers-reduced-motion: reduce) {
  .lighter-demo [data-at], .demo-bar span, .demo-button { transition: none; }
  .demo-new.on { animation: none; background: transparent; }
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.split h2 { font-size: 1.5rem; }
.split p { color: var(--muted); font-size: 1.02rem; }
#download .downloads { margin-top: 28px; }
.command { display: flex; gap: 6px; align-items: stretch; }
.command code { flex: 1; padding: 7px 9px; overflow-wrap: anywhere; user-select: all; }
details { border-bottom: 1px solid var(--line); padding: 16px 0; }
details summary { cursor: pointer; font: 600 1.08rem var(--serif); list-style: none; display: flex; justify-content: space-between; }
details summary::after { content: "+"; color: var(--accent); font-weight: 400; }
details[open] summary::after { content: "–"; }
details p { color: var(--muted); margin: 10px 0 0; }
.site-footer { max-width: 1120px; margin: 32px auto 0; padding: 28px 24px 40px; border-top: 1px solid var(--line);
               display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.site-footer .brand { display: inline-flex; align-items: center; gap: 8px; font: 600 1.05rem var(--serif); color: var(--ink); text-decoration: none; }
.site-footer nav { gap: 18px; }
.site-footer nav a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.site-footer nav a:hover { color: var(--accent); }
.site-footer .languages { flex-basis: 100%; gap: 6px 16px; flex-wrap: wrap; }
.site-footer .languages a[aria-current] { color: var(--ink); font-weight: 600; }
.site-nav .globe { font-size: 1.05rem; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .site-nav a:not(.button) { display: none; }
  .steps, .features, .split { grid-template-columns: 1fr; }
  .premium-band { border-radius: 0; padding: 48px 20px; }
  .demo-stage { grid-template-columns: 1fr; }
  .demo-chat { order: -1; min-height: 0; }
  .hero-art { padding: 0 0 0; display: flex; justify-content: center; }
  .hero-art .mock { display: none; }
  .hero-phone { position: static; width: 230px; transform: none; }
  .mock { grid-template-columns: 0 0 1fr; min-height: 0; }
  .band { padding: 48px 20px; }
}

/* Asking about analytics cookies */
.consent { position: fixed; z-index: 30; left: 16px; right: 16px; bottom: 16px; max-width: 520px; margin: 0 auto;
           background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
           box-shadow: 0 12px 40px rgb(38 36 31 / .16); }
.consent p { margin: 0 0 12px; font-size: .95rem; }
.consent .row { justify-content: flex-end; }

/* Guides (pages.py): an article column, a calculator, a way into Candle */
.article { max-width: 760px; margin: 0 auto; padding: 40px 24px 24px; overflow: visible; }
.article-head h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); line-height: 1.12; margin: 0 0 16px; letter-spacing: -.015em; }
.article h2 { font-size: 1.55rem; margin: 48px 0 12px; }
.article h3 { font-size: 1.12rem; margin: 26px 0 8px; }
.article p, .article li { font: 1.04rem/1.65 var(--serif); }
.article ol, .article ul { padding-left: 1.4em; }
.article li { margin: 4px 0; }
.toc { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--line);
       border-bottom: 1px solid var(--line); }
.toc a { color: var(--accent); text-decoration: none; font-weight: 500; }
.cta-box { background: var(--soft); border-radius: 20px; padding: 28px; margin: 56px 0 16px; }
.cta-box h2 { margin-top: 0; }
.cta-box .row { gap: 12px; flex-wrap: wrap; }
.calc { display: grid; grid-template-columns: 2fr 1.3fr 1fr; gap: 0 14px; margin-top: 28px; }
.results { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 0; }
.results div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.results dt { color: var(--muted); font-size: .85rem; font-weight: 600; }
.results dd { margin: 4px 0 0; font: 600 1.15rem var(--serif); }
.results.stale dd { opacity: .4; }
.article .error { color: var(--error); }
.table-wrap { overflow-x: auto; }
@media (max-width: 640px) {
  .calc, .results { grid-template-columns: 1fr; }
  .article { padding: 28px 16px 16px; }
}

/* Japanese: break headings between phrases, not inside words (where the browser can) */
:lang(ja) :is(h1, h2, h3) { word-break: auto-phrase; }
