/* ============================================
   MORPHA.CH — Global Styles
   Variablen, Reset, Typografie, Nav, Footer,
   gemeinsame Utilities
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400;0,500;0,600;1,400&family=Instrument+Serif:ital@0;1&display=swap');


/* ============================================
   CUSTOM PROPERTIES
   ============================================ */

:root {
  /* --- Farben --- */
  --bg-primary:    #F6F4F0;
  --bg-secondary:  #EDEAE4;
  --bg-elevated:   #FFFFFF;

  --text-primary:   #1A1A1A;
  --text-secondary: #6B6560;
  --text-tertiary:  #A39E97;

  --accent:         #2A2A2A;
  --accent-subtle:  #D4CFC8;
  --color-accent:   #8B6D4F;

  /* --- Typografie --- */
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans:  'Instrument Sans', system-ui, -apple-system, sans-serif;

  /* --- Typografische Skala --- */
  --text-hero:    clamp(3rem, 8vw, 8rem);
  --text-section: clamp(2rem, 5vw, 4.5rem);
  --text-sub:     clamp(1.2rem, 2vw, 1.8rem);
  --text-body:    1.125rem;
  --text-label:   0.8125rem;

  /* --- Abstände --- */
  --section-y:    clamp(100px, 14vw, 200px);
  --section-y-sm: clamp(60px, 8vw, 120px);
  --container-x:  clamp(24px, 8vw, 120px);
  --container-max: 1440px;
  --nav-height:   72px;
}


/* ============================================
   RESET
   ============================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

ul, ol {
  list-style: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}


/* ============================================
   TYPOGRAFIE-UTILITIES
   ============================================ */

.t-hero {
  font-family: var(--font-sans);
  font-size: var(--text-hero);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.t-section {
  font-family: var(--font-sans);
  font-size: var(--text-section);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.t-sub {
  font-size: var(--text-sub);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.t-body {
  font-size: var(--text-body);
  line-height: 1.65;
  max-width: 42em;
  color: var(--text-secondary);
}

.t-label {
  font-family: var(--font-sans);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* Serif Italic — Schriftwechsel innerhalb von Headlines */
em.serif,
.serif-em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}


/* ============================================
   LAYOUT-PRIMITIVES
   ============================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-x);
  padding-right: var(--container-x);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

/* Feine 1px Linie — Section-Trenner, Listen-Separation */
.line {
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--accent-subtle);
  transform-origin: left;
}

/* Hintergrund-Nummern */
.bg-num {
  font-family: var(--font-serif);
  font-size: 20vw;
  font-weight: 400;
  color: var(--text-primary);
  opacity: 0.08;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}


/* ============================================
   NAVIGATION
   ============================================ */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 var(--container-x);
  transition: background-color 0.5s ease, backdrop-filter 0.5s ease;
}

.site-nav.scrolled {
  background-color: rgba(246, 244, 240, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-link {
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--text-primary);
  transition: width 0.3s ease;
}

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

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

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

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  padding: 4px 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 1px;
  background-color: var(--text-primary);
  transition: transform 0.35s ease, opacity 0.35s ease, width 0.35s ease;
}

.nav-toggle span:nth-child(2) {
  width: 16px;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
  width: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Nav */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background-color: var(--bg-primary);
  padding: 2.5rem var(--container-x) 3.5rem;
  flex-direction: column;
  gap: 1.75rem;
  z-index: 99;
  border-top: 1px solid var(--accent-subtle);
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  pointer-events: none;
}

.nav-mobile.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.nav-mobile a {
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

.nav-mobile a:hover {
  color: var(--text-primary);
}


/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  padding: 2.5rem var(--container-x);
  border-top: 1px solid var(--accent-subtle);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-primary);
}

.footer-meta {
  font-size: var(--text-label);
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}


/* ============================================
   SCROLL-MARGIN — Anker unter Fixed-Nav
   ============================================ */

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


/* ============================================
   FOKUS — Keyboard-Navigation
   ============================================ */

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

:focus:not(:focus-visible) {
  outline: none;
}


/* ============================================
   CTA / KONTAKT — Shared Component
   Erscheint auf allen Seiten als letzter
   Abschnitt vor dem Footer
   ============================================ */

.cta {
  background-color: var(--bg-primary);
  padding-top: clamp(120px, 16vw, 240px);
  padding-bottom: clamp(120px, 16vw, 240px);
}

.cta-headline {
  max-width: 16ch;
  color: var(--text-primary);
}

.cta-headline .serif-em {
  color: var(--color-accent);
}

.cta-sub {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  max-width: 40ch;
}

.cta-email {
  display: inline-block;
  margin-top: clamp(2rem, 4vw, 3.5rem);
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 3.5vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  position: relative;
  transition: letter-spacing 0.4s ease;
}

.cta-email::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--text-primary);
  transition: width 0.4s ease;
}

.cta-email:hover {
  letter-spacing: 0.01em;
}

.cta-email:hover::after {
  width: 100%;
}


/* ============================================
   ANIMATION — BASIS-ZUSTÄNDE
   (werden von GSAP / JS ausgelöst)
   ============================================ */

.reveal-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
  will-change: opacity, transform;
}

.reveal-block {
  opacity: 0;
  transform: translateY(15px);
  will-change: opacity, transform;
}

.reveal-line {
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}


/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal-word,
  .reveal-block {
    opacity: 1;
    transform: none;
  }

  .reveal-line {
    transform: scaleX(1);
  }

  html {
    scroll-behavior: auto;
  }
}


/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
    /* Grössere Touch-Fläche */
    padding: 8px;
    margin-right: -8px;
  }

  .nav-mobile {
    display: flex;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.625rem;
    align-items: flex-start;
  }
}

/* Verhindert horizontales Scrollen — auf html UND body */
html {
  overflow-x: hidden;
}
