/* ---------------------------------------------------------------
   Markus Hinterleitner – persönliche Homepage
   ------------------------------------------------------------- */

:root {
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;

  --color-bg: #ffffff;
  --color-bg-alt: #f4f7fa;
  --color-surface: #ffffff;
  --color-text: #1b2733;
  --color-text-muted: #4b5b6b;
  --color-primary: #0f2942;
  --color-primary-dark: #081a2c;
  --color-heading: #0f2942;
  --color-accent: #8a5c00;
  --color-accent-bg: #f2b134;
  --color-accent-contrast: #17222c;
  --color-border: #dfe6ec;
  --color-focus: #1f6fd6;

  --max-width: 72rem;
  --radius: 0.75rem;
  --shadow: 0 1px 2px rgba(15, 41, 66, 0.06), 0 8px 24px rgba(15, 41, 66, 0.08);
  --transition: 180ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b1620;
    --color-bg-alt: #0f1e2c;
    --color-surface: #122333;
    --color-text: #e7eef4;
    --color-text-muted: #aebccb;
    --color-primary: #2f6fb0;
    --color-primary-dark: #1f5c94;
    --color-heading: #9dc0e6;
    --color-accent: #f2b134;
    --color-accent-bg: #f2b134;
    --color-accent-contrast: #17222c;
    --color-border: #253b4f;
    --color-focus: #6fb1ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

/* ---------- Reset & base ---------- */
*,
*::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;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-heading);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

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

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

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

h1 {
  font-size: clamp(2rem, 4vw + 1rem, 3.25rem);
}

h2 {
  font-size: clamp(1.5rem, 2vw + 1rem, 2.25rem);
  margin-bottom: 0.75em;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.35em;
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wrap {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.visually-hidden {
  position: absolute;
  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;
  top: -3rem;
  left: 1rem;
  background: var(--color-primary);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 0.5rem 0.5rem;
  z-index: 1000;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 0;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text);
  font-size: 1.05rem;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1.25rem;
  height: 2px;
  background: var(--color-text);
  transform: translateX(-50%);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle-icon {
  top: 50%;
  transform: translate(-50%, -50%);
}

.nav-toggle-icon::before {
  top: -0.4rem;
}

.nav-toggle-icon::after {
  top: 0.4rem;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0;
  transform: translateX(-50%) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  top: 0;
  transform: translateX(-50%) rotate(-45deg);
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.primary-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--color-text);
  padding: 0.35rem 0.1rem;
  border-bottom: 2px solid transparent;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  color: var(--color-heading);
  border-bottom-color: var(--color-accent-bg);
}

.nav-cta {
  background: var(--color-primary);
  color: #fff !important;
  padding: 0.55rem 1.1rem !important;
  border-radius: 999px;
  border-bottom: none !important;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--color-primary-dark);
}

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

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
  }

  .primary-nav.is-open {
    max-height: 24rem;
  }

  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1.25rem;
  }

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

  .primary-nav li:last-child {
    border-bottom: none;
    padding-top: 0.75rem;
  }

  .primary-nav a {
    display: block;
    padding: 0.85rem 0.1rem;
  }

  .nav-cta {
    text-align: center;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(2.5rem, 6vw, 5rem);
  background: linear-gradient(180deg, var(--color-bg-alt), var(--color-bg) 70%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--color-accent);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 38rem;
}

.hero-highlights {
  margin: 1.5rem 0;
  display: grid;
  gap: 0.65rem;
}

.hero-highlights li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--color-text);
}

.hero-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--color-accent-bg);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform var(--transition), background var(--transition), color var(--transition);
  min-height: 2.75rem;
}

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

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-primary-dark);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  border-color: var(--color-heading);
  color: var(--color-heading);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--color-primary);
  color: #fff;
}

.hero-media {
  justify-self: center;
}

.portrait {
  width: min(100%, 22rem);
  aspect-ratio: 700 / 1050;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 6px solid var(--color-surface);
  outline: 1px solid var(--color-border);
}

@media (max-width: 56rem) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-highlights {
    text-align: left;
  }

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

  .hero-media {
    order: -1;
  }

  .portrait {
    width: min(100%, 16rem);
  }
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.section-alt {
  background: var(--color-bg-alt);
}

.lead {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 48rem;
}

.profil-grid {
  display: grid;
  gap: 1.25rem;
  max-width: 56rem;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
  padding-left: 1.75rem;
  border-left: 2px solid var(--color-border);
}

.timeline-item {
  position: relative;
}

.timeline-marker {
  position: absolute;
  left: -2.35rem;
  top: 0.3rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--color-surface);
  border: 3px solid var(--color-primary);
}

.timeline-current .timeline-marker {
  background: var(--color-accent-bg);
  border-color: var(--color-accent-bg);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent-bg) 25%, transparent);
}

.timeline-date {
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 0.15rem;
  font-size: 0.95rem;
}

.timeline-org {
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-current .timeline-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.timeline-details {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.timeline-details li {
  position: relative;
  padding-left: 1.25rem;
}

.timeline-details li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--color-accent);
}

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card p {
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* ---------- Education ---------- */
.edu-list {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
  max-width: 44rem;
}

.edu-list li {
  padding-left: 1.5rem;
  border-left: 3px solid var(--color-accent-bg);
}

.edu-list p {
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* ---------- Contact ---------- */
.contact-list {
  font-style: normal;
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  max-width: 28rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  transition: border-color var(--transition), transform var(--transition);
}

a.contact-item:hover,
a.contact-item:focus-visible {
  border-color: var(--color-accent-bg);
  transform: translateX(4px);
  color: var(--color-text);
}

.contact-item-static {
  cursor: default;
}

.contact-item-static:hover {
  transform: none;
}

.contact-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: 1.5rem;
  color: var(--color-text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

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

/* ---------- Print ---------- */
@media print {
  .site-header,
  .hero-actions,
  .nav-toggle {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  .section {
    padding-block: 1.5rem;
  }
}
