/* rstadler.com — self-contained, no third-party assets */

:root {
  color-scheme: light dark;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --space-2xs: 0.2rem;
  --space-xs: 0.4rem;
  --space-sm: 0.65rem;
  --space-md: 1.05rem;
  --space-lg: 1.65rem;
  --space-xl: clamp(2rem, 5vw, 4.25rem);
  --space-2xl: clamp(2.65rem, 6vw, 5.25rem);
  --text-max: 42rem;
  --header-h: 3.75rem;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 2px 8px rgba(18, 32, 54, 0.06), 0 12px 32px rgba(18, 32, 54, 0.08);
  --shadow-lg: 0 8px 24px rgba(18, 32, 54, 0.1), 0 28px 64px rgba(18, 32, 54, 0.12);
  --bg: #f0f2f6;
  --bg-elevated: #ffffff;
  --text: #141c28;
  --text-muted: #4d5c6d;
  --border: #cfd6e0;
  --navy: #132338;
  --accent: #1e4d72;
  --accent-hover: #163a57;
  --accent-line: #2d6a9e;
  --accent-soft: rgba(30, 77, 114, 0.1);
  --hero-overlay: linear-gradient(115deg, rgba(19, 35, 56, 0.92) 0%, rgba(19, 35, 56, 0.72) 42%, rgba(19, 35, 56, 0.45) 100%);
  --logo-cloud-bg: #e9edf3;
  --logo-cloud-border: #c8d0dc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0f14;
    --bg-elevated: #141a22;
    --text: #e9eef5;
    --text-muted: #9aa6b5;
    --border: #2a3440;
    --navy: #0a0e14;
    --accent: #7eb3dc;
    --accent-hover: #9ec8e8;
    --accent-line: #6eb0e0;
    --accent-soft: rgba(126, 179, 220, 0.14);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --logo-cloud-bg: #dfe5ee;
    --logo-cloud-border: #b8c2d0;
  }
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -100%;
  z-index: 200;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: var(--space-sm);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  margin: 0 0 var(--space-md);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  margin: 0 0 var(--space-sm);
}

h3 {
  font-size: 1.2rem;
  margin: var(--space-lg) 0 var(--space-sm);
  color: var(--text);
}

h3:first-child {
  margin-top: 0;
}

h4 {
  font-size: 1.05rem;
  margin: var(--space-md) 0 var(--space-xs);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

p {
  margin: 0 0 var(--space-md);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  height: 100%;
}

.brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

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

.menu-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  cursor: pointer;
  color: var(--text);
}

.menu-toggle svg {
  width: 1.35rem;
  height: 1.35rem;
}

.menu-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 1.25rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.nav-group-label {
  display: none;
  width: 100%;
  margin: 0;
  padding: var(--space-sm) 0 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.site-nav .nav-group-label:first-child {
  padding-top: 0;
}

@media (min-width: 52.01rem) {
  .site-nav a[href="impressum.html"]::before {
    content: "";
    display: inline-block;
    width: 1px;
    height: 1em;
    margin-right: 1.25rem;
    margin-left: 0.25rem;
    background: var(--border);
    vertical-align: middle;
    pointer-events: none;
  }
}

@media (max-width: 52rem) {
  .menu-toggle {
    display: flex;
  }

  .nav-group-label {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    padding: var(--space-lg) clamp(1rem, 4vw, 2rem);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
    overflow-y: auto;
  }

  .site-nav a {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
  }

  .site-nav a:last-child {
    border-bottom: none;
  }

  .menu-checkbox:focus-visible ~ .menu-toggle {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .menu-checkbox:checked ~ .site-nav {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: min(76vh, 44rem);
  display: flex;
  align-items: stretch;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--hero-overlay), url("../images/hero-laptop-unsplash.jpg") center / cover no-repeat;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 11.5rem) minmax(0, 1fr);
  gap: var(--space-lg) var(--space-xl);
  align-items: center;
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--space-xl) clamp(1rem, 3.5vw, 1.75rem);
  width: 100%;
}

.hero-portrait {
  justify-self: center;
  align-self: center;
}

/* Frame fixes crop: do not put width×height on <img> (e.g. 1920×1080 breaks 3:4 layout). */
.hero-portrait-frame {
  width: 11.5rem;
  max-width: min(11.5rem, 42vw);
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

.hero-portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}

.hero-copy {
  color: #f2f6fa;
  max-width: 40rem;
}

.hero-copy h1 {
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.35);
}

.hero-whatido {
  font-size: 0.98rem;
  line-height: 1.58;
  opacity: 0.92;
  margin: 0 0 var(--space-xs);
  max-width: 38rem;
}

.hero-whatido--second {
  margin-bottom: var(--space-md);
  opacity: 0.86;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.65rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #fff;
  color: var(--navy);
}

.btn-primary:hover {
  background: #e8eef5;
  color: var(--navy);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.icon-linkedin {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.icon-linkedin:hover {
  background: #0a66c2;
  border-color: #0a66c2;
  color: #fff;
}

.icon-linkedin svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

@media (max-width: 52rem) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
  }

  .hero-portrait {
    order: -1;
  }

  .hero-portrait-frame {
    width: 10rem;
    max-width: min(10rem, 52vw);
    margin: 0 auto;
  }

  .hero-copy {
    margin: 0 auto;
  }

  .hero-whatido,
  .hero-whatido--second {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }
}

/* ——— Sections ——— */
main section {
  padding: var(--space-xl) clamp(1rem, 3.5vw, 1.75rem);
}

.section-inner {
  max-width: 72rem;
  margin: 0 auto;
}

.section-intro {
  max-width: 36rem;
  margin-bottom: var(--space-md);
}

.section-intro h2 {
  position: relative;
  padding-bottom: var(--space-sm);
}

.section-intro h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.75rem;
  height: 2px;
  background: var(--accent-line);
  border-radius: 1px;
}

.section-muted {
  background: color-mix(in srgb, var(--bg-elevated) 65%, var(--bg));
}

.section-lead {
  margin: 0;
  max-width: 40rem;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.experience-stack .section-intro {
  margin-bottom: var(--space-md);
}

.skill-clusters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
}

.skill-cluster {
  margin: 0;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.skill-cluster h3 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-line);
  margin: 0 0 var(--space-xs);
  line-height: 1.3;
}

.skill-cluster p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.58;
  color: var(--text);
}

.experience-banner {
  margin: var(--space-lg) 0 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

figure.experience-banner {
  margin-left: 0;
  margin-right: 0;
}

.experience-banner img {
  display: block;
  width: 100%;
  height: clamp(10rem, 22vw, 15rem);
  object-fit: cover;
  object-position: center 42%;
}

@media (max-width: 52rem) {
  .skill-clusters {
    grid-template-columns: 1fr;
  }
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg) var(--space-xl);
  align-items: center;
}

.split.reverse {
  direction: rtl;
}

.split.reverse > * {
  direction: ltr;
}

.split-visual img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.content-lists ul:not(.logo-cloud):not(.partner-logos) {
  margin: 0;
  padding-left: 1.2rem;
}

.content-lists li {
  margin-bottom: var(--space-sm);
}

.content-lists li::marker {
  color: var(--accent);
}

@media (max-width: 52rem) {
  .split,
  .split.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .split-visual {
    order: -1;
  }

  .split.reverse .split-visual {
    order: -1;
  }
}

.logo-cloud {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--logo-cloud-bg);
  border: 1px solid var(--logo-cloud-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: grid;
  /* 16 tiles: tight square on small viewports → two rows → one row when wide enough */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm) var(--space-md);
  justify-items: center;
  align-items: center;
  max-width: 100%;
  list-style: none;
  margin-left: 0;
  margin-bottom: 0;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

@media (min-width: 36rem) {
  .logo-cloud {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

@media (min-width: 62rem) {
  .logo-cloud {
    grid-template-columns: repeat(16, minmax(0, 1fr));
  }
}

.logo-tile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 2.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
}

.logo-tile-link:hover {
  opacity: 0.88;
}

.logo-tile-link:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}

.logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.1rem;
  height: 3.1rem;
  padding: var(--space-2xs);
  margin: 0;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(18, 32, 54, 0.06);
}

.logo-tile img {
  width: 1.95rem;
  height: 1.95rem;
  object-fit: contain;
  display: block;
}

.logo-cloud-note {
  margin: var(--space-md) auto 0;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--logo-cloud-border);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
  max-width: 36rem;
}

.logo-cloud-note a {
  font-weight: 500;
}

.partner-logos {
  list-style: none;
  margin: 0 0 var(--space-md);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: var(--space-sm) var(--space-md);
  align-items: stretch;
}

.partner-logos > li {
  margin: 0;
  min-width: 0;
}

.partner-logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 4rem;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.partner-logo-card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-lg);
}

.partner-logo-card:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 3px;
}

.partner-logo-img {
  display: block;
  width: auto;
  height: 2.4rem;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}

/* ——— Legal / prose pages ——— */
.legal-page {
  padding: var(--space-xl) clamp(1rem, 3.5vw, 1.75rem) calc(var(--space-xl) * 1.35);
}

.legal-inner {
  max-width: var(--text-max);
  margin: 0 auto;
}

.legal-inner h1 {
  margin-bottom: var(--space-lg);
}

.legal-inner h2 {
  font-size: 1.35rem;
  margin-top: var(--space-lg);
}

/* ——— Footer ——— */
.site-footer {
  padding: var(--space-md) clamp(1rem, 3.5vw, 1.75rem);
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--accent);
}
