/* ════════════════════════════════════════════════════════════════
   LOGIKATO · style.css
   Foundation: Fonts · Tokens · Reset · Typografie · Layout
                Buttons · Utilities · A11y · Body-States
   ════════════════════════════════════════════════════════════════ */


/* ────────────────────────────────────────────────────────────────
   1 · FONTS — Self-hosted Variable Fonts
   
   Download:
     · Clash Display    → fontshare.com/fonts/clash-display
     · General Sans     → fontshare.com/fonts/general-sans
     · Geist Mono       → vercel.com/font  (oder github.com/vercel/geist-font)
   
   Datei-Layout:
     /fonts/clash-display/ClashDisplay-Variable.woff2
     /fonts/general-sans/GeneralSans-Variable.woff2
     /fonts/geist-mono/GeistMono-Variable.woff2
──────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Clash Display";
  src: url("/fonts/clash-display/ClashDisplay-Variable.woff2") format("woff2-variations");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "General Sans";
  src: url("/fonts/general-sans/GeneralSans-Variable.woff2") format("woff2-variations");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono/GeistMono-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}


/* ────────────────────────────────────────────────────────────────
   2 · DESIGN TOKENS — Single Source of Truth
──────────────────────────────────────────────────────────────── */

:root {

  /* —— Ink-Schichten ──────────────────────────────────────── */
  --ink:              #060812;
  --ink-raised:       #0C111E;
  --ink-panel:        #131A2A;
  --haze:             rgba(255, 255, 255, 0.04);
  --haze-strong:      rgba(255, 255, 255, 0.08);
  --hairline:         rgba(232, 230, 240, 0.10);
  --hairline-strong:  rgba(232, 230, 240, 0.20);

  /* —— Text ──────────────────────────────────────────────── */
  --bone:             #E8E6F0;
  --bone-dim:         #8B8AA0;
  --bone-mute:        #5A5A6E;

  /* —— Akzente ───────────────────────────────────────────── */
  --primary:          #B8A4FF;
  --primary-bright:   #C9B8FF;
  --primary-glow:     rgba(184, 164, 255, 0.35);
  --primary-faint:    rgba(184, 164, 255, 0.08);

  --alert:            #FF5C4D;
  --alert-glow:       rgba(255, 92, 77, 0.30);

  /* —— Font-Stacks ───────────────────────────────────────── */
  --font-display:     "Clash Display", "Inter", system-ui, sans-serif;
  --font-body:        "General Sans", "Inter", system-ui, sans-serif;
  --font-mono:        "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  /* —— Fluid Type-Scale  clamp(min, vw+rem, max) ─────────── */
  --fs-display:       clamp(3.25rem, 7vw + 1rem, 8rem);     /* Hero-Headline   */
  --fs-h1:            clamp(2.5rem,  4.5vw + 0.5rem, 5rem);
  --fs-h2:            clamp(1.75rem, 2.8vw + 0.5rem, 2.75rem);
  --fs-h3:            clamp(1.25rem, 1.4vw + 0.5rem, 1.625rem);
  --fs-lg:            clamp(1.125rem, 0.5vw + 1rem, 1.375rem);
  --fs-body:          1rem;
  --fs-sm:            0.875rem;
  --fs-mono:          0.75rem;
  --fs-mono-xs:       0.6875rem;

  /* —— Line-Heights ──────────────────────────────────────── */
  --lh-display:       0.95;
  --lh-heading:       1.05;
  --lh-body:          1.55;
  --lh-mono:          1.4;

  /* —— Letter-Spacing ────────────────────────────────────── */
  --ls-display:       -0.02em;
  --ls-heading:       -0.01em;
  --ls-body:          0;
  --ls-mono:          0.08em;
  --ls-mono-wide:     0.18em;

  /* —— Spacing — 4px-Basis ───────────────────────────────── */
  --sp-1:             0.25rem;
  --sp-2:             0.5rem;
  --sp-3:             0.75rem;
  --sp-4:             1rem;
  --sp-5:             1.5rem;
  --sp-6:             2rem;
  --sp-7:             3rem;
  --sp-8:             4rem;
  --sp-9:             6rem;
  --sp-10:            8rem;
  --sp-11:            12rem;

  /* —— Layout ────────────────────────────────────────────── */
  --container-max:    1440px;
  --container-pad:    clamp(1.25rem, 4vw, 3rem);
  --section-pad:      clamp(5rem, 10vw, 10rem);

  /* —— Easings — custom curves, niemals ease-in-out ──────── */
  --ease-out-expo:    cubic-bezier(0.16, 1, 0.3, 1);          /* heavy out      */
  --ease-out-quint:   cubic-bezier(0.22, 1, 0.36, 1);         /* smooth exit    */
  --ease-in-quint:    cubic-bezier(0.64, 0, 0.78, 0);         /* heavy entry    */
  --ease-mecha:       cubic-bezier(0.65, 0, 0.35, 1);         /* premium snap   */
  --ease-hud:         cubic-bezier(0.83, 0, 0.17, 1);         /* sharp lock-in  */
  --ease-drift:       cubic-bezier(0.45, 0.05, 0.55, 0.95);   /* slow drift     */

  /* —— Durations ─────────────────────────────────────────── */
  --dur-fast:         180ms;
  --dur-base:         320ms;
  --dur-slow:         560ms;
  --dur-cinema:       1200ms;

  /* —— Radii — Mecha = scharf. Max 2px für HUD-Pills ─────── */
  --r-sharp:          0;
  --r-pill:           2px;

  /* —— Z-Index-Skala ─────────────────────────────────────── */
  --z-base:           1;
  --z-hud:            20;
  --z-nav:            40;
  --z-overlay:        80;
  --z-preloader:      100;
}


/* ────────────────────────────────────────────────────────────────
   3 · RESET — modern, opinionated
──────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto;                /* Lenis übernimmt das Scrolling */
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--bone);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

img, picture {
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
  user-select: none;
}

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

ul, ol {
  list-style: none;
}

::selection {
  background: var(--primary);
  color: var(--ink);
}


/* ────────────────────────────────────────────────────────────────
   4 · TYPOGRAFIE
──────────────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--bone);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
}

h2 { font-size: var(--fs-h1); }
h3 { font-size: var(--fs-h2); }
h4 { font-size: var(--fs-h3); }

p {
  text-wrap: pretty;
  max-width: 60ch;
}

strong, b {
  font-weight: 600;
  color: var(--bone);
}

/* —— Display-Utility — übergrosse Statements ─────────────── */
.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
}

/* —— Mono — HUD-Systemtext ───────────────────────────────── */
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 400;
  line-height: var(--lh-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
}

.mono--xs {
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--ls-mono-wide);
}

/* —— Eyebrow — Label oberhalb von Headlines ──────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  font-weight: 500;
  letter-spacing: var(--ls-mono-wide);
  text-transform: uppercase;
  color: var(--primary);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--primary);
  opacity: 0.6;
}

/* —— Lead — größerer Bodytext für Hero-Sublines ──────────── */
.lead {
  font-size: var(--fs-lg);
  line-height: 1.5;
  color: var(--bone-dim);
  max-width: 48ch;
}


/* ────────────────────────────────────────────────────────────────
   5 · LAYOUT-PRIMITIVES
──────────────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  position: relative;
  padding-block: var(--section-pad);
}

.section--first {
  padding-top: 0;                       /* Hero — Pad kommt aus dem Hero selbst */
}

/* —— Stack — vertikaler Rhythmus ─────────────────────────── */
.stack > * + * {
  margin-top: var(--stack-gap, var(--sp-4));
}

.stack--sm > * + * { margin-top: var(--sp-2); }
.stack--lg > * + * { margin-top: var(--sp-6); }
.stack--xl > * + * { margin-top: var(--sp-8); }

/* —— Grid — 12 Spalten ───────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--container-pad);
}

.col-span-6  { grid-column: span 6; }
.col-span-8  { grid-column: span 8; }
.col-span-12 { grid-column: span 12; }


/* ────────────────────────────────────────────────────────────────
   6 · BUTTONS
   
   Sharp Mecha-Style. Auf Hover:
   · Eck-Brackets erscheinen und schnappen ein
   · Scan-Linie fährt unter dem Label durch
   
   HTML-Struktur:
   <button class="btn btn--primary">
     <span class="btn__label">Projekte ansehen</span>
     <span class="btn__arrow" aria-hidden="true">→</span>
     <span class="btn__scan" aria-hidden="true"></span>
   </button>
──────────────────────────────────────────────────────────────── */

.btn {
  --btn-pad-y: 1rem;
  --btn-pad-x: 1.75rem;

  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--btn-pad-y) var(--btn-pad-x);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: var(--ls-mono-wide);
  text-transform: uppercase;
  color: var(--bone);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sharp);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition:
    color           var(--dur-base) var(--ease-mecha),
    background-color var(--dur-base) var(--ease-mecha),
    border-color    var(--dur-base) var(--ease-mecha),
    box-shadow      var(--dur-base) var(--ease-mecha);
}

/* —— Label und Arrow über der Scan-Linie ─────────────────── */
.btn__label,
.btn__arrow {
  position: relative;
  z-index: 2;
}

.btn__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  transition: transform var(--dur-base) var(--ease-mecha);
}

.btn:hover .btn__arrow,
.btn:focus-visible .btn__arrow {
  transform: translateX(4px);
}

/* —— Eck-Brackets — schnappen auf Hover ein ──────────────── */
.btn::before,
.btn::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid var(--primary);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity   var(--dur-base) var(--ease-mecha),
    transform var(--dur-base) var(--ease-mecha);
}

.btn::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
  transform: translate(4px, 4px);
}

.btn::after {
  right: -1px;
  bottom: -1px;
  border-left: none;
  border-top: none;
  transform: translate(-4px, -4px);
}

.btn:hover::before,
.btn:hover::after,
.btn:focus-visible::before,
.btn:focus-visible::after {
  opacity: 1;
  transform: translate(0, 0);
}

/* —— Scan-Linie — fährt unter dem Label durch ────────────── */
.btn__scan {
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--primary);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 1;
  transition: transform var(--dur-slow) var(--ease-out-expo);
}

.btn:hover .btn__scan,
.btn:focus-visible .btn__scan {
  transform: scaleX(1);
}

/* —— Primary — gefüllt, Glow auf Hover ───────────────────── */
.btn--primary {
  color: var(--ink);
  background: var(--primary);
  border-color: var(--primary);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--primary-bright);
  border-color: var(--primary-bright);
  box-shadow:
    0 0 0  1px var(--primary-bright),
    0 0 24px   var(--primary-glow),
    0 0 64px   var(--primary-faint);
}

.btn--primary::before,
.btn--primary::after {
  border-color: var(--ink);
}

.btn--primary .btn__scan {
  background: var(--ink);
}

/* —— Ghost — Outline, Fill auf Hover ─────────────────────── */
.btn--ghost {
  color: var(--bone);
  background: transparent;
  border-color: var(--hairline-strong);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-faint);
}


/* ────────────────────────────────────────────────────────────────
   7 · UTILITIES
──────────────────────────────────────────────────────────────── */

/* —— SR-only — versteckt visuell, lesbar für Screenreader ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

/* —— Hairline — 1px-Linie, der HUD-Baustein ──────────────── */
.hairline {
  background: var(--hairline);
}

/* —— Glow-Text — Primary mit weichem Halo ────────────────── */
.glow-primary {
  color: var(--primary);
  text-shadow: 0 0 24px var(--primary-glow);
}

/* —— Für SplitType-Elemente — Initial-State ──────────────── */
.split-init .char,
.split-init .word,
.split-init .line {
  display: inline-block;
  will-change: transform, opacity;
}


/* ────────────────────────────────────────────────────────────────
   8 · SCROLLBAR — dezent, in Haze-Tönen
──────────────────────────────────────────────────────────────── */

html {
  scrollbar-width: thin;
  scrollbar-color: var(--haze-strong) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--haze-strong);
  border-radius: var(--r-sharp);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-faint);
}


/* ────────────────────────────────────────────────────────────────
   9 · ACCESSIBILITY
──────────────────────────────────────────────────────────────── */

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

/* —— Focus — sichtbar für Keyboard, nie für Maus ─────────── */
:focus { outline: none; }

:focus-visible {
  outline: 1px solid var(--primary);
  outline-offset: 4px;
}


/* ────────────────────────────────────────────────────────────────
   10 · BODY-STATES — werden vom Preloader gesetzt
──────────────────────────────────────────────────────────────── */

body.is-loading {
  overflow: hidden;
  cursor: progress;
}

body.is-loading > *:not(.preloader) {
  visibility: hidden;
}

body.is-ready {
  /* Trigger für Hero-Reveal-Animationen — wird von main.js abgefragt */
}
