/* ==========================================================================
   Gian Kappeler · Lebenslauf-Website
   Identität: tiefes Tannengrün + Papier-Creme, abgeleitet vom gedruckten CV.
   Farben und Abstände unten anpassen, der Rest folgt automatisch.
   ========================================================================== */

:root {
  /* Farben (grün getönte Neutraltöne, kein reines Schwarz/Weiss) */
  --paper:        #F6F2E8;
  --paper-raise:  #FCF9F0;
  --paper-deep:   #EFEADC;
  --ink:          #1D2B23;
  --muted:        #5E6E63;
  --line:         #DDD5C2;
  --line-soft:    #E7E0CE;

  --pine-950:     #10271D;
  --pine-900:     #163527;
  --pine-800:     #1D4432;
  --leaf:         #34684C;
  --leaf-soft:    #4E8465;
  --sage:         #A9C2B0;
  --cream:        #F3EFE2;
  --cream-dim:    #CFD9CC;

  /* Typografie */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;

  /* Bewegung */
  --ease-out:     cubic-bezier(0.23, 1, 0.32, 1);
  --ease-hover:   cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Masse */
  --container:    1100px;
  --header-h:     76px;
}

/* ---------- Basis ---------- */

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.12; }
p, ul, ol { margin: 0; }
img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

::selection { background: var(--pine-800); color: var(--cream); }

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

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 36px);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--pine-950);
  color: var(--cream);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: top 150ms var(--ease-out);
}
.skip-link:focus-visible { top: 14px; outline-color: var(--cream); }

/* ---------- Scroll-Reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 600ms var(--ease-out),
    transform 600ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 70ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
/* Ohne JavaScript: alles sichtbar, Sprachbalken gefüllt */
html:not(.js) .bar i { width: var(--w); }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  color: var(--cream);
  transition:
    background-color 220ms var(--ease-hover),
    color 220ms var(--ease-hover),
    box-shadow 220ms var(--ease-hover);
}
.site-header.is-scrolled {
  color: var(--ink);
  background: rgba(246, 242, 232, 0.86);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 1px 0 var(--line);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); }

.nav-links {
  display: flex;
  gap: clamp(14px, 2.5vw, 30px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.82;
  padding-block: 6px;
  transition: opacity 160ms ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 2px;
  background: currentColor;
  transition: right 220ms var(--ease-out);
}
.nav-links a.is-active { opacity: 1; }
.nav-links a.is-active::after { right: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 140ms var(--ease-out),
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}
.btn:active { transform: scale(0.97); }

.btn-solid { background: var(--cream); color: var(--pine-950); }
.btn-ghost { border-color: rgba(243, 239, 226, 0.38); color: var(--cream); }

.btn-nav {
  padding: 9px 18px;
  font-size: 0.92rem;
  border-color: currentColor;
  color: inherit;
  background: transparent;
}

.ext { font-size: 0.85em; transform: translateY(-1px); }

.btn .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-right: -2px;
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { opacity: 1; }
  .nav-links a:hover::after { right: 0; }
  .btn-solid:hover { background: #FFFDF4; transform: translateY(-1px); }
  .btn-ghost:hover { border-color: rgba(243, 239, 226, 0.85); transform: translateY(-1px); }
  .btn-nav:hover { background: var(--pine-950); border-color: var(--pine-950); color: var(--cream); transform: none; }
  .site-header:not(.is-scrolled) .btn-nav:hover { background: var(--cream); border-color: var(--cream); color: var(--pine-950); }
}

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

.hero {
  position: relative;
  background:
    radial-gradient(900px 480px at 84% -10%, rgba(78, 132, 101, 0.32), transparent 65%),
    radial-gradient(700px 420px at -10% 110%, rgba(29, 68, 50, 0.55), transparent 60%),
    var(--pine-950);
  color: var(--cream);
  padding-top: calc(var(--header-h) + clamp(40px, 8vh, 88px));
  padding-bottom: clamp(64px, 10vh, 120px);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid rgba(243, 239, 226, 0.22);
  border-radius: 999px;
  background: rgba(243, 239, 226, 0.07);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--cream-dim);
  margin-bottom: 26px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7FBE99;
  box-shadow: 0 0 0 3px rgba(127, 190, 153, 0.22);
}

.hero h1 {
  font-size: clamp(2.9rem, 2rem + 4.5vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero-role {
  margin-top: 16px;
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.18rem);
  font-weight: 500;
  color: var(--sage);
}

.hero-lead {
  margin-top: 22px;
  max-width: 56ch;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--cream-dim);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

/* Porträt im Bogenrahmen, mit Rauten-Echo aus dem gedruckten CV */
.hero-portrait { position: relative; justify-self: end; }
.hero-portrait::before {
  content: "";
  position: absolute;
  top: -7%;
  right: -11%;
  width: 62%;
  aspect-ratio: 1;
  border: 1px solid rgba(169, 194, 176, 0.22);
  transform: rotate(45deg);
  pointer-events: none;
}

.portrait-frame {
  position: relative;
  width: min(360px, 74vw);
  padding: 12px;
  border: 1px solid rgba(169, 194, 176, 0.55);
  border-radius: 50%;
  background: rgba(169, 194, 176, 0.06);
  box-shadow: 0 0 0 7px rgba(78, 132, 101, 0.10);
}
.portrait-frame img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  object-position: 50% 26%;
  border-radius: 50%;
}

/* ---------- Sektionen ---------- */

.section { padding-block: clamp(72px, 11vh, 120px); }
.section-alt { background: var(--paper-deep); }

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.section-head h2 {
  font-size: clamp(1.85rem, 1.4rem + 1.8vw, 2.7rem);
  letter-spacing: -0.005em;
}
.rule { flex: 1; height: 1px; background: var(--line); }

.diamond {
  flex: none;
  width: 10px;
  height: 10px;
  background: var(--leaf);
  transform: rotate(45deg);
}
.diamond-light { background: var(--sage); display: inline-block; }

.section-sub {
  margin-top: 14px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.overline {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--leaf);
}

/* ---------- Projekte ---------- */

#projekte .card-feature { margin-top: 44px; }

.card {
  background: var(--paper-raise);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(24px, 3.5vw, 38px);
  transition:
    transform 200ms var(--ease-out),
    border-color 200ms ease,
    box-shadow 200ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-3px);
    border-color: #CFC6AD;
    box-shadow: 0 14px 34px -18px rgba(20, 43, 32, 0.28);
  }
  .card-feature:hover { border-color: var(--pine-800); }
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 20px;
  margin-bottom: 14px;
}
.card h3 { font-size: 1.42rem; }
.card-meta { font-size: 0.9rem; font-weight: 500; color: var(--muted); }

.card p { color: var(--ink); }
.card > p + p { margin-top: 10px; }

.card-feature {
  background:
    radial-gradient(640px 320px at 100% 0%, rgba(78, 132, 101, 0.28), transparent 60%),
    var(--pine-900);
  border-color: var(--pine-800);
  color: var(--cream);
}
.card-feature h3 { font-size: 1.6rem; }
.card-feature .card-meta { color: var(--sage); }
.card-feature p { color: var(--cream-dim); }
.card-feature .overline { color: #8FBCA1; margin-bottom: 8px; }

.feature-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 40px);
  margin-block: 10px 24px;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-weight: 600;
  color: var(--leaf);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .text-link:hover { color: var(--pine-800); }
}

.section-note {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 28px;
  max-width: 64ch;
  color: var(--muted);
  font-size: 0.98rem;
}
.section-note .diamond {
  position: relative;
  top: 1px;
  width: 8px;
  height: 8px;
  background: var(--sage);
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}
.chips li {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
}
.chips-dark li {
  border-color: rgba(243, 239, 226, 0.22);
  background: rgba(243, 239, 226, 0.07);
  color: var(--cream-dim);
}

/* ---------- Berufserfahrung (Timeline) ---------- */

.timeline {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
}

.timeline-item {
  position: relative;
  padding-left: 36px;
  padding-bottom: 48px;
}
.timeline-item:last-child { padding-bottom: 0; }

/* Verbindungslinie */
.timeline-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 22px;
  bottom: -2px;
  width: 1px;
  background: var(--line);
}
.timeline-item:last-child::before { display: none; }

/* Rauten-Marker */
.timeline-item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 11px;
  height: 11px;
  background: var(--leaf);
  transform: rotate(45deg);
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
}
.entry-head h3, .edu-item h3 { font-size: 1.38rem; }

.entry-date {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--leaf);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.entry-org {
  margin-top: 6px;
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--muted);
}

.entry-points {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  max-width: 72ch;
}
.entry-points li {
  position: relative;
  padding-left: 22px;
  margin-top: 9px;
}
.entry-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--sage);
  transform: rotate(45deg);
}

/* ---------- Technik ---------- */

.skill-group { margin-top: 36px; }
#technik .skill-group:first-of-type { margin-top: 44px; }
.skill-group .chips { margin-top: 12px; }
.skill-group .chips li { background: var(--paper-raise); }

.duo {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 5vw, 72px);
  margin-top: 56px;
  padding-top: 44px;
  border-top: 1px solid var(--line-soft);
}

.lang {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  margin-top: 22px;
}
.lang-name { font-weight: 600; }
.lang-level { font-size: 0.92rem; color: var(--muted); align-self: baseline; }

.bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pine-800), var(--leaf-soft));
  transition: width 900ms var(--ease-out) 180ms;
}
.langs.is-visible .bar i { width: var(--w); }

.strength-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 0;
  font-size: 1.05rem;
  font-weight: 500;
}
.strength-list li { display: inline-flex; align-items: center; }
.strength-list li + li::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--leaf);
  transform: rotate(45deg);
  margin-inline: 14px;
}

/* ---------- Ausbildung ---------- */

.edu-list {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
}
.edu-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  padding-block: 26px;
  border-bottom: 1px solid var(--line);
}
.edu-item:first-child { border-top: 1px solid var(--line); }
.edu-item .entry-org { margin-top: 4px; }

/* ---------- Kontakt + Footer ---------- */

.contact {
  background:
    radial-gradient(820px 420px at 12% 0%, rgba(78, 132, 101, 0.3), transparent 62%),
    var(--pine-950);
  color: var(--cream);
  padding-top: clamp(80px, 12vh, 140px);
}

.contact-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact h2 {
  margin-top: 22px;
  font-size: clamp(2.2rem, 1.6rem + 3vw, 3.6rem);
}

.contact-lead {
  margin-top: 20px;
  max-width: 54ch;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--cream-dim);
}

.contact-actions { justify-content: center; margin-top: 38px; }

.contact-note {
  margin-top: 26px;
  font-size: 0.92rem;
  color: var(--sage);
}

.contact :focus-visible, .hero :focus-visible, .site-header:not(.is-scrolled) :focus-visible {
  outline-color: var(--cream);
}

.site-footer {
  margin-top: clamp(64px, 10vh, 110px);
  border-top: 1px solid rgba(243, 239, 226, 0.14);
  padding-block: 26px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  font-size: 0.9rem;
  color: var(--sage);
}
.footer-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 160ms ease, border-color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .footer-link:hover { color: var(--cream); border-bottom-color: currentColor; }
}

/* ---------- Rechtliches (Impressum & Datenschutz) ---------- */

.legal { padding-top: calc(var(--header-h) + clamp(40px, 7vh, 72px)); }

.legal-body {
  margin-top: 40px;
  max-width: 70ch;
}
.legal-body h3 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem);
  margin-top: 52px;
}
.legal-body h3:first-child { margin-top: 0; }
.legal-body h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  margin: 32px 0 0;
}
.legal-body p { margin-top: 14px; color: var(--ink); }
.legal-body .legal-hint { color: var(--muted); font-size: 0.96rem; }

.legal-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.legal-list li {
  position: relative;
  padding-left: 22px;
  margin-top: 9px;
}
.legal-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--sage);
  transform: rotate(45deg);
}

/* Eigenständiger Footer (z. B. Rechtsseite) — heller Hintergrund */
.site-footer--standalone {
  margin-top: 0;
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.site-footer--standalone .footer-inner { color: var(--muted); }
.site-footer--standalone a { color: inherit; text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .site-footer--standalone a:hover { color: var(--ink); }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-portrait { order: -1; justify-self: start; }
  .hero-portrait::before { right: -6%; }
  .portrait-frame { width: min(280px, 64vw); }
  .feature-cols { grid-template-columns: 1fr; gap: 18px; }
  .card-grid { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  body { font-size: 1rem; }
  .entry-head, .card-head { flex-direction: column; align-items: flex-start; }
  .edu-item { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ---------- Reduzierte Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    transform: none;
    transition: opacity 280ms ease;
  }
  .bar i { transition: none; }
  .btn, .card, .nav-links a::after { transition: none; }
  .btn:active { transform: none; }
}
