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

/* Theme */
:root {
  --bg: #efefef;
  --text: #121212;
  --text-muted: rgba(18, 18, 18, 0.4);
  --border: #121212;
  --border-rule: rgba(18, 18, 18, 0.6);
  --border-muted: rgba(18, 18, 18, 0.2);
  --img-placeholder: rgba(18, 18, 18, 0.08);
}

[data-theme="dark"] {
  --bg: #121212;
  --text: #efefef;
  --text-muted: rgba(239, 239, 239, 0.4);
  --border: #efefef;
  --border-rule: rgba(239, 239, 239, 0.6);
  --border-muted: rgba(239, 239, 239, 0.2);
  --img-placeholder: rgba(239, 239, 239, 0.08);
}

/* Fonts */
@font-face {
  font-family: 'Söhne';
  src: url('public/fonts/Söhne-Buch.otf') format('opentype'),
       url('public/fonts/Söhne-Buch.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Söhne';
  src: url('public/fonts/Söhne-Kräftig.otf') format('opentype'),
       url('public/fonts/Söhne-Kräftig.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Base */
body {
  font-family: 'Söhne', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s, color 0.3s;
}

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

a:hover {
  text-decoration: underline;
}

p {
  text-wrap: pretty;
}

.intro p,
.how-text p,
.contact p {
  text-wrap: balance;
}

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

/* Layout */
.page {
  display: flex;
  flex-direction: column;
  gap: 120px;
  padding: 0 40px;
}

/* Header */
.header {
  padding-top: 40px;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.header.visible {
  opacity: 1;
}

/* Theme toggle */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  padding: 0;
}

/* Hero */
.hero-headline {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 720px;
}

/* Section title pattern */
.section-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  border-top: 2px solid var(--border-rule);
  padding-top: 8px;
  margin-bottom: 40px;
}

/* Text column width — 50% at 1280, capped at 640px, scales up toward 100% at mobile */
.half-width {
  width: 50%;
  max-width: 640px;
}

.half-width p + p {
  margin-top: 16px;
}

/* Projects */
.projects {
  display: flex;
  flex-direction: column;
  gap: 160px;
}

.project-label {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  border-top: 2px solid var(--border-rule);
  padding-top: 8px;
  margin-bottom: 40px;
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 40px;
  background: var(--img-placeholder);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.project-image.loaded {
  opacity: 1;
}

.project-description {
  width: 50%;
  max-width: 640px;
  margin-bottom: 24px;
}

.project-outcome {
  border-top: 1px solid var(--border-muted);
  padding: 8px 0;
  opacity: 0.6;
}

/* Capabilities */
.capabilities-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.capability {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
}

.capability:nth-child(even) {
  padding-left: 40px;
}

.capability:nth-child(n+3) {
  margin-top: 40px;
}

.capability-title {
  font-weight: 700;
  border-top: 1px solid var(--border-rule);
  padding-top: 8px;
  margin-bottom: 16px;
}

.capability-description {
  margin-bottom: 24px;
}

.capability-item {
  opacity: 0.6;
  border-top: 1px solid var(--border-muted);
  padding: 8px 0;
}

/* Clients */
.clients-text {
  width: 50%;
  max-width: 640px;
  margin-bottom: 80px;
}

.ticker-wrap {
  overflow: hidden;
  width: 100%;
}

.ticker-track {
  display: flex;
  gap: 90px;
  animation: ticker 15s linear infinite;
}

.ticker-track img {
  width: 128px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Logo theme switching */
.logo-dark {
  display: none;
}

[data-theme="dark"] .logo-light {
  display: none;
}

[data-theme="dark"] .logo-dark {
  display: block;
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(var(--ticker-offset, -50%));
  }
}

/* How we work */
.how-text {
  width: 50%;
  max-width: 640px;
}

.how-text p + p {
  margin-top: 16px;
}

/* Contact */
.contact p {
  margin-bottom: 16px;
}

.contact a {
  text-decoration: underline;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 40px;
  border-top: 1px solid var(--border-muted);
  padding-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

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

.footer-left {
  display: flex;
  gap: 24px;
}

.footer-social {
  display: flex;
  gap: 16px;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Sequenced intro fade-in (after H1 type-in) */
.intro {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.intro.visible {
  opacity: 1;
  transform: translateY(0);
}

/* H1 type-in */
.hero-headline .char {
  opacity: 0;
  display: inline-block;
}

.hero-headline .char.typed {
  opacity: 1;
}

.hero-headline br {
  display: inline;
}

/* Responsive — graduated text column widths */
@media (max-width: 1280px) {
  .half-width,
  .project-description,
  .clients-text,
  .how-text {
    width: 55%;
  }
}

@media (max-width: 1024px) {
  .half-width,
  .project-description,
  .clients-text,
  .how-text {
    width: 70%;
  }

  .capabilities-grid {
    grid-template-columns: 1fr;
  }

  .capability,
  .capability:nth-child(even) {
    display: block;
    margin-top: 40px;
    padding-left: 0;
  }

  .capability:first-child {
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 0 16px;
    gap: 80px;
  }

  .header {
    padding-top: 20px;
  }

  .hero-headline {
    font-size: 32px;
  }

  .section-title,
  .project-label {
    font-size: 16px;
  }

  .half-width,
  .project-description,
  .clients-text,
  .how-text {
    width: 100%;
    max-width: none;
  }

  .projects {
    gap: 40px;
  }

  .ticker-track {
    gap: 40px;
  }

  .ticker-track img {
    width: 80px;
    height: 50px;
  }

  .footer {
    flex-direction: column;
    gap: 16px;
  }

  .footer-left {
    flex-direction: column;
    gap: 8px;
  }
}

