/* ============================================================
   Heinrich Wagner · Malerei
   main.css — Tokens, Basis, Hero, Navigation, Über, Kontakt
   ============================================================ */

@font-face {
  font-family: 'FogtwoNo5';
  src: url('../assets/fonts/FogtwoNo5.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Farben */
  --color-bg:             #F7F4ED;
  --color-surface:        #FDFBF6;
  --color-text:           #1E1B16;
  --color-text-secondary: #857C6F;
  --color-accent:         #0E4D3A;
  --color-divider:        rgba(30, 27, 22, 0.10);
  --color-skeleton:       #ECE7DC;
  --color-dark:           #14110D;
  --color-on-dark:        #EFEAE0;
  --color-on-dark-soft:   rgba(239, 234, 224, 0.55);
  --color-lightbox-bg:    rgba(20, 17, 13, 0.97);
  --color-surface-veil:   rgba(253, 251, 246, 0.82);
  --color-on-accent:      #FAF8F1;
  --color-on-accent-soft: rgba(250, 248, 241, 0.62);

  /* Schrift */
  --font-deco:    'FogtwoNo5', 'EB Garamond', Georgia, serif;
  --font-display: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-ui:      'Space Grotesk', system-ui, -apple-system, sans-serif;

  --tracking-wide:  0.08em;
  --tracking-label: 0.12em;
  --tracking-hero:  0.3em;

  /* Motion */
  --ease-out-slow: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t-fast: 300ms;
  --t-mid:  500ms;
  --t-slow: 800ms;

  /* Raum */
  --space-section: clamp(6rem, 14vw, 11rem);
  --space-gutter:  clamp(1.25rem, 5vw, 4rem);
  --content-max:   1280px;

  /* Cursor */
  --cursor-dot-size:  12px;
  --cursor-ring-size: 36px;
}

/* ---------- Scrollbar ---------- */

html {
  scrollbar-color: var(--color-accent) var(--color-bg);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 0;
}

/* ---------- Reset & Basis ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
}

h2 {
  font-family: var(--font-deco);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  letter-spacing: 0.02em;
}

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

ul {
  list-style: none;
}

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

::selection {
  background: var(--color-accent);
  color: var(--color-on-dark);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* Skip-Link */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.6em 1.2em;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  font-size: 0.75rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  transform: translateY(-300%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* Sichtbarkeits-Reveal (IntersectionObserver, scroll.js) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--t-slow) var(--ease-out-slow),
    transform var(--t-slow) var(--ease-out-slow);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Bild-Skeleton (Creme-Fläche, blendet nach dem Laden aus) */
.img-skeleton {
  position: absolute;
  inset: 0;
  background: var(--color-skeleton);
  transition: opacity var(--t-slow) var(--ease-out-slow);
}

.is-loaded > .img-skeleton {
  opacity: 0;
}

/* ---------- Custom Cursor ---------- */

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}

.cursor-dot {
  width: var(--cursor-dot-size);
  height: var(--cursor-dot-size);
  background: var(--color-accent);
  transform: translate(-50%, -50%);
  will-change: transform;
}

.cursor-ring {
  width: var(--cursor-ring-size);
  height: var(--cursor-ring-size);
  border: 1px solid var(--color-accent);
  transform: translate(-50%, -50%);
  will-change: transform;
  transition: width var(--t-fast) var(--ease-out-slow),
              height var(--t-fast) var(--ease-out-slow),
              opacity var(--t-fast) var(--ease-out-slow);
}

body.has-custom-cursor {
  cursor: none;
}

body.has-custom-cursor a,
body.has-custom-cursor button {
  cursor: none;
}

body.has-custom-cursor .cursor-dot { opacity: 0.5; }
body.has-custom-cursor .cursor-ring { opacity: 0.6; }

body.cursor-hidden .cursor-dot,
body.cursor-hidden .cursor-ring { opacity: 0; }

body.cursor-active .cursor-ring {
  width: calc(var(--cursor-ring-size) * 1.6);
  height: calc(var(--cursor-ring-size) * 1.6);
}

/* ---------- Navigation ---------- */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 210;
  background: var(--color-surface-veil);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
  opacity: 0;
  transform: translateY(-100%);
  transition:
    opacity var(--t-mid) var(--ease-out-slow),
    transform var(--t-mid) var(--ease-out-slow);
  pointer-events: none;
}

.site-nav.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.site-nav nav {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.1rem var(--space-gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

/* Galerie-Tabs (rechts im Nav) */
.works-tabs {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: clamp(0.75rem, 2.5vw, 2rem);
}

/* ---- Burger (Mobile) ---- */
.nav-burger {
  grid-column: 3;
  justify-self: end;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  z-index: 210;
}

.nav-burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--color-text);
  transform-origin: center;
  transition:
    transform 0.35s var(--ease-out-slow),
    opacity   0.25s var(--ease-out-slow);
}

.nav-burger.is-open span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}
.nav-burger.is-open span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* ---- Vollbild-Overlay ---- */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out-slow);
}

.nav-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.nav-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.nav-overlay .works-tab {
  font-family: var(--font-deco);
  font-style: italic;
  font-size: clamp(2.2rem, 9vw, 3.5rem);
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--color-text-secondary);
  padding: 0;
  transition: color 0.3s var(--ease-out-slow);
}

.nav-overlay .works-tab.is-active {
  color: var(--color-text);
}

.nav-overlay .works-tab:hover {
  color: var(--color-accent);
}

.nav-overlay .works-tab::after {
  display: none;
}

.nav-overlay-close {
  position: absolute;
  top: 1.25rem;
  right: var(--space-gutter);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: color var(--t-fast) var(--ease-out-slow);
}

.nav-overlay-close:hover {
  color: var(--color-text);
}

.nav-overlay-close svg {
  width: 22px;
  height: 22px;
}

/* ---- Mobile: Tabs verstecken, Burger zeigen ---- */
@media (max-width: 768px) {
  .works-tabs { display: none; }
  .nav-burger  { display: flex; }
}

.works-tab {
  position: relative;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  padding-bottom: 0.3em;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease-out-slow);
}

.works-tab::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-fast) var(--ease-out-slow);
}

.works-tab.is-active {
  color: var(--color-accent);
}

.works-tab.is-active::after {
  transform: scaleX(1);
}

.works-tab:hover:not(.is-active) {
  color: var(--color-text);
}

.nav-brand {
  grid-column: 2;
  justify-self: center;
  position: relative;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  padding-bottom: 0.3em;
}

.nav-logo {
  display: block;
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.nav-links a,
.draw-link {
  position: relative;
  font-size: 0.75rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  padding-bottom: 0.3em;
}

/* Unterstreichung zeichnet sich von links */
.nav-links a::after,
.draw-link::after,
.nav-brand::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-fast) var(--ease-out-slow);
}

/* Nav-Brand: Linie zeichnet sich von der Mitte nach außen */
.nav-brand::after {
  transform-origin: center;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.draw-link:hover::after,
.draw-link:focus-visible::after,
.nav-brand:hover::after {
  transform: scaleX(1);
}

/* ---------- Hero: Smaragdfläche mit Rahmung ----------
   Von außen nach innen: feine grüne Linie, kräftiger weißer
   Rand, dann die einfärbige Akzentfläche mit weißer Schrift. */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  padding: clamp(10px, 1.6vw, 18px);              /* weißer Rand innen */
  background: var(--color-surface);
  display: flex;
}

.hero-panel {
  position: relative;
  flex: 1;
  background: var(--color-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--space-gutter);
}

.hero-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6em;
  color: var(--color-on-accent);
  opacity: 0;
  animation: hero-fade 1.6s var(--ease-out-slow) 1.2s forwards;
}

.hero-name-prefix {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  letter-spacing: var(--tracking-hero);
  padding-inline-start: var(--tracking-hero); /* gleicht das Tracking des letzten Zeichens optisch aus */
  text-transform: uppercase;
  color: var(--color-on-accent-soft);
}

.hero-name-main {
  font-family: var(--font-deco);
  font-size: clamp(2rem, 5.2vw, 4.75rem);
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.hero-rule {
  display: block;
  width: 80px;
  height: 1px;
  background: var(--color-on-accent);
  margin: 2rem 0 1.75rem;
  transform: scaleX(0);
  animation: hero-rule 1.2s var(--ease-out-slow) 1.7s forwards;
}

.hero-tagline {
  color: var(--color-on-accent-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  opacity: 0;
  animation: hero-fade 1.6s var(--ease-out-slow) 2s forwards;
}

@keyframes hero-fade {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes hero-rule {
  to { transform: scaleX(1); }
}

/* Scroll-Indikator: pulsierende vertikale Linie */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  height: 56px;
  width: 1px;
  overflow: hidden;
  opacity: 0;
  animation: hero-fade 1.6s var(--ease-out-slow) 2.6s forwards;
}

.scroll-line {
  display: block;
  width: 1px;
  height: 100%;
  background: var(--color-on-accent-soft);
  animation: scroll-pulse 2.4s var(--ease-out-slow) infinite;
}

@keyframes scroll-pulse {
  0%   { transform: translateY(-100%); }
  55%  { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* ---------- Sektionen, gemeinsam ---------- */

main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-gutter);
}

.section-head {
  padding-top: var(--space-section);
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.section-head h2::after {
  content: '';
  display: block;
  width: 56px;
  height: 1px;
  background: var(--color-accent);
  margin-top: 1.25rem;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s var(--ease-out-slow) 200ms;
}

.section-head.is-visible h2::after {
  transform: scaleX(1);
}

.section-note {
  margin-top: 1.5rem;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* ---------- Über ---------- */

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

.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) auto minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.about-portrait {
  position: relative;
}

.about-portrait img {
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-out-slow);
}

.about-portrait.is-loaded img {
  opacity: 1;
}

/* vertikale Smaragd-Linie, rein dekorativ, 40% Höhe */
.about-line {
  width: 1px;
  height: 40%;
  min-height: 140px;
  background: var(--color-accent);
  opacity: 0.45;
  align-self: center;
}

.about-text h2 {
  margin-bottom: 2.25rem;
}

.about-text h2::after {
  content: '';
  display: block;
  width: 56px;
  height: 1px;
  background: var(--color-accent);
  margin-top: 1.25rem;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s var(--ease-out-slow) 300ms;
}

.about-text.is-visible h2::after {
  transform: scaleX(1);
}

.about-text p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.9;
  max-width: 34em;
}

.about-text p + p {
  margin-top: 1.6em;
}

/* ---------- Kontakt ---------- */

.contact {
  padding: var(--space-section) 0;
  text-align: center;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.contact-email-title {
  font-family: var(--font-deco);
  font-size: clamp(1.6rem, 4vw, 3rem);
  letter-spacing: 0.03em;
  color: var(--color-text);
  position: relative;
  padding-bottom: 0.2em;
}

.contact-email-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-fast) var(--ease-out-slow);
}

.contact-email-title:hover::after,
.contact-email-title:focus-visible::after {
  transform: scaleX(1);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--color-divider);
  padding: 2.5rem var(--space-gutter);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.7rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

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

@media (max-width: 768px) {
  .about-inner {
    grid-template-columns: 1fr;
  }

  .about-line {
    width: 40%;
    min-height: 0;
    height: 1px;
    justify-self: center;
  }

  .about-text p {
    font-size: 1.2rem;
  }

}

/* ---------- Reduced Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal,
  .hero-name,
  .hero-tagline,
  .scroll-hint {
    opacity: 1;
    transform: none;
  }

  .hero-rule {
    transform: scaleX(1);
  }

  .about-portrait img {
    opacity: 1;
  }
}
