/* ============================================================
   Stefan Spiess — Website
   Design system: Atkinson Hyperlegible · B&W · Whitespace-first
   No framework. Responsive via custom media queries.
   ============================================================ */

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/atkinson-normal-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/atkinson-normal-700-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/atkinson-italic-400-latin.woff2') format('woff2');
}

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

:root {
  --color-bg:       #ffffff;
  --color-text:     #0a0a0a;
  --color-muted:    #5a5a5a;
  --color-rule:     #d0d0d0;
  --color-tag-bg:   #f0f0f0;
  --color-tag-text: #2a2a2a;

  --font: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --max-w: 720px;
  --gutter: clamp(24px, 5vw, 72px);
  --section-gap: clamp(72px, 12vw, 120px);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.6;
  background: var(--color-bg);
  color: var(--color-text);
}

a { color: inherit; text-decoration: none; }

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: var(--section-gap) var(--gutter); max-width: var(--max-w); margin: 0 auto; }

hr.rule { border: none; border-top: 1px solid var(--color-rule); margin: 2.5em 0; }

/* ---------- Typography ---------- */
h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.6em;
}

h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  margin-bottom: 0.5em;
}

p { margin-bottom: 0.8em; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 700; }

/* ---------- Navigation ---------- */
nav {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-rule);
  z-index: 100;
  padding: 0 var(--gutter);
}

nav .nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

nav .nav-logo {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav ul li a {
  font-size: 0.82rem;
  color: var(--color-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s;
}

nav ul li a:hover { color: var(--color-text); }

/* ---------- Lang toggle ---------- */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--color-rule);
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s;
}

.lang-btn.active {
  color: var(--color-text);
  font-weight: 700;
  border-bottom-color: var(--color-text);
}

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

/* ---------- Burger button ---------- */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin: -4px;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
  transform-origin: center;
}

.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Mobile menu overlay ---------- */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 56px 0 0 0;
  background: var(--color-bg);
  z-index: 99;
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--color-rule);
  flex-direction: column;
}

.mobile-menu.is-open { display: flex; }

.mobile-menu a {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0.9em 0;
  border-bottom: 1px solid var(--color-rule);
  color: var(--color-text);
}

.mobile-menu a:first-child { border-top: 1px solid var(--color-rule); }

.mobile-menu-divider {
  border: none;
  border-top: 2px solid var(--color-rule);
  margin: 0.5rem 0;
}

.mobile-menu hr + a {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-muted, #666);
  border-top: 1px solid var(--color-rule);
}

@media (max-width: 560px) {
  nav ul { display: none; }
  .burger { display: flex; }
}

/* ---------- Hero ---------- */
#hero {
  padding: clamp(80px, 14vw, 140px) var(--gutter) clamp(64px, 10vw, 100px);
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
}

.hero-photo {
  width: clamp(100px, 18vw, 160px);
  height: clamp(100px, 18vw, 160px);
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(100%);
  opacity: 0.88;
  display: block;
  align-self: start;
  margin-top: 8px;
}

.hero-subtitle {
  font-size: clamp(0.82rem, 1.8vw, 0.95rem);
  color: var(--color-muted);
  margin-top: 0.6em;
  font-weight: 400;
}

.hero-slogan {
  font-size: clamp(0.82rem, 1.6vw, 0.9rem);
  color: var(--color-muted);
  font-style: italic;
  line-height: 1.7;
  border-top: 1px solid var(--color-rule);
  padding-top: 1.2em;
  margin-top: 1.8em;
}

@media (max-width: 500px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { width: 100px; height: 100px; }
}

/* ---------- Tags ---------- */
.tag {
  display: inline-block;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  border-radius: 3px;
  padding: 0.15em 0.55em;
  font-size: 0.75rem;
  margin: 0.2em 0.25em 0.2em 0;
  font-weight: 400;
}

/* ---------- Service / expertise cards ---------- */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 1.4em;
}

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

.card {
  border-top: 2px solid var(--color-text);
  padding-top: 1.1em;
}

.card h3 { margin-bottom: 0.4em; }

.card p {
  font-size: 0.88rem;
  color: var(--color-muted);
  line-height: 1.6;
}

/* ---------- How I work ---------- */
.values-list {
  list-style: none;
  margin-top: 1.4em;
  display: flex;
  flex-direction: column;
  gap: 1.1em;
}

.values-list li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: baseline;
  border-top: 1px solid var(--color-rule);
  padding-top: 1em;
}

.values-list li:first-child { border-top: none; padding-top: 0; }

.values-label {
  font-weight: 700;
  font-size: 0.88rem;
}

.values-text {
  font-size: 0.88rem;
  color: var(--color-muted);
  line-height: 1.6;
}

@media (max-width: 520px) {
  .values-list li { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- Projects ---------- */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 1.4em;
}

.project-item {
  border-top: 1px solid var(--color-rule);
  padding: 1.2em 0;
}

.project-item:last-child { border-bottom: 1px solid var(--color-rule); }

.project-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.3em;
}

.project-desc {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: 0.5em;
}

/* ---------- Contact ---------- */
#contact {
  padding: var(--section-gap) var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
  padding-bottom: clamp(80px, 12vw, 120px);
}

.contact-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  margin-bottom: 1.6em;
}

.contact-cta {
  display: inline-block;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 700;
  color: var(--color-text);
  border-bottom: 2px solid var(--color-text);
  padding-bottom: 0.1em;
  margin-bottom: 1.4em;
  letter-spacing: -0.01em;
  transition: opacity 0.15s;
}

.contact-cta:hover { opacity: 0.6; }

.contact-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 2.2;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--color-rule);
  padding: 24px var(--gutter);
}

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

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

footer .footer-employer {
  max-width: var(--max-w);
  margin: 12px auto 0;
  font-size: 0.75rem;
  color: var(--color-muted);
  font-style: italic;
}

/* ---------- Legal pages ---------- */
.legal-header {
  padding: clamp(60px, 10vw, 100px) var(--gutter) 0;
  max-width: var(--max-w);
  margin: 0 auto;
}

.legal-body {
  padding: 2.5em var(--gutter) clamp(80px, 12vw, 120px);
  max-width: var(--max-w);
  margin: 0 auto;
}

.legal-body h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin: 2em 0 0.5em;
}

.legal-body h2:first-child { margin-top: 0; }

.legal-body p {
  font-size: 0.88rem;
  color: var(--color-muted);
  line-height: 1.7;
}

.legal-body a { text-decoration: underline; text-underline-offset: 3px; }

.back-link {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.4em;
}

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