/* ==========================================================================
   GermanGo design tokens, reset and typography.

   Bauhaus editorial: a chalk-white page, near-black ink, and the flag's red
   and gold used as structure rather than decoration. Geometry is sharp,
   borders are drawn in ink, and depth comes from a hard offset shadow
   instead of blur.

   Type: Bricolage Grotesque for display (variable, with optical sizing, so
   headlines tighten up on their own) and Manrope for everything else.
   ========================================================================== */

:root {
  /* Surfaces */
  --paper:        #F5F3EE;
  --paper-2:      #ECE9E1;
  --surface:      #FFFFFF;
  --surface-sunk: #EFECE5;

  /* Ink */
  --ink:          #0F0F12;
  --ink-2:        #3D3D45;
  --ink-3:        #6B6B75;
  --ink-4:        #A0A0A8;

  /* Brand — taken straight from the logo, used for the mark itself */
  --brand-ink:    #0F0F12;
  --brand-red:    #E63329;
  --brand-gold:   #F5B821;

  /* Accents. `--red` and `--yellow` are dark enough for text on paper;
     `--gold` is the flag's true yellow, for fills under dark text only. */
  --red:          #D2261D;
  --red-soft:     #E8382E;
  --red-wash:     #FCE8E6;
  --gold:         #F2B705;
  --gold-soft:    #FFD23F;
  --yellow:       #8F6600;
  --yellow-soft:  #F2B705;
  --yellow-wash:  #FFF3CC;
  --green:        #1F7A4D;
  --green-soft:   #3E9B6B;
  --green-wash:   #E3F1E8;
  --blue:         #24518A;
  --blue-wash:    #E5EDF7;

  /* Gender colour coding for der / die / das */
  --gender-masc:  #24518A;
  --gender-fem:   #9B2226;
  --gender-neut:  #1F7A4D;

  /* Lines & shadows. The soft shadows are kept small; the hard one is the
     signature and is drawn in whatever `--hard` is on that surface. */
  --line:         #DEDBD3;
  --line-strong:  #C9C5BB;
  --hard:         var(--ink);
  --shadow-sm:    0 1px 2px rgba(15, 15, 18, .06);
  --shadow:       0 2px 6px rgba(15, 15, 18, .07);
  --shadow-lg:    0 10px 24px rgba(15, 15, 18, .10);
  --shadow-xl:    0 20px 48px rgba(15, 15, 18, .14);
  --shadow-hard:    4px 4px 0 var(--hard);
  --shadow-hard-lg: 8px 8px 0 var(--hard);

  /* Radii */
  --r-sm: 4px;
  --r:    8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* Spacing scale */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 48px;  --s-8: 64px;
  --s-9: 96px;  --s-10: 128px;

  /* Typography */
  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bricolage Grotesque", "Manrope", ui-sans-serif, system-ui,
                  -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Fluid type scale */
  --t-xs:   0.78rem;
  --t-sm:   0.875rem;
  --t-base: 1rem;
  --t-md:   clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem);
  --t-lg:   clamp(1.25rem, 1.12rem + 0.6vw, 1.55rem);
  --t-xl:   clamp(1.6rem, 1.35rem + 1.1vw, 2.2rem);
  --t-2xl:  clamp(2.1rem, 1.55rem + 2.4vw, 3.4rem);
  --t-3xl:  clamp(2.8rem, 1.9rem + 4.6vw, 5.4rem);

  /* Motion */
  --ease:      cubic-bezier(.22, .61, .36, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: 140ms;
  --dur:      240ms;
  --dur-slow: 480ms;

  /* Layout — the site sits in an 80% column on desktop, capped so it does
     not sprawl on very wide monitors. Mobile falls back to fixed gutters. */
  --wrap: 80%;
  --wrap-max: 1440px;
  --wrap-narrow: 760px;
  /* The content column from tablet up. Tablets and small laptops get 92%
     of the screen; from there it holds at 1180px, then grows as the 80%
     column on wide monitors. One expression, so nothing jumps. */
  --col: min(92%, max(var(--wrap), 1180px), var(--wrap-max));
  --nav-h: 76px;   /* 56px capsule + 10px above and below */

  /* The flag, as a rule. Drawn under the nav and over the footer. */
  --flag-rule: linear-gradient(90deg, var(--ink) 0 33.34%, var(--red) 33.34% 66.67%, var(--gold) 66.67% 100%);
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--s-5));
}

body {
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }

/* The `hidden` attribute must win. Without this, any class that sets a
   display value (`.hero__fallback { display: grid }`) silently overrides
   it and the element stays on screen. */
[hidden] { display: none !important; }
input, button, textarea, select { font: inherit; color: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul[class], ol[class] { list-style: none; padding: 0; }

:where(a) { color: var(--red); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
:where(a:hover) { color: var(--ink); }

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

::selection { background: var(--gold); color: var(--ink); }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: var(--t-3xl); font-weight: 800; line-height: .98; letter-spacing: -0.035em; }
h2 { font-size: var(--t-2xl); letter-spacing: -0.03em; }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }

.lede {
  font-size: var(--t-md);
  color: var(--ink-2);
  line-height: 1.65;
  max-width: 60ch;
  text-wrap: pretty;
}

/* A small red square, then the label. The square is the eyebrow's whole
   identity, so it never changes colour with the text around it. */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--red);
  flex-shrink: 0;
}

.de { font-family: var(--font-display); font-feature-settings: "ss01"; }

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */

.wrap {
  width: min(100% - 2 * var(--s-5), var(--wrap-max));
  margin-inline: auto;
}

.wrap--narrow { width: min(100% - 2 * var(--s-5), var(--wrap-narrow)); }

/* From tablet up, everything lines up on the same column — navbar,
   sections and footer alike. */
@media (min-width: 900px) {
  .wrap { width: var(--col); }
  .wrap--narrow { width: min(92%, var(--wrap-narrow)); }
}

/* `.bleed` opts a section out of that column and runs it edge to edge. */
.bleed { width: 100%; margin-inline: 0; }

/* Sections sit close together. Adjacent sections share their padding, so
   the gap between two blocks of content is twice this value. */
.section { padding-block: clamp(var(--s-6), 3.2vw, var(--s-7)); }
.section--tight { padding-block: clamp(var(--s-4), 2vw, var(--s-5)); }
.section--sunk { background: var(--paper-2); }
.section--ink { background: var(--ink); color: var(--paper); --hard: var(--gold); }
.section--ink h2, .section--ink h3 { color: var(--paper); }
.section--ink .eyebrow { color: var(--paper); }
.section--ink .lede { color: #C4C1B8; }

.section__head { max-width: 64ch; margin-bottom: var(--s-5); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head h2 { margin-top: var(--s-3); }
.section__head p { margin-top: var(--s-3); }

/* Split head: the title on the left, its supporting sentence and any link
   on the right, so a left-aligned heading uses the full column instead of
   leaving the right half empty. Stacks on small screens. */
.section__head--split {
  max-width: none;
  display: grid;
  gap: var(--s-4) var(--s-7);
  align-items: end;
}
.section__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-4);
}
.section__head--split .section__aside p { margin-top: 0; max-width: 52ch; }
@media (min-width: 900px) {
  .section__head--split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .section__aside { padding-bottom: .35em; }
}

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

.grid { display: grid; gap: var(--s-5); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }

.muted { color: var(--ink-3); }
.small { font-size: var(--t-sm); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: .9em; }

.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: var(--s-4);
  top: -60px;
  z-index: 999;
  background: var(--ink);
  color: var(--paper);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-sm);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--s-4); color: var(--paper); }

/* --------------------------------------------------------------------------
   Reduced motion: honoured both by OS setting and by the learner's profile.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

[data-reduced-motion="true"] *,
[data-reduced-motion="true"] *::before,
[data-reduced-motion="true"] *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}

/* Elements GSAP will animate in start hidden, but only when JS is running
   and motion is allowed -- otherwise they must stay visible. */
.js:not([data-reduced-motion="true"]) [data-animate] { opacity: 0; }
