/* =========================================================================
   polautsau.com — shared design system
   Light palette on bare :root; dark redefined for both system + manual.
   ========================================================================= */

:root {
  color-scheme: light;

  /* Brand */
  --brand:        #4d7c0f;   /* accessible lime for text/links on light */
  --brand-vivid:  #9fe870;   /* the signature lime, for fills & accents */
  --brand-soft:   #f0fadf;

  /* Surfaces */
  --bg:           #ffffff;
  --bg-subtle:    #f7f8f7;
  --surface:      #ffffff;
  --surface-2:    #f2f4f1;
  --border:       #e3e6e1;
  --border-strong:#cdd2c9;

  /* Text */
  --text:         #16181a;
  --text-muted:   #5c6169;
  --text-faint:   #868c94;
  --text-invert:  #ffffff;

  /* Per-page accent — overridden by each app landing */
  --accent:       var(--brand);
  --accent-2:     #2f6f2f;
  --accent-fill:  var(--brand-vivid);
  --accent-soft:  var(--brand-soft);
  --on-accent:    #16181a;

  /* Depth */
  --shadow-sm: 0 1px 2px rgb(16 24 16 / .06), 0 1px 3px rgb(16 24 16 / .04);
  --shadow-md: 0 4px 12px rgb(16 24 16 / .07), 0 2px 4px rgb(16 24 16 / .04);
  --shadow-lg: 0 16px 40px rgb(16 24 16 / .10), 0 4px 12px rgb(16 24 16 / .05);

  /* Geometry */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-full: 999px;
  --maxw: 1120px;
  --gutter: clamp(1rem, 4vw, 2rem);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand:        #a8ef7c;
    --brand-vivid:  #9fe870;
    --brand-soft:   #1c2916;

    --bg:           #0c0e0d;
    --bg-subtle:    #121514;
    --surface:      #161a18;
    --surface-2:    #1e2320;
    --border:       #2a302c;
    --border-strong:#3b433d;

    --text:         #f2f5f2;
    --text-muted:   #a9b1ab;
    --text-faint:   #79817c;
    --text-invert:  #0c0e0d;

    --accent:       var(--brand);
    --accent-2:     #7fd15a;
    --accent-fill:  var(--brand-vivid);
    --accent-soft:  #1c2916;
    --on-accent:    #0c0e0d;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / .5);
    --shadow-md: 0 4px 14px rgb(0 0 0 / .45);
    --shadow-lg: 0 18px 44px rgb(0 0 0 / .55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --brand:        #a8ef7c;
  --brand-vivid:  #9fe870;
  --brand-soft:   #1c2916;

  --bg:           #0c0e0d;
  --bg-subtle:    #121514;
  --surface:      #161a18;
  --surface-2:    #1e2320;
  --border:       #2a302c;
  --border-strong:#3b433d;

  --text:         #f2f5f2;
  --text-muted:   #a9b1ab;
  --text-faint:   #79817c;
  --text-invert:  #0c0e0d;

  --accent:       var(--brand);
  --accent-2:     #7fd15a;
  --accent-fill:  var(--brand-vivid);
  --accent-soft:  #1c2916;
  --on-accent:    #0c0e0d;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / .5);
  --shadow-md: 0 4px 14px rgb(0 0 0 / .45);
  --shadow-lg: 0 18px 44px rgb(0 0 0 / .55);
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { line-height: 1.15; text-wrap: balance; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, .98rem + .5vw, 1.3rem); }
p  { text-wrap: pretty; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-2); }

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: var(--brand-vivid); color: #16181a; }

/* --------------------------------------------------------------- layout */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 760px; }

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section--alt { background: var(--bg-subtle); }

.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.is-center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .6rem;
}
.section-head p { color: var(--text-muted); font-size: 1.05rem; margin-top: .75rem; }

.stack > * + * { margin-top: 1rem; }
.lede { font-size: clamp(1.02rem, .95rem + .35vw, 1.2rem); color: var(--text-muted); }

/* ------------------------------------------------------------ site nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.site-header.is-stuck { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }

.nav { display: flex; align-items: center; gap: 1rem; min-height: 4rem; }
.nav-brand {
  font-weight: 800; letter-spacing: -.03em; font-size: 1.05rem;
  color: var(--text); text-decoration: none; margin-right: auto;
  display: inline-flex; align-items: center; gap: .55rem;
}
.nav-brand .mark {
  width: 1.85rem; height: 1.85rem; border-radius: 8px; flex: none;
  background: var(--accent-fill); color: #16181a;
  display: grid; place-items: center; font-size: .78rem; font-weight: 800;
}
.nav-links { display: flex; align-items: center; gap: .35rem; list-style: none; padding: 0; }
.nav-links a {
  display: block; padding: .45rem .7rem; border-radius: var(--r-sm);
  color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: .93rem;
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.icon-btn {
  width: 2.35rem; height: 2.35rem; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .theme-toggle .i-sun,
:root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
.theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
}
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle { display: grid; }
  .nav-links {
    position: absolute; inset-inline: var(--gutter); top: calc(100% + .4rem);
    flex-direction: column; align-items: stretch; gap: .15rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: .5rem;
  }
  .nav-links[hidden] { display: none; }
  .nav-links a { padding: .65rem .75rem; }
}

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.3rem; border-radius: var(--r-full);
  font-weight: 600; font-size: .95rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .18s, box-shadow .18s, background .18s, border-color .18s, color .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }

.btn--primary { background: var(--accent-fill); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn--primary:hover { box-shadow: var(--shadow-md); color: var(--on-accent); }

.btn--dark { background: var(--text); color: var(--bg); }
.btn--dark:hover { color: var(--bg); box-shadow: var(--shadow-md); }

.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { color: var(--text); border-color: var(--text-faint); background: var(--surface-2); }

.btn--sm { padding: .45rem .9rem; font-size: .85rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--text-muted); font-size: .95rem; }

.grid { display: grid; gap: clamp(1rem, 2.4vw, 1.5rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

/* --------------------------------------------------------------- badges */
.badges { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; }
.badge {
  display: inline-flex; align-items: center; gap: .32rem;
  padding: .2rem .6rem; border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .78rem; font-weight: 600; color: var(--text-muted);
}
.badge--accent {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
  color: var(--accent);
}

/* ------------------------------------------------------------ app cards */
.app-card {
  display: flex; flex-direction: column; gap: 1rem;
  --accent: var(--a-light, var(--brand));
  --accent-fill: var(--a-fill, var(--brand-vivid));
  --accent-soft: color-mix(in srgb, var(--accent) 15%, transparent);
  --on-accent: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-card { --accent: var(--a-dark, var(--brand)); }
}
:root[data-theme="dark"] .app-card { --accent: var(--a-dark, var(--brand)); }
.app-card__top { display: flex; align-items: flex-start; gap: .9rem; }
.app-icon {
  width: 60px; height: 60px; flex: none; border-radius: 14px;
  box-shadow: var(--shadow-sm); background: var(--surface-2);
}
.app-icon--lg { width: 88px; height: 88px; border-radius: 20px; }
.app-card__name { font-size: 1.12rem; font-weight: 700; letter-spacing: -.02em; }
.app-card__meta { font-size: .8rem; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.app-card p { flex: 1; }
.app-card__links { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.app-card__legal { display: flex; gap: .8rem; font-size: .8rem; }
.app-card__legal a { color: var(--text-faint); }
.app-card__legal a:hover { color: var(--accent); }

/* --------------------------------------------------------- app landings */
.app-hero { padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2.5rem, 6vw, 4rem); }
.app-hero__grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 860px) { .app-hero__grid { grid-template-columns: 1.05fr .95fr; } }
.app-hero h1 { margin-block: .6rem .8rem; }
.app-hero .lede { max-width: 52ch; }

.shots { display: flex; gap: 1rem; overflow-x: auto; padding-block: .5rem 1rem; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.shots img {
  width: 218px; flex: none; border-radius: 20px; scroll-snap-align: center;
  border: 1px solid var(--border); box-shadow: var(--shadow-md); background: var(--surface-2);
}
.shots--hero { justify-content: center; }
@media (min-width: 860px) { .shots--hero { justify-content: flex-end; } }

.feature { display: flex; gap: .9rem; }
.feature__icon {
  width: 2.4rem; height: 2.4rem; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.15rem;
  background: var(--accent-soft); color: var(--accent);
}
.feature h3 { font-size: 1.03rem; margin-bottom: .25rem; }
.feature p { color: var(--text-muted); font-size: .93rem; }

.checklist { list-style: none; padding: 0; display: grid; gap: .6rem; }
.checklist li { position: relative; padding-left: 1.7rem; color: var(--text-muted); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: .95rem; height: .5rem; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg); border-radius: 1px;
}

.stat-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.stat { text-align: center; padding: 1.1rem .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.stat b { display: block; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 800; color: var(--accent); letter-spacing: -.03em; }
.stat span { font-size: .84rem; color: var(--text-muted); }

.cta-band {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: clamp(1.75rem, 5vw, 3rem);
  text-align: center; box-shadow: var(--shadow-sm);
}
.cta-band p { color: var(--text-muted); margin: .75rem auto 1.5rem; max-width: 52ch; }
.cta-band .btn-row { justify-content: center; }

/* ---------------------------------------------------------- lang switch */
.lang-switch { display: inline-flex; gap: .2rem; padding: .25rem; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--border); }
.lang-switch button {
  padding: .32rem .8rem; border: 0; border-radius: var(--r-full); background: transparent;
  color: var(--text-muted); font-weight: 700; font-size: .8rem; cursor: pointer; transition: background .2s, color .2s;
}
.lang-switch button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------------- timeline */
.timeline { display: grid; gap: 1rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: .5rem; top: .4rem; bottom: .4rem; width: 2px; background: var(--border); }
.timeline > li { list-style: none; position: relative; padding-left: 2.1rem; }
.timeline > li::before {
  content: ""; position: absolute; left: .5rem; top: .75rem;
  width: .65rem; height: .65rem; border-radius: 50%;
  background: var(--accent-fill); transform: translateX(-50%); box-shadow: 0 0 0 3px var(--bg);
}
.timeline .when { font-size: .82rem; font-weight: 700; color: var(--accent); letter-spacing: .01em; }
.timeline .role { font-weight: 700; margin-top: .1rem; }
.timeline .org { font-size: .9rem; color: var(--text-faint); margin-bottom: .4rem; }
.timeline .what { color: var(--text-muted); font-size: .94rem; }

/* ------------------------------------------------------------ prose/legal */
.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(1.25rem, 1.1rem + .7vw, 1.6rem); margin-top: 2.5rem; margin-bottom: .7rem; }
.prose > :first-child, .prose > :first-child > :first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6rem; margin-bottom: .4rem; }
.prose p, .prose li { color: var(--text-muted); }
.prose > * + * { margin-top: .9rem; }
.prose ul, .prose ol { padding-left: 1.3rem; display: grid; gap: .35rem; }
.prose strong { color: var(--text); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin-block: 2rem; }
.page-head { padding-block: clamp(2.5rem, 6vw, 4rem) 1rem; }
.page-head .updated { font-size: .88rem; color: var(--text-faint); margin-top: .5rem; }

/* --------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-subtle); padding-block: clamp(2.5rem, 6vw, 4rem) 2rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.footer-grid h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-faint); margin-bottom: .7rem; }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: .4rem; }
.footer-grid a { color: var(--text-muted); text-decoration: none; font-size: .92rem; }
.footer-grid a:hover { color: var(--accent); text-decoration: underline; }
.footer-base { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between; align-items: center; }
.footer-base p { font-size: .87rem; color: var(--text-faint); }

/* --------------------------------------------------------------- motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .btn:hover, .card--hover:hover { transform: none; }
}

/* --------------------------------------------------------------- to-top */
.to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  display: grid; place-items: center; cursor: pointer; color: var(--text-muted);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s, transform .25s, color .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { color: var(--text); transform: translateY(-2px); }
.to-top svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- utils */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: .5rem; top: -4rem; z-index: 100;
  background: var(--accent-fill); color: #16181a; padding: .6rem 1rem;
  border-radius: var(--r-sm); font-weight: 600; text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: .5rem; }
.text-muted { color: var(--text-muted); }
.center { text-align: center; }
