/* =========================================================
   Julian Wahl — main stylesheet
   Dark theme by default, optional light theme via
   <body data-theme="light">. Toggle handled in main.js.
   ========================================================= */

:root {
  --bg: #0e0f12;
  --text: #e8e9ec;
  --accent: #11a8e8;
  --muted: rgba(232, 233, 236, 0.58);
  --border: rgba(255, 255, 255, 0.10);
  --quote: rgba(255, 255, 255, 0.16);

  --font-head: "Montserrat", sans-serif;
  --font-body: "Inconsolata", monospace;

  --content-width: 820px;
  --wide-width: 1140px;
}

:root[data-theme="light"] {
  --bg: #fcfcfd;
  --text: #1b1c1f;
  --muted: rgba(0, 0, 0, 0.58);
  --border: rgba(0, 0, 0, 0.10);
  --quote: rgba(0, 0, 0, 0.12);
  color-scheme: light;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

/* Theme lives on <html> so the browser canvas is themed too (no flash). */
html {
  background-color: var(--bg);
  color-scheme: dark;
  transition: background-color 0.3s ease;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}

/* Gentle, unified fade when switching light/dark. Element-specific
   transitions (hovers, arrows) keep their own timing and win over this. */
*, *::before, *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none; }
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--wide-width);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.brand:hover { color: var(--accent); }

.nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a.is-active { color: var(--accent); }

/* Monochrome sliding theme switch, fixed in the top-right corner. */
.theme-switch {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 60px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.theme-switch:hover { border-color: var(--accent); }

.theme-switch__ico {
  position: relative;
  z-index: 2;
  width: 15px;
  height: 15px;
  display: block;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

:root[data-theme="light"] .theme-switch__ico--sun,
:root[data-theme="dark"] .theme-switch__ico--moon { opacity: 1; }

/* Gliding highlight behind the active icon. */
.theme-switch__thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  z-index: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  transform: translateY(-50%);
  transition: transform 0.25s ease;
}

:root[data-theme="dark"] .theme-switch__thumb { transform: translateY(-50%) translateX(30px); }

/* ---------- Hero ---------- */
.hero { padding-top: 64px; text-align: center; }

.hero__name {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(40px, 8vw, 56px);
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ---------- Intro + avatar ---------- */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding-block: 48px;
}

.intro { max-width: 560px; }

.intro__quote {
  position: relative;
  margin: 0 0 28px;
  font-weight: 500;
}

.intro__quote::before {
  content: "\201C";
  position: absolute;
  top: -48px;
  left: -12px;
  font-size: 140px;
  line-height: 1;
  color: var(--quote);
  pointer-events: none;
}

.intro__quote p { margin: 0 0 1em; position: relative; z-index: 1; }
.intro__quote p:last-child { margin-bottom: 0; }

.intro__signature { transform: rotate(5deg); }
/* Signature artwork is light ink; flip it to dark ink in light mode. */
:root[data-theme="light"] .intro__signature { filter: invert(1); }

/* Avatar with hand-drawn ring */
.avatar {
  position: relative;
  width: 260px;
  height: 260px;
  margin-inline: auto;
}

.avatar__mask {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

.avatar__mask img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar__ring {
  position: absolute;
  top: -18px;
  left: -10px;
  width: 300px;
  height: 300px;
  pointer-events: none;
}

/* ---------- Experiences ---------- */
.experiences { padding-block: 32px 72px; }

.experiences__title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(32px, 6vw, 44px);
}

.experiences__underline { display: block; width: 260px; margin: 4px 0 32px; }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--content-width);
}

.xp {
  display: flex;
  gap: 22px;
  margin-bottom: 30px;
}

.xp--faded-1 { opacity: 0.85; }
.xp--faded-2 { opacity: 0.70; }
.xp--faded-3 { opacity: 0.55; }

/* Left column: logo on a connecting line */
.xp__logo {
  position: relative;
  flex: 0 0 88px;
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.xp__logo::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background: var(--border);
  border-radius: 999px;
}

.xp:last-child .xp__logo::before { bottom: 0; }

.xp__logo img {
  position: relative;
  z-index: 1;
  max-height: 40px;
  width: auto;
  background: var(--bg);
  padding-bottom: 8px;
}

/* Right column: text */
.xp__body { flex: 1; min-width: 0; }

.xp__role {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.xp__company { margin: 0 0 6px; font-weight: 500; }
.xp__company span { font-style: italic; opacity: 0.7; }

.xp__date { margin: 0; color: var(--muted); font-size: 16px; }

/* Arrow link */
.xp__link {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  margin-top: 10px;
}

.xp__link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--accent);
}

.xp__link::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 24px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: translateY(-50%) rotate(45deg);
}

.xp__link:hover { transform: translateX(6px); transition: transform 0.2s ease; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 24px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.site-footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  /* Stack the brand and nav; keep clear of the corner switch. */
  .site-header .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-height: 0;
    padding-block: 12px;
    padding-right: 60px;
    padding-left: 18px;
  }
  .nav { margin-left: 0; flex-wrap: wrap; gap: 8px 16px; font-size: 15px; }
  .nav a { white-space: nowrap; }
  .intro-grid { grid-template-columns: 1fr; text-align: center; }
  .intro { max-width: none; }
  .intro__quote::before { left: 50%; transform: translateX(-50%); }
  .xp__logo { flex-basis: 64px; }
}

/* =========================================================
   Sub-pages (About, Resume, Experience case studies)
   ========================================================= */

.subpage { max-width: var(--content-width); padding-block: 40px 72px; }

.page-title {
  margin: 0 0 24px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(32px, 6vw, 44px);
  color: var(--accent);
}

/* Readable prose blocks */
.prose h2 {
  margin: 56px 0 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(34px, 5.5vw, 50px);
  line-height: 1.1;
  color: var(--text);
}

/* Accent divider under each section heading (matches the original). */
.prose h2::after {
  content: "";
  display: block;
  width: 120px;
  height: 4px;
  margin: 16px 0 24px;
  background: var(--accent);
  border-radius: 2px;
}

.prose h3 {
  margin: 32px 0 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 20px;
  color: var(--accent);
}

.prose p { margin: 0 0 1.1em; }
.prose p:last-child { margin-bottom: 0; }

/* Figures / content images */
.figure { margin: 28px 0; text-align: center; }

.figure img {
  display: block;
  margin-inline: auto;
}

.figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

/* Case-study header */
.case-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 8px 0 40px;
}

/* Standalone accent back arrow (beside the case header, or above a page title). */
.case-back {
  flex: 0 0 auto;
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.case-back:hover { transform: translateX(-3px); opacity: 0.8; }

/* When used on its own (About/Resume) rather than inside the case header. */
.subpage > .case-back {
  display: inline-block;
  margin-bottom: 28px;
}

.case-header__logo {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-header__logo img { max-height: 48px; width: auto; }

.case-header__role { margin: 0 0 4px; font-family: var(--font-head); font-weight: 700; font-size: clamp(24px, 5vw, 32px); color: var(--accent); }
.case-header__company { margin: 0; font-weight: 500; }
.case-header__company span { font-style: italic; opacity: 0.7; }
.case-header__date { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

/* =========================================================
   Case-study diagrams (faithful ports of the original
   hand-built graphics). Each sits inside a self-contained
   dark panel so it reads correctly in both themes.
   ========================================================= */

.diagram-panel {
  margin: 28px 0;
  padding: 28px 24px;
  background: #050608;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  overflow: hidden;
  color: #fff;
  font-family: var(--font-body);
}

.diagram-panel__caption {
  margin: 0 0 8px;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- BMW: stakeholder map --- */
.stakeholder-map {
  position: relative;
  width: min(92%, 580px);
  aspect-ratio: 580 / 450;
  margin: 0 auto;
  color: #fff;
}

.stakeholder-map__circle {
  position: absolute;
  width: 64%;
  aspect-ratio: 1 / 1;
  left: 50%;
  top: 2%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #09354d;
}

.stakeholder-map .pill {
  position: absolute;
  width: 30%;
  min-height: 12%;
  padding: 0.5em 0.9em;
  border-radius: 999px;
  background: #45a6df;
  text-align: center;
  font-size: clamp(11px, 1.9vw, 14px);
  font-weight: 500;
  line-height: 1.2;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.stakeholder-map .pill--left { left: 2%; }
.stakeholder-map .pill--right { right: 2%; }

.stakeholder-map .point {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  width: max-content;
  max-width: 18%;
}

.stakeholder-map .dot {
  width: 6px;
  height: 6px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: #f3f3f3;
}

.stakeholder-map .label {
  font-size: clamp(11px, 1.7vw, 13px);
  line-height: 1.08;
  font-weight: 400;
}

/* --- Spiegel: concentric circle diagram --- */
.circle-diagram {
  position: relative;
  width: min(90%, 500px);
  aspect-ratio: 1 / 1;
  margin: 10px auto;
  color: #fff;
}

.circle-diagram .circle {
  position: absolute;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.circle-diagram .circle--outer { width: 100%; height: 100%; background: #0c3a4d; }
.circle-diagram .circle--middle { width: 75%; height: 75%; background: #2f7fa6; }
.circle-diagram .circle--inner { width: 50%; height: 50%; background: #3fa1d1; }

.circle-diagram .item {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.circle-diagram .dot { width: 8px; height: 8px; background: #fff; border-radius: 50%; }
.circle-diagram .label { font-size: 15px; font-weight: 400; line-height: 1.2; }

/* --- Spiegel: process / phases --- */
.process-widget { padding: 6px 8px; }

.process-widget__steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.process-widget__step {
  flex: 1 1 150px;
  min-width: 130px;
  max-width: 170px;
  height: 64px;
  border-radius: 999px;
  background: #44a6dc;
  color: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 16px;
  box-sizing: border-box;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.1;
}

.process-widget__labels {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.process-widget__label {
  color: rgba(255, 255, 255, 0.12);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
}

@media (max-width: 767px) {
  .process-widget__step { flex: 1 1 calc(50% - 12px); max-width: none; height: 56px; font-size: 15px; }
  .process-widget__label { font-size: 20px; }
}

@media (max-width: 480px) {
  .stakeholder-map { width: 100%; aspect-ratio: 580 / 470; }
  .stakeholder-map .pill { width: 41%; font-size: 10px; }
  .circle-diagram .label { font-size: 13px; }
  .process-widget__step { flex: 1 1 100%; min-width: 0; }
}

/* Button */
.btn {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 26px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover { background: var(--accent); color: #fff; }

@media (max-width: 767px) {
  .case-header { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   Unified centered content column
   Keeps every section (nav + homepage sections) aligned to
   the same centered column instead of a wide left-hugging box.
   ========================================================= */
.hero,
.intro-grid,
.experiences { max-width: var(--content-width); }

.timeline { max-width: 100%; }

/* The nav spans wider than the content so it sits near the page edges
   (like the original). Reserve space on the right for the corner switches. */
.site-header .header-inner { max-width: 1240px; padding-right: 168px; }

/* =========================================================
   Language switch (DE/EN) + bilingual content visibility
   Language lives on <html lang>. Set before first paint.
   ========================================================= */
:root[lang="de"] [data-lang="en"] { display: none; }
:root[lang="en"] [data-lang="de"] { display: none; }

.lang-switch {
  position: fixed;
  top: 16px;
  right: 92px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 30px;
  padding: 0 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.lang-switch:hover { border-color: var(--accent); }

.lang-switch span {
  padding: 3px 7px;
  border-radius: 999px;
  opacity: 0.4;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

:root[lang="de"] .lang-switch .lang-de,
:root[lang="en"] .lang-switch .lang-en { opacity: 1; background: var(--border); }

/* =========================================================
   Sidekicks: card grid + placeholders
   ========================================================= */
.sidekicks-intro { max-width: 60ch; color: var(--muted); margin: 0 0 36px; }

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

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover { border-color: var(--accent); transform: translateY(-3px); }

.card__media {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background: var(--border);
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.card__media svg { width: 46px; height: 46px; opacity: 0.55; }

.card__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.card__title { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--text); }
.card__teaser { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.card__more { margin-top: 4px; font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--accent); }

/* Image placeholder (detail pages) */
.placeholder {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
}
.placeholder svg { width: 56px; height: 56px; opacity: 0.5; }

/* Card titles are h2 inside .prose — don't inherit the big section-heading look. */
.card .card__title { font-size: 20px; margin: 0; line-height: 1.25; }
.card .card__title::after { content: none; }
