/* Pellet Log — pelletlog.app
   Mobile-first; desktop layout from 768px. Light/dark via data-theme on <html>,
   falling back to the system preference when the visitor has not chosen. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff") format("woff");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope.woff") format("woff");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --track: #F1ECE3;
  --border: #E9E2D3;
  --text: #1F1A14;
  --muted: #4D4438;
  --accent: #B85416;
  --accent-hover: #8C3F0F;
  --accent-2: #8C3F0F;
  --tint: #F4E4D6;
  --ok: #5C8A6B;
  --frame: #1F1A14;
  --ink: #1F1A14;
  --ink-border: #1F1A14;
  --header-bg: rgba(250, 247, 242, 0.88);
  --shadow: rgba(120, 55, 10, 0.35);
  --shadow-strong: rgba(120, 55, 10, 0.55);

  --font-head: "Manrope", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 40px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #100D0B;
  --surface: #1A1612;
  --track: #241E19;
  --border: #2E2721;
  --text: #F4EEE6;
  --muted: #B8AC9C;
  --accent: #FF9A52;
  --accent-hover: #FFB37A;
  --accent-2: #FFB37A;
  --tint: #2B1E14;
  --ok: #86C98E;
  --frame: #3A3029;
  --ink: #1C1713;
  --ink-border: #2E2721;
  --header-bg: rgba(16, 13, 11, 0.86);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #100D0B;
    --surface: #1A1612;
    --track: #241E19;
    --border: #2E2721;
    --text: #F4EEE6;
    --muted: #B8AC9C;
    --accent: #FF9A52;
    --accent-hover: #FFB37A;
    --accent-2: #FFB37A;
    --tint: #2B1E14;
    --ok: #86C98E;
    --frame: #3A3029;
    --ink: #1C1713;
    --ink-border: #2E2721;
    --header-bg: rgba(16, 13, 11, 0.86);
  }
}

/* Screenshots follow the site theme */
.shot-dark { display: none !important; }
:root[data-theme="dark"] .shot-light { display: none !important; }
:root[data-theme="dark"] .shot-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot-light { display: none !important; }
  :root:not([data-theme="light"]) .shot-dark { display: block !important; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: clip;
}

/* Theme switch: the whole page cross-fades (theme.js uses the View Transitions API) */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.5s; animation-timing-function: ease; }

img { max-width: 100%; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container { max-width: 1200px; margin: 0 auto; padding-inline: var(--gutter); }

.h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.only-desktop { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand span { font-family: var(--font-head); font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }

.header-tools { display: flex; align-items: center; gap: 8px; }

.pill {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--track);
  font-size: 13px;
  font-weight: 600;
}

.lang a {
  min-width: 44px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}
.lang a:hover { color: var(--text); }
.lang a[aria-current="page"] { background: var(--surface); color: var(--text); }

/* Mobile: one round toggle. Desktop: light/dark segmented control. */
.theme-toggle {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--track);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.theme-switch { display: none; }
.theme-switch button {
  width: 38px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.hero-text {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.hero h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 40px;
  line-height: 1.04;
  letter-spacing: -0.025em;
}
.hero h1 span { color: var(--accent); }

.hero-lead { font-size: 17px; color: var(--muted); }

.play-badge { display: inline-flex; border-radius: 10px; }
.play-badge img { display: block; height: 64px; width: auto; }

.phones {
  width: 100%;
  padding-bottom: 64px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
}

.phone { flex: none; background: var(--frame); }
.phone img { display: block; width: 100%; height: auto; }

.phones .phone--side {
  width: 118px;
  margin-top: 44px;
  padding: 5px;
  border-radius: 16px;
  box-shadow: 0 14px 26px -14px var(--shadow);
}
.phones .phone--side img { border-radius: 12px; }
.phones .phone--side:first-child { margin-right: -34px; }
.phones .phone--side:last-child { margin-left: -34px; }

.phones .phone--main {
  position: relative;
  z-index: 1;
  width: 180px;
  margin-top: 12px;
  padding: 6px;
  border-radius: 20px;
  box-shadow: 0 24px 44px -20px var(--shadow-strong);
}
.phones .phone--main img { border-radius: 15px; }

/* ---------- Intro + benefit cards ---------- */
.intro {
  padding-block: clamp(56px, 7vw, 104px);
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.intro-head { display: flex; flex-wrap: wrap; gap: 20px 64px; align-items: flex-end; }
.intro-head h2 { flex: 1 1 420px; min-width: 0; }
.intro-head p { flex: 1 1 380px; min-width: 0; font-size: 18px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.card {
  padding: 24px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card h3 { font-family: var(--font-head); font-weight: 700; font-size: 19px; }
.card p { color: var(--muted); font-size: 15px; }

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-icon--accent { background: var(--tint); color: var(--accent); }
.card-icon--green { background: rgba(76, 140, 96, 0.16); color: #3F8A57; }
.card-icon--amber { background: rgba(242, 180, 71, 0.2); color: #B27A0E; }
.card-icon--blue { background: rgba(74, 138, 214, 0.16); color: #3A78C2; }

/* ---------- Features ---------- */
.features {
  padding-block: clamp(32px, 4vw, 56px) clamp(56px, 7vw, 104px);
  display: flex;
  flex-direction: column;
  gap: clamp(64px, 8vw, 112px);
}
.features > .h2 { max-width: 680px; }

.feature {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px 96px;
  padding-block: clamp(40px, 5vw, 72px);
  /* full-bleed band behind the row */
  border-image: linear-gradient(to bottom, var(--surface) 60%, var(--bg) 100%) fill 0 / 0 / 0 100vmax;
}
.feature--reverse { flex-direction: row-reverse; }

.feature-text { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }

.feature-label { font-family: var(--font-head); font-weight: 800; font-size: 25px; color: var(--accent); }
.feature-label--deep { color: var(--accent-2); }

.feature h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(26px, 2.5vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.feature-text > p { color: var(--muted); font-size: 17px; }

.bullets { display: flex; flex-direction: column; gap: 10px; }
.bullets li { display: flex; align-items: baseline; gap: 10px; }
.bullets li::before {
  content: "·";
  flex: none;
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
}

.feature-media { flex: 0 1 380px; min-width: 0; display: flex; justify-content: center; }

.phone--feature {
  width: min(280px, 72vw);
  padding: 9px;
  border-radius: 30px;
  box-shadow: 0 30px 60px -30px rgba(120, 55, 10, 0.45);
}
.phone--feature img { border-radius: 22px; }

/* ---------- How it works ---------- */
.how { background: var(--surface); border-block: 1px solid var(--border); }
.how .container {
  padding-block: clamp(56px, 7vw, 104px);
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.steps li {
  padding: 28px;
  border-radius: 16px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step-num {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #B85416;
  color: #FFFFFF;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps h3 { font-family: var(--font-head); font-weight: 700; font-size: 21px; }
.steps p { color: var(--muted); }

/* ---------- FAQ ---------- */
.faq {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(56px, 7vw, 104px) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.faq-list { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; color: var(--accent); transition: transform 0.2s; }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq details p { margin: 0 0 20px; color: var(--muted); }

/* ---------- Final CTA ---------- */
.cta { padding-bottom: clamp(40px, 5vw, 64px); }
.cta-panel {
  padding: clamp(32px, 6vw, 72px);
  border-radius: 28px;
  background: var(--ink);
  border: 1px solid var(--ink-border);
  color: #F6EFE6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px 48px;
}
.cta-text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cta-text h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.cta-text p { color: #B6A998; font-size: 17px; }
.cta .play-badge img { height: 60px; }

/* ---------- Text pages (privacy, licenses) ---------- */
.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 80px) var(--gutter) clamp(56px, 7vw, 104px);
}
.doc-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
}
.doc h1 {
  margin-top: 8px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.doc-meta { margin-top: 12px; color: var(--muted); font-size: 15px; }
.doc .doc-summary {
  margin-top: 32px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--tint);
  color: var(--text);
  font-size: 17px;
}
.doc h2 {
  margin-top: 48px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.25;
}
.doc p, .doc ul { margin-top: 12px; color: var(--muted); }
.doc ul { padding-left: 1.25em; list-style: disc; }
.doc li + li { margin-top: 8px; }
.doc li::marker { color: var(--accent); }
.doc strong { color: var(--text); font-weight: 600; }
.doc code, .lic-list pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.doc code { font-size: 0.92em; overflow-wrap: anywhere; }

.lic-list { margin-top: 16px; border-top: 1px solid var(--border); }
.lic-list details { border-bottom: 1px solid var(--border); }
.lic-list summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
}
.lic-list summary::-webkit-details-marker { display: none; }
.lic-list summary > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.lic-list summary strong { overflow-wrap: anywhere; }
.lic-list summary small { color: var(--muted); font-size: 14px; }
.lic-list summary svg { flex: none; color: var(--accent); transition: transform 0.2s; }
.lic-list details[open] summary svg { transform: rotate(180deg); }
.lic-list pre {
  margin: 0 0 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.footer-nav a[aria-current="page"] { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  padding-top: 24px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  font-size: 15px;
  color: var(--muted);
}
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; }
.footer-brand { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-brand .brand img { width: 32px; height: 32px; border-radius: 9px; }
.footer-brand .brand span { font-size: 18px; }
.footer-brand p { max-width: 30em; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: flex-start; }
.footer-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}
.footer-nav a:hover { color: var(--accent); }
.footer-nav a.footer-mail { color: var(--accent); font-weight: 600; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  .only-desktop { display: inline; }
  .only-mobile { display: none; }

  .header-inner { padding: 20px var(--gutter); gap: 16px; }
  .brand img { width: 49px; height: 49px; }
  .brand span { font-size: 20px; }
  .header-tools { gap: 28px; }
  .lang a { min-width: 0; min-height: 0; padding: 6px 12px; }
  .theme-toggle { display: none; }
  .theme-switch { display: flex; }

  .hero { padding-top: clamp(32px, 5vw, 72px); gap: clamp(40px, 5vw, 64px); }
  .hero-text { max-width: 900px; padding: 0 var(--gutter); gap: 24px; }
  .hero h1 { font-size: clamp(42px, 5.4vw, 80px); line-height: 1.02; letter-spacing: -0.03em; }
  .hero-lead { max-width: 36em; font-size: clamp(17px, 1.4vw, 20px); }
  .hero .play-badge img { height: 60px; }

  .phones { padding-bottom: 88px; }
  .phones .phone--side {
    width: 260px;
    margin-top: 96px;
    padding: 9px;
    border-radius: 28px;
    box-shadow: 0 18px 34px -18px var(--shadow);
  }
  .phones .phone--side img { border-radius: 20px; }
  .phones .phone--side:first-child { margin-right: -36px; }
  .phones .phone--side:last-child { margin-left: -36px; }
  .phones .phone--main {
    width: 310px;
    margin-top: 0;
    padding: 10px;
    border-radius: 32px;
    box-shadow: 0 40px 80px -30px var(--shadow-strong);
  }
  .phones .phone--main img { border-radius: 22px; }
}
