/* ==========================================================================
   Page transitions (progressive enhancement: browsers without support for
   the View Transitions API simply ignore this and navigate normally, no
   fallback code needed — Chromium 126+/Edge as of writing, Safari/Firefox
   not yet, per caniuse "view-transitions" cross-document support)
   ========================================================================== */
@view-transition {
  navigation: auto;
}

/* ==========================================================================
   Variables & Reset
   ========================================================================== */
:root {
  /* Brand palette */
  --color-black: #0a0a05;
  --color-cream: #e9e0ca;
  --color-gold: #c69a3b;
  --color-olive: #6f7a4a;
  --color-orange: #e07b2a;
  --color-paper: #f7f1e3;

  /* Semantic tokens (derived from the brand palette above) */
  --color-bg: var(--color-paper);
  --color-text: var(--color-black);
  --color-muted: var(--color-olive);
  --color-primary: var(--color-gold);
  --color-primary-dark: var(--color-orange);
  --color-border: color-mix(in srgb, var(--color-black) 18%, var(--color-paper));
  --color-surface: var(--color-cream);

  --shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.15);
  --shadow-strong: 0 14px 40px rgba(0, 0, 0, 0.28);

  --max-width: 960px;

  /* Typography: serif for headings, grotesk for body copy and kickers */
  --font-heading: "Didot", "Baskerville", "Baskerville Old Face", Georgia, "Times New Roman", serif;
  --font-body: "Futura", "Avenir Next", "Century Gothic", "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Dark mode palette: deep navy, same brand gold/orange as accents (both
   read at strong contrast against navy), warm cream reused as body text
   instead of pure white to avoid thin-serif "halation" on dark backgrounds. */
[data-theme="dark"] {
  --color-navy-deep: #090e1c;
  --color-navy-surface: #182742;
  --color-navy-border: #34456a;
  --color-mist: #9fb0c9;

  --color-bg: var(--color-navy-deep);
  --color-text: var(--color-cream);
  --color-muted: var(--color-mist);
  --color-primary: var(--color-gold);
  --color-primary-dark: var(--color-orange);
  --color-border: var(--color-navy-border);
  --color-surface: var(--color-navy-surface);

  /* Shadows read as pure darkness on a dark background, so depth here
     comes from a soft rim-light instead of a drop shadow. */
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-strong: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 175, 55, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.25;
  margin-top: 0;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Added by js/sticky-header.js once the page has scrolled past the very
   top, so the header reads as "floating" over the content beneath it
   instead of just a flat bar that happens to stay put. */
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--color-bg) 78%, transparent);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  box-shadow: var(--shadow-soft);
  border-bottom-color: transparent;
}

.site-header .container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  /* Header spans the full window width (unlike the content .container,
     capped at --max-width) so the logo and menu/controls stay anchored
     near the top-left/top-right corners at any window size, instead of
     floating together in a centered ~960px column with empty gutters. */
  max-width: none;
  padding-left: clamp(1.25rem, 3vw, 3rem);
  padding-right: clamp(1.25rem, 3vw, 3rem);
}

.site-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.site-title:hover {
  text-decoration: none;
}

.site-logo {
  height: 27px;
  width: auto;
  flex-shrink: 0;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--color-text);
  font-weight: 500;
}

.site-nav a[aria-current="page"] {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
}

/* ==========================================================================
   Nav toggle (hamburger button, collapsible nav on every screen size)
   ========================================================================== */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  order: 2;
  width: 100%;
  display: none;
}

.site-nav.is-open {
  display: block;
}

.site-nav ul {
  flex-direction: column;
  gap: 0;
  margin-top: 1rem;
}

.site-nav li {
  border-top: 1px solid var(--color-border);
}

.site-nav a {
  display: block;
  padding: 0.75rem 0;
}

.site-nav a[aria-current="page"] {
  border-bottom: none;
}

/* ==========================================================================
   Header controls (language switch + theme toggle + hamburger, grouped)
   ========================================================================== */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

/* ==========================================================================
   Language switcher
   ========================================================================== */
.lang-switch {
  font-size: 0.85rem;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.lang-switch a {
  color: var(--color-muted);
  font-weight: 600;
  padding: 0.15rem 0.35rem;
}

.lang-switch a[aria-current="true"] {
  color: var(--color-primary);
}

/* ==========================================================================
   Theme toggle (light / dark mode)
   ========================================================================== */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 3rem 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.hero h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--color-muted);
  font-size: 1.1rem;
  max-width: 40rem;
}

.hero .tagline {
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 0.15rem;
}

.hero .subtitle {
  font-style: italic;
  color: var(--color-muted);
  margin: 0 0 1rem;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.hero-photo {
  flex-shrink: 0;
}

.hero-photo img {
  width: 220px;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-strong);
}

.hero-text {
  flex: 1 1 320px;
}

@media (max-width: 600px) {
  .hero-inner {
    justify-content: center;
    text-align: center;
  }

  .hero-photo img {
    width: 180px;
  }

  .cta-group {
    justify-content: center;
  }
}

/* ==========================================================================
   Hero banner (full-bleed image spanning the very top of the homepage,
   above the portrait+text hero — modeled after musikkorpsderbundeswehr.de)
   ========================================================================== */
.hero-banner {
  position: relative;
  width: 100%;
  height: clamp(220px, 42vw, 460px);
  overflow: hidden;
}

/* Added to the element by the inline script right after this markup in
   index.html/en/index.html — desktop + motion-ok only (see that script and
   js/hero-zoom.js). The element's `height` itself is driven by JS via
   inline style during the intro scroll, not by this class; the class just
   hints the browser that height will change rapidly for a short stretch. */
.hero-banner--zoom {
  will-change: height;
}

.hero-banner picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 68%;
  display: block;
}

.hero-banner-credit {
  position: absolute;
  right: 0.75rem;
  bottom: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

/* Logo + "Conducting" lockup over the hero banner, bottom-left. Colors are
   hardcoded (not theme tokens) since this sits on top of a photo, not the
   page background — same reasoning as .hero-banner-credit above. Reveals
   left-to-right on load via an animated clip-path "wipe" (rather than a
   plain fade), which is what actually reads as the logo/text "building up"
   rather than just appearing. */
.hero-brand {
  position: absolute;
  left: clamp(1.25rem, 3vw, 3rem);
  bottom: clamp(1rem, 3.5vw, 2.25rem);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  clip-path: inset(0 100% 0 0);
  animation: hero-brand-reveal 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.6s forwards;
  pointer-events: none;
}

.hero-brand-logo {
  height: clamp(28px, 4vw, 44px);
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.6));
}

.hero-brand-text {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(0.8rem, 1.6vw, 1.05rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
}

@keyframes hero-brand-reveal {
  to {
    clip-path: inset(0 0 0 0);
  }
}

.cta-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  background: var(--color-primary);
  color: var(--color-black);
  border-radius: 6px;
  font-weight: 600;
  margin-top: 1rem;
}

.button:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.button.secondary:hover {
  background: var(--color-surface);
}

/* ==========================================================================
   Main content
   ========================================================================== */
main {
  padding: 3rem 0;
}

section + section {
  margin-top: 2.5rem;
}

/* ==========================================================================
   Cards (Projects grid)
   ========================================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
  border-color: var(--color-primary);
}

.card-icon {
  color: var(--color-primary);
  margin-bottom: 0.6rem;
}

.card-icon svg {
  width: 30px;
  height: 30px;
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card .tags {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* ==========================================================================
   Timeline (CV-style entries: period + title + institution)
   ========================================================================== */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 5px;
  width: 2px;
  background: var(--color-border);
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.5rem 1.5rem;
  padding: 1.15rem 0 1.15rem 2rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.55rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-primary);
  z-index: 1;
}

.timeline li:first-child::before {
  background: var(--color-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.timeline .period {
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}

.timeline .details strong {
  display: block;
}

.timeline .details span {
  display: block;
  color: var(--color-muted);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding-left: 1.5rem;
  }

  .timeline::before {
    left: 3px;
  }

  .timeline li::before {
    width: 8px;
    height: 8px;
    top: 0.35rem;
  }
}

/* ==========================================================================
   Inline list (comma/dot-separated items: venues, masterclasses, etc.)
   ========================================================================== */
.inline-list {
  color: var(--color-muted);
}

/* ==========================================================================
   Contact form
   ========================================================================== */
.contact-form {
  max-width: 32rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form label {
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: block;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font: inherit;
}

.contact-form textarea {
  min-height: 8rem;
  resize: vertical;
}

/* Honeypot field: kept in the tab order/DOM but moved off-screen rather
   than `display: none`, since some spam bots specifically skip fields
   hidden that way. Real visitors never see or reach it. */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent-field {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.consent-field input {
  width: auto;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.form-success,
.form-error {
  font-size: 0.95rem;
  border-radius: 6px;
  padding: 0.85rem 1rem;
}

.form-success {
  color: var(--color-olive);
  background: color-mix(in srgb, var(--color-olive) 12%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--color-olive) 35%, var(--color-border));
}

.form-error {
  color: var(--color-orange);
  background: color-mix(in srgb, var(--color-orange) 12%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--color-orange) 35%, var(--color-border));
}

.note {
  font-size: 0.9rem;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.footer-links {
  margin-top: 0.35rem;
}

/* ==========================================================================
   Legal pages (Impressum / Datenschutz)
   ========================================================================== */
.legal-content {
  max-width: 46rem;
}

.legal-content h2 {
  font-size: 1.2rem;
}

.legal-content ul {
  padding-left: 1.25rem;
}

.legal-content section + section {
  margin-top: 2rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.75rem;
  }
}

/* ==========================================================================
   Scroll reveal (sections fade/lift into view as the user scrolls)
   ========================================================================== */
/* The hidden starting state only applies once `.reveal-js` is present on
   <html> — set by a synchronous inline script in <head> (same place/pattern
   as the dark-mode anti-flash script), and only when JS runs AND the user
   hasn't requested reduced motion. That way content is never hidden for
   no-JS visitors or reduced-motion users; js/reveal.js (IntersectionObserver)
   adds `.is-visible` per section as it scrolls into view. */
.reveal-js main section {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-js main section.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
