/* ==========================================================================
   stefan-altheimer.de — main stylesheet
   Dark theme, yellow accent, Poppins. Replaces the old Bootstrap/SCSS build.
   ========================================================================== */

/* ---- Fonts (self-hosted) ------------------------------------------------ */

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/poppins/poppins-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/poppins/poppins-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/poppins/poppins-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/poppins/poppins-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/poppins/poppins-900.woff2') format('woff2');
}

/* ---- Tokens -------------------------------------------------------------- */

:root {
  --bg: #000;
  --text: #999;
  --text-soft: #777;
  --heading: #fff;
  --primary: #ffbd39;
  --card: rgba(255, 255, 255, .1);
  --card-hover: rgba(255, 255, 255, .16);
  --line: rgba(255, 255, 255, .12);
  --ghost: rgba(255, 255, 255, .1);
  --radius: 5px;
  --nav-h: 64px;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---- Reset & base -------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

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

h1, h2, h3, h4 {
  color: var(--heading);
  line-height: 1.4;
  font-weight: 700;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color .3s ease, opacity .3s ease;
}

a:hover {
  color: var(--primary);
  opacity: .8;
}

ul {
  list-style: none;
}

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

section[id] {
  scroll-margin-top: var(--nav-h);
}

.container {
  width: min(1140px, 100% - 2.5rem);
  margin-inline: auto;
}

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

/* ---- Navigation ----------------------------------------------------------- */

.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background .3s ease, box-shadow .3s ease;
}

.site-nav.scrolled {
  background: rgba(0, 0, 0, .85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 900;
  font-size: 1.35rem;
  text-transform: uppercase;
  color: var(--heading);
  letter-spacing: .02em;
}

.brand:hover {
  color: var(--heading);
  opacity: 1;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: .75rem .25rem;
  z-index: 102;
}

.nav-toggle .bar {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--heading);
  transition: transform .3s ease, opacity .3s ease;
}

.nav-toggle .bar + .bar {
  margin-top: 6px;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-menu {
  display: flex;
  gap: .25rem;
}

.nav-link {
  display: block;
  padding: .6rem 1.1rem;
  color: var(--heading);
  font-size: 1rem;
}

.nav-link span {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}

.nav-link span::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}

.nav-link:hover {
  color: var(--heading);
  opacity: 1;
}

.nav-link:hover span::after,
.nav-link.active span::after {
  transform: scaleX(1);
}

.nav-link.active {
  color: var(--primary);
}

/* Simple variant: always-visible horizontal menu, no hamburger (imprint, blog) */
.site-nav.simple .nav-menu {
  position: static;
  flex-direction: row;
  max-height: none;
  opacity: 1;
  visibility: visible;
  background: none;
  border: 0;
  padding: 0;
  overflow: visible;
}

.site-nav.simple .nav-link {
  padding: .6rem 1.1rem;
}

@media (max-width: 991px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    background: rgba(0, 0, 0, .85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .nav-menu {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(0, 0, 0, .97);
    border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem 1.25rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height .35s ease, opacity .3s ease, visibility 0s linear .35s;
  }

  .nav-menu.open {
    max-height: 26rem;
    opacity: 1;
    visibility: visible;
    transition: max-height .35s ease, opacity .3s ease;
  }

  .nav-link {
    padding: .75rem 0;
    font-size: 1.05rem;
  }
}

/* ---- Hero ------------------------------------------------------------------ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: end;
  gap: 2rem;
  padding-top: var(--nav-h);
}

.hero-text {
  align-self: center;
  padding-block: 4rem;
}

.hero-text .subheading {
  display: block;
  color: var(--primary);
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: .9rem;
  margin-bottom: .75rem;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-text h1 .name {
  color: var(--primary);
}

.hero-text .tagline {
  color: var(--text);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 400;
}

.hero-portrait {
  align-self: end;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-portrait img {
  max-height: min(78svh, 640px);
  width: auto;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, .6));
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent);
  pointer-events: none;
}

@media (max-width: 767px) {
  .hero .container {
    grid-template-columns: 1fr;
    align-items: end;
  }

  .hero-text {
    padding-block: 3rem 0;
    text-align: left;
  }

  .hero-portrait img {
    max-height: 48svh;
  }
}

/* ---- Section headings ------------------------------------------------------- */

.section-head {
  position: relative;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-head .ghost {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-58%);
  font-size: clamp(3.5rem, 10vw, 7.5rem);
  font-weight: 900;
  color: var(--ghost);
  line-height: 1;
  z-index: 0;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
}

.section-head h2 {
  position: relative;
  z-index: 1;
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 700;
}

.section-head .lead {
  position: relative;
  z-index: 1;
  margin-top: .25rem;
}

.section-head.centered {
  text-align: center;
}

/* ---- About ------------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

.about-photo {
  border-radius: var(--radius);
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}

.about-quote {
  font-style: italic;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.about-facts li {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: .5rem;
  padding-block: .35rem;
  border-bottom: 1px solid var(--line);
}

.about-facts li:last-child {
  border-bottom: 0;
}

.about-facts .k {
  color: var(--heading);
  font-weight: 600;
}

@media (max-width: 767px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-photo img {
    aspect-ratio: 1 / 1;
  }
}

/* ---- Cards (shared) ------------------------------------------------------------ */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.875rem;
  transition: background .3s ease, transform .3s ease;
}

/* ---- Résumé ---------------------------------------------------------------------- */

.resume-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.875rem;
  align-items: start;
}

.resume-col {
  display: grid;
  gap: 1.875rem;
}

.resume-item .date {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}

.resume-item h3 {
  font-size: 1.4rem;
  margin-bottom: .15rem;
}

.resume-item .position {
  display: block;
  color: var(--text-soft);
  font-size: .95rem;
  margin-bottom: 1rem;
}

.resume-item ul {
  list-style: disc;
  padding-left: 1.2rem;
}

.resume-item li {
  margin-bottom: .35rem;
}

@media (max-width: 767px) {
  .resume-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Services ------------------------------------------------------------------------ */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.875rem;
}

.service-card {
  text-align: center;
  padding: 2.5rem 1.75rem;
  color: var(--text);
}

.service-card:hover {
  background: var(--card-hover);
  transform: translateY(-6px);
  color: var(--text);
  opacity: 1;
}

.service-card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 189, 57, .12);
  color: var(--primary);
  margin-bottom: 1.25rem;
  transition: background .3s ease;
}

.service-card:hover .icon {
  background: rgba(255, 189, 57, .22);
}

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

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

@media (max-width: 991px) {
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Skills -------------------------------------------------------------------------------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2.5rem;
}

.skill h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: .5rem;
}

.skill-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--card);
  overflow: hidden;
}

.skill-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: var(--primary);
  transition: width 1.2s cubic-bezier(.25, .7, .3, 1);
}

.skill.in-view .skill-bar i {
  width: var(--value);
}

.skill .pct {
  float: right;
  font-size: .85rem;
  color: var(--text-soft);
  font-weight: 500;
}

@media (max-width: 767px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Certification badges ---------------------------------------------------- */

.cert-badges {
  margin-top: 3rem;
  text-align: center;
}

.cert-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.cert-badges ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
}

.cert-badges li {
  background: var(--card);
  border: 1px solid rgba(255, 189, 57, .35);
  color: var(--heading);
  font-size: .85rem;
  font-weight: 500;
  padding: .35rem 1rem;
  border-radius: 999px;
  transition: background .3s ease, border-color .3s ease;
}

.cert-badges li:hover {
  background: rgba(255, 189, 57, .15);
  border-color: var(--primary);
}

/* ---- Counters --------------------------------------------------------------------------------- */

.counters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  text-align: center;
}

.counter .number {
  display: block;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.counter .label {
  color: var(--text);
  font-size: .95rem;
}

@media (max-width: 767px) {
  .counters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- Availability band --------------------------------------------------------------------------- */

.availability {
  position: relative;
  background: url('../images/availability.webp') center / cover no-repeat;
  text-align: center;
}

.availability::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .75);
}

.availability .container {
  position: relative;
}

.availability h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 600;
  max-width: 46rem;
  margin-inline: auto;
}

.availability h2 .hl {
  color: var(--primary);
}

/* ---- Contact ---------------------------------------------------------------------------------------- */

.contact-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.contact-card {
  text-align: center;
  padding: 2rem 1.25rem;
}

.contact-card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 189, 57, .12);
  color: var(--primary);
  margin-bottom: 1rem;
}

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

.contact-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: .35rem;
}

.contact-card p {
  overflow-wrap: anywhere;
  font-size: .95rem;
}

@media (max-width: 991px) {
  .contact-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .contact-cards {
    grid-template-columns: 1fr;
  }
}

.contact-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: var(--radius);
  overflow: hidden;
}

.contact-image {
  background: url('../images/contact.webp') center / cover no-repeat;
  min-height: 320px;
}

.contact-form {
  background: var(--card);
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--heading);
  font: inherit;
  padding: .8rem 1rem;
  transition: border-color .3s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-soft);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

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

.btn {
  display: inline-block;
  background: var(--primary);
  color: #000;
  font-weight: 600;
  border: 0;
  border-radius: var(--radius);
  padding: .9rem 2.5rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  justify-self: start;
  transition: opacity .3s ease, transform .3s ease;
}

.btn:hover {
  opacity: .85;
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: .5;
  cursor: wait;
  transform: none;
}

.form-status {
  font-size: .95rem;
  min-height: 1.5em;
}

.form-status.ok {
  color: #7ddb8a;
}

.form-status.error {
  color: #ff7a7a;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 767px) {
  .contact-split {
    grid-template-columns: 1fr;
  }

  .contact-image {
    min-height: 220px;
    order: 2;
  }
}

/* ---- Footer -------------------------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 3.5rem 2rem;
  font-size: .95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-col h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-col li {
  margin-bottom: .4rem;
}

.footer-col a {
  color: var(--text);
}

.footer-col a:hover {
  color: var(--primary);
  opacity: 1;
}

.footer-social {
  display: flex;
  gap: .75rem;
  margin-top: 1.25rem;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  color: var(--heading);
}

.footer-social a:hover {
  background: var(--primary);
  color: #000;
  opacity: 1;
}

.footer-social svg {
  width: 20px;
  height: 20px;
}

.footer-bottom {
  text-align: center;
  color: var(--text-soft);
  font-size: .85rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

@media (max-width: 991px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Reveal animations -------------------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* ---- Back to top ------------------------------------------------------------------------------------------------ */

.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
}

.to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .3s ease, transform .3s ease;
}

.to-top:hover {
  color: #000;
  opacity: .85;
}

.to-top svg {
  width: 22px;
  height: 22px;
}

/* ---- Imprint page ---------------------------------------------------------------------------------------------- */

.imprint-content {
  max-width: 50rem;
  margin-inline: auto;
  padding-top: var(--nav-h);
}

.imprint-content h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin-bottom: 1.5rem;
}

.imprint-content h2 {
  font-size: 1.3rem;
  margin: 2rem 0 .75rem;
}

.imprint-content h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 .5rem;
}

.imprint-content p {
  margin-bottom: 1rem;
}

.imprint-content ul {
  list-style: disc;
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

/* ---- Reduced motion --------------------------------------------------------------------------------------------- */

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

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .skill .skill-bar i {
    width: var(--value);
  }
}
