/* Three Things — site styles
   Palette and type follow the app: forest green #3A5A40, cream "3", paper #F6F7F4.
   Fonts are self-hosted (no Google requests, GDPR-friendly for Germany). */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #F6F7F4;      /* page background (app splash color) */
  --card: #FFFFFF;       /* entry card */
  --ink: #1D261F;        /* body text, green-black */
  --muted: #5B6957;      /* secondary text (5.4:1 on paper) */
  --forest: #3A5A40;     /* brand green: links, numerals, buttons */
  --forest-ink: #EFE7D4; /* cream text on green */
  --rule: #DCE0D6;       /* hairlines */
  --tint: #ECEFE7;       /* quiet panels */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --measure: 40rem;      /* reading column (~68 characters) */
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}

/* Dark mode: people journal at night, so the guides should be easy on the eyes */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151B16;
    --card: #1C241D;
    --ink: #E4E8DF;
    --muted: #A3AE9E;
    --forest: #9BBE9F;
    --forest-ink: #151B16;
    --rule: #2C362D;
    --tint: #1C241D;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.1875rem;          /* 19px: comfortable serif reading size */
  line-height: 1.62;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--forest); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-weight: 420; line-height: 1.12; letter-spacing: -0.012em; margin: 0; }
h1 { font-size: clamp(2.5rem, 6.2vw, 4.6rem); font-weight: 380; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; font-weight: 500; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--card); padding: .5rem .75rem; z-index: 10; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: var(--measure); }

/* ---------- Header ---------- */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 1.25rem; padding-bottom: 1.25rem;
  font-family: var(--sans); font-size: .95rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
/* the app icon, rebuilt in CSS: cream italic "3" on forest green */
.brand-mark {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: .5rem;
  background: #3A5A40; color: #EFE7D4;
  font-family: var(--serif); font-style: italic; font-size: 1.35rem; line-height: 1; padding-top: .12rem;
}
.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 1rem;
  background: #3A5A40; color: #EFE7D4; text-decoration: none;
  padding: .85rem 1.35rem; border-radius: 999px;
  transition: background-color .15s ease;
}
.btn:hover { background: #2F4A34; }
.btn-light { background: #EFE7D4; color: #2A3F2E; }
.btn-light:hover { background: #FFFFFF; }
.btn-quiet {
  font: 500 .95rem var(--sans); color: var(--forest); background: none;
  border: 1px solid var(--rule); border-radius: 999px; padding: .5rem 1rem; cursor: pointer;
}
.btn-quiet:hover { border-color: var(--forest); }
.fine { font-family: var(--sans); font-size: .9rem; color: var(--muted); }

/* ---------- Home: hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(2rem, 6vw, 5rem);
  align-items: center; padding-top: clamp(2rem, 7vw, 6rem); padding-bottom: clamp(3rem, 8vw, 7rem);
}
.hero h1 { margin-bottom: 1.5rem; font-size: clamp(2.5rem, 5vw, 3.9rem); }
.lede { font-size: clamp(1.2rem, 1.8vw, 1.4rem); line-height: 1.5; max-width: 32rem; }
.cta-row { margin: 1.75rem 0 .75rem; }

/* The example entry: the one memorable element. Lines appear one after another on load. */
.entry {
  margin: 0; background: var(--card); border: 1px solid var(--rule); border-radius: 1.25rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.entry-date { font-family: var(--sans); font-size: .9rem; color: var(--muted); margin-bottom: 1.25rem; }
.entry-lines { list-style: none; counter-reset: line; margin: 0; padding: 0; }
.entry-lines li {
  counter-increment: line; display: grid; grid-template-columns: 2.25rem 1fr; align-items: baseline;
  padding: .9rem 0; border-top: 1px solid var(--rule); font-size: 1.15rem; line-height: 1.45;
}
.entry-lines li:first-child { border-top: 0; padding-top: 0; }
.entry-lines li::before {
  content: counter(line); font-style: italic; font-size: 1.9rem; line-height: 1; color: var(--forest);
}
@media (prefers-reduced-motion: no-preference) {
  .entry-lines li { animation: write-in .7s cubic-bezier(.2,.7,.2,1) both; }
  .entry-lines li:nth-child(1) { animation-delay: .25s; }
  .entry-lines li:nth-child(2) { animation-delay: .85s; }
  .entry-lines li:nth-child(3) { animation-delay: 1.45s; }
  @keyframes write-in { from { opacity: 0; transform: translateY(.35rem); } to { opacity: 1; transform: none; } }
}

/* ---------- Home: sections ---------- */
.band { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(1rem, 3vw, 2rem); border-top: 1px solid var(--rule); }
.band-title { margin-bottom: 2rem; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 3rem); }
.trio h3 { margin-bottom: .6rem; }
.trio p { color: var(--muted); font-size: 1.05rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); }
.split h2 { margin-bottom: 1rem; }

.guide-list { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.guide-list li { padding: 1rem 0; border-top: 1px solid var(--rule); }
.guide-list li:first-child { border-top: 0; padding-top: 0; }
.guide-list a { font-size: 1.3rem; text-decoration: none; }
.guide-list a:hover { text-decoration: underline; }
.guide-list span { display: block; color: var(--muted); font-size: 1rem; margin-top: .15rem; }

/* ---------- FAQ (details/summary) ---------- */
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1rem 2rem 1rem 0; position: relative;
  font-size: 1.15rem; font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: .85rem; font-family: var(--sans); color: var(--forest); font-size: 1.3rem; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--muted); margin: 0 0 1.1rem; max-width: 36rem; }

/* ---------- Articles ---------- */
.article { max-width: var(--measure); margin: 0 auto; padding: clamp(1.5rem, 5vw, 4rem) var(--gutter) 2rem; box-sizing: content-box; }
.article-head { margin-bottom: 2.5rem; }
.article-head h1 { font-size: clamp(2.3rem, 5.4vw, 3.6rem); margin-bottom: 1rem; }
.dek { font-size: 1.3rem; line-height: 1.45; color: var(--muted); margin-bottom: 1.25rem; }
.byline { font-family: var(--sans); font-size: .88rem; color: var(--muted); margin: 0; }
.article h2 { margin: 2.75rem 0 1rem; }
.article ul, .article ol { padding-left: 1.25rem; margin: 0 0 1.25rem; }
.article li { margin-bottom: .5rem; }

/* Numbered steps: real sequences only (how-to, challenge rules) */
.steps { list-style: none; counter-reset: step; padding-left: 0 !important; }
.steps li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: 1rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -.15rem;
  font-style: italic; font-size: 1.7rem; line-height: 1; color: var(--forest);
}

/* Prompt lists: one prompt per line, hairline separators */
.prompts { list-style: none; padding-left: 0 !important; border-top: 1px solid var(--rule); }
.prompts li { margin: 0 !important; padding: .7rem 0; border-bottom: 1px solid var(--rule); line-height: 1.45; }

/* 30-day challenge list */
.days { list-style: none; padding-left: 0 !important; }
.days li { display: grid; grid-template-columns: 4.5rem 1fr; gap: .5rem; padding: .7rem 0; margin: 0 !important; border-bottom: 1px solid var(--rule); line-height: 1.45; }
.day { font-family: var(--sans); font-size: .85rem; color: var(--forest); font-weight: 600; padding-top: .2rem; }

.tips { padding-left: 1.1rem; }
.tips li { margin-bottom: .8rem !important; }

/* Example entries in the guide */
.example { border-left: 2px solid var(--forest); padding: .25rem 0 .25rem 1.25rem; margin: 1.5rem 0; }
.example-title { font-weight: 600; margin-bottom: .5rem; }
.example ol { margin: 0; }
.why { display: block; color: var(--muted); font-style: italic; font-size: 1.02rem; }

/* Category links at the top of long lists */
.toc { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 1rem; font-family: var(--sans); font-size: .9rem; }
.toc a { text-decoration: none; border: 1px solid var(--rule); border-radius: 999px; padding: .35rem .8rem; color: var(--ink); }
.toc a:hover { border-color: var(--forest); color: var(--forest); }
.print-row { margin: 0 0 1rem; }

/* Printable journal template (German page) */
.template { border: 1px solid var(--rule); border-radius: 1rem; padding: 1.25rem 1.5rem; margin: 1.25rem 0 1.5rem; background: var(--card); }
.template-line { border-bottom: 1px solid var(--rule); min-height: 2.6rem; display: flex; align-items: flex-end; margin: 0; padding-bottom: .3rem; }
.template-line span { font-family: var(--sans); font-size: .85rem; color: var(--muted); }
.template-why { padding-left: 1.5rem; }

/* In-article call to action: the app, in its own colors */
.cta-box {
  background: #3A5A40; color: #EFE7D4; border-radius: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.25rem); margin: 2.75rem 0;
}
.cta-box h2 { margin: 0 0 .75rem !important; font-size: 1.7rem; color: #EFE7D4; }
.cta-box p { color: #D7E2D0; }
.cta-box .btn { margin-top: .5rem; }

.sources { font-size: .95rem; color: var(--muted); padding-left: 1.1rem; }
.sources li { margin-bottom: .6rem !important; }

/* Related guides at the end of an article */
.related { border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1.5rem; }
.related h2 { font-size: 1.3rem; margin: 0 0 1rem !important; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--rule); margin-top: 4rem; padding-top: 2rem; padding-bottom: 3rem; font-family: var(--sans); font-size: .9rem; color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: .45rem; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }
.foot-title { color: var(--ink); font-weight: 600; margin-bottom: .6rem; }

/* ---------- Small screens ---------- */
@media (max-width: 52rem) {
  .hero, .split { grid-template-columns: 1fr; }
  .trio { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 30rem) {
  body { font-size: 1.125rem; }
  .site-nav { gap: .9rem; font-size: .9rem; }
  .site-nav .nav-optional { display: none; }  /* keep only the language switch on phones */
  .days li { grid-template-columns: 3.75rem 1fr; }
}

/* ---------- Print: just the prompts ---------- */
@media print {
  :root { --paper: #fff; --ink: #000; --muted: #333; --rule: #bbb; --forest: #000; }
  .site-head, .site-foot, .cta-box, .toc, .print-row, .related, .faq, .sources { display: none !important; }
  body { font-size: 11pt; }
  .article { padding: 0; max-width: none; }
  .prompts li, .days li { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
