/* ==========================================================================
   plattle.com — shared stylesheet
   Fonts are served from plattle.com itself (no third parties).
   Sections:
     1. Font (Inter, self-hosted)
     2. Design tokens (colours, sizes)  — change the look here
     3. Base / reset
     4. Language switching (EN/DE)
     5. Header bar (fixed at the top)
     6. Main layout
     7. Landing page and 404
     8. Legal pages (impressum, privacy)
   ========================================================================== */

/* 1. Font ---------------------------------------------------------------- */
/* Inter (variable, Latin subset incl. ä ö ü ß §), SIL Open Font License 1.1
   — licence: /assets/fonts/OFL.txt */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-variable.woff2") format("woff2");
}

/* 2. Design tokens ------------------------------------------------------- */
:root {
  color-scheme: dark;

  --bg:          #111b16;   /* page background (store graphic) */
  --bar:         #0c1410;   /* header bar */
  --surface:     #16231c;   /* cards on legal pages */
  --border:      #24382c;
  --deco:        #16281e;   /* background leaves (also in assets/leaf.svg) */

  --green:       #4c9a68;   /* brand green: wordmark, stem, accent line */
  --green-light: #7cc493;   /* light leaf, links, headings */
  --text:        #dce8e1;
  --text-muted:  #a3b8ab;
  --focus:       #e8d36b;   /* keyboard focus ring — visible on dark green */

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: 16px;
  --measure: 46rem;         /* max text width */
  --bar-height: 3.5rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-height) + 1rem);  /* anchors not hidden under the bar */
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;     /* mobile: excludes browser toolbars */
  display: flex;
  flex-direction: column;
  overflow-x: clip;       /* decorative leaves never cause sideways scrolling */
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--green-light); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* 4. Language switching -------------------------------------------------- */
/* Without JavaScript: English. lang.js sets <html data-lang="en|de">. */
html:not([data-lang="de"]) [data-l="de"] { display: none; }
html[data-lang="de"] [data-l="en"] { display: none; }

/* The EN/DE switch only appears when the script is running */
.lang-switch { display: none; }
html[data-lang] .lang-switch { display: flex; }

/* 5. Header bar ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bar);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.site-header .bar {
  max-width: 64rem;
  min-height: var(--bar-height);
  margin: 0 auto;
  padding: 0.5rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--green);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand img { width: 1.55rem; height: auto; }

.main-nav { margin-left: auto; }   /* desktop: links + switch on the right */

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
}
.main-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--green-light); }
.main-nav a[aria-current="page"] { color: var(--green-light); border-bottom-color: var(--green); }

.lang-switch {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.lang-switch button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  cursor: pointer;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { background: var(--green); color: #0c1410; }

/* 6. Main layout --------------------------------------------------------- */
.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3.5rem;
  position: relative;
  z-index: 1;
}

/* 7. Landing page and 404 ------------------------------------------------ */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Decorative leaves in the corners (as in the store graphic) */
.page-landing::before,
.page-landing::after {
  content: "";
  position: fixed;
  z-index: 0;             /* above the page background, below content (.site-main z-index 1) */
  pointer-events: none;
  background: url("/assets/leaf.svg") no-repeat center / contain;
}
.page-landing::before {          /* top right, small */
  width: clamp(5rem, 12vw, 9rem);
  aspect-ratio: 100 / 160;
  top: 2.5rem;
  right: 6%;
  transform: rotate(30deg);
}
.page-landing::after {           /* bottom left, large */
  width: clamp(9rem, 22vw, 16rem);
  aspect-ratio: 100 / 160;
  bottom: -4rem;
  left: -4rem;
  transform: rotate(-25deg);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 2vw, 1.2rem);
  margin: 0;
  color: var(--green);
  font-size: clamp(3.4rem, 15vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}
.logo img { height: 0.95em; width: auto; }

.tagline {
  margin: 1.25rem 0 0;
  font-size: clamp(1.25rem, 4.5vw, 1.9rem);
  font-weight: 300;
  color: var(--text);
}
.accent-line {
  width: 4.25rem;
  height: 0.4rem;
  margin: 1.5rem auto 0;
  border-radius: 999px;
  background: var(--green);
}
.landing .store-link { margin-top: 2rem; }

.error-code { font-size: clamp(3.5rem, 14vw, 6rem); }

/* 8. Legal pages --------------------------------------------------------- */
.legal h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 1rem; color: var(--green-light); letter-spacing: -0.01em; }
.legal h2 { font-size: 1.3rem; margin: 2rem 0 0.5rem; color: var(--green-light); }
.legal h3 { font-size: 1.05rem; margin: 1.5rem 0 0.25rem; }
.legal address { font-style: normal; }
.legal .updated { color: var(--text-muted); font-size: 0.95rem; }
.legal section.block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.25rem 1.25rem 1rem;
  margin-top: 1.5rem;
}
.legal ul { padding-left: 1.25rem; }

/* Phones: row 1 = logo + EN/DE switch, row 2 = links */
@media (max-width: 560px) {
  .site-header .bar { padding-top: 0.45rem; padding-bottom: 0.35rem; row-gap: 0.15rem; }
  .brand { font-size: 1.3rem; }
  .brand img { width: 1.35rem; }
  .lang-switch { order: 2; margin-left: auto; }
  .main-nav { order: 3; flex-basis: 100%; margin-left: 0; }
  .main-nav ul { gap: 0.25rem 1rem; }
  .main-nav a { font-size: 0.92rem; }
}
