/* ==========================================================================
   LaurinBuilds Design-System
   Brand-Farben, Typography, Layout, Terminal-Aesthetic, Buttons, Utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   a) @font-face Deklarationen — Self-hosted Fonts (DSGVO-konform)
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/jetbrains-mono-variable.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   b) CSS Custom Properties
   -------------------------------------------------------------------------- */

:root {
  /* Brand-Farben */
  --color-bg: #f9f4ee;
  --color-accent: #c8b4d7;
  --color-terminal: #0b0c0d;
  --color-cta: #f85e34;
  --color-text: #1a1a1a;
  --color-text-light: #f9f4ee;
  --color-cta-hover: #e04d28;

  /* Typografie */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Fluid Font Sizes */
  --fs-hero: clamp(2.5rem, 5vw, 4.5rem);
  --fs-h1: clamp(2rem, 4vw, 3.5rem);
  --fs-h2: clamp(1.5rem, 3vw, 2.5rem);
  --fs-h3: clamp(1.25rem, 2vw, 1.75rem);
  --fs-body: clamp(1rem, 1.5vw, 1.125rem);
  --fs-small: 0.875rem;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Layout */
  --max-width: 1280px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
}

/* --------------------------------------------------------------------------
   c) Reset + Base Styles
   -------------------------------------------------------------------------- */

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-cta);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   d) Typography-Klassen
   -------------------------------------------------------------------------- */

.text-hero {
  font-size: var(--fs-hero);
  font-weight: 800;
  line-height: 1.1;
}

.text-h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.15;
}

.text-h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.2;
}

.text-h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
}

.text-body {
  font-size: var(--fs-body);
  font-weight: 400;
}

.text-small {
  font-size: var(--fs-small);
}

.text-accent {
  color: var(--color-accent);
}

.text-cta {
  color: var(--color-cta);
}

/* --------------------------------------------------------------------------
   e) Layout-System
   -------------------------------------------------------------------------- */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }
}

.section {
  padding: var(--space-lg) 0;
}

.section--dark {
  background-color: var(--color-terminal);
  color: var(--color-text-light);
}

.section--accent {
  background-color: var(--color-accent);
  color: var(--color-terminal);
}

.grid {
  display: grid;
  gap: var(--space-md);
}

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

@media (min-width: 768px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

@media (min-width: 768px) {
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   f) Terminal/Code-Aesthetic Komponenten
   -------------------------------------------------------------------------- */

.terminal-block {
  background-color: var(--color-terminal);
  color: #e0e0e0;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  position: relative;
  overflow-x: auto;
  line-height: 1.7;
}

.terminal-block::before {
  content: "$ ";
  color: var(--color-cta);
  font-weight: bold;
}

/* Fake Fenster-Leiste mit drei Punkten */
.terminal-header {
  background-color: #1e1e1e;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.terminal-header::before {
  content: "";
  display: inline-flex;
  gap: 6px;
  /* Drei Punkte via Box-Shadow */
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ff5f57;
  box-shadow: 18px 0 0 #febc2e, 36px 0 0 #28c840;
}

/* Terminal-Block nach Header: obere Ecken eckig */
.terminal-header + .terminal-block {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.code-inline {
  font-family: var(--font-mono);
  background-color: rgba(200, 180, 215, 0.15);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background-color: var(--color-cta);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   g) Button-Styles
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--fs-body);
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn--cta {
  background-color: var(--color-cta);
  color: white;
}

.btn--cta:hover {
  background-color: var(--color-cta-hover);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn--outline {
  background-color: transparent;
  border: 2px solid var(--color-cta);
  color: var(--color-cta);
}

.btn--outline:hover {
  background-color: var(--color-cta);
  color: white;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   h) Utility-Klassen
   -------------------------------------------------------------------------- */

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Accessibility: Visuell versteckt, aber fuer Screenreader sichtbar */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Spacing Utilities */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
