/* ==========================================================================
   main.css – markgerngross.com
   Design-System: Custom Properties → Reset → Base Typography → Utilities
   ========================================================================== */

/* ==========================================================================
   1. CUSTOM PROPERTIES (Design Tokens)
   ========================================================================== */

:root {
  /* Farben */
  --color-black:      #0A0A0B;
  --color-gold:       #C8A84B;
  --color-gold-light: #E8C96A;
  --color-gold-dark:  #8B6914;
  --color-white:      #F5F3EF;
  --color-gray-900:   #1A1A1C;
  --color-gray-700:   #2D2D30;
  --color-gray-500:   #5A5A60;
  --color-gray-300:   #8A8A90;
  --color-gray-100:   #E8E8EC;

  /* Semant. Farben */
  --color-bg:         var(--color-black);
  --color-bg-surface: var(--color-gray-900);
  --color-bg-card:    var(--color-gray-700);
  --color-text:       var(--color-white);
  --color-text-muted: var(--color-gray-300);
  --color-accent:     var(--color-gold);
  --color-accent-hover: var(--color-gold-light);
  --color-border:     rgba(200, 168, 75, 0.2);

  /* Gradienten */
  --gradient-gold:    linear-gradient(135deg, #C8A84B 0%, #E8C96A 50%, #8B6914 100%);
  --gradient-dark:    linear-gradient(180deg, #0A0A0B 0%, #1A1A1C 100%);
  --gradient-hero:    linear-gradient(135deg, #0A0A0B 0%, #1A1A1C 60%, #2D2D30 100%);
  --gradient-glow:    radial-gradient(ellipse at center, rgba(200, 168, 75, 0.15) 0%, transparent 70%);

  /* Typografie */
  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;

  /* Schriftgrößen – Fluid Typografie (clamp: min | preferred | max) */
  --text-xs:   clamp(0.75rem,  1.5vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 1.8vw, 1rem);
  --text-base: clamp(1rem,     2vw,   1.125rem);
  --text-lg:   clamp(1.125rem, 2.2vw, 1.25rem);
  --text-xl:   clamp(1.25rem,  2.5vw, 1.5rem);
  --text-2xl:  clamp(1.5rem,   3vw,   2rem);
  --text-3xl:  clamp(2rem,     4vw,   2.75rem);
  --text-4xl:  clamp(2.5rem,   5vw,   3.5rem);
  --text-5xl:  clamp(3rem,     6vw,   4.5rem);

  /* Zeilenhöhen */
  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  /* Schriftgewichte */
  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold: 600;
  --weight-bold:    700;

  /* Abstände */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --max-width:       1200px;
  --max-width-prose: 72ch;
  --max-width-narrow: 56ch;
  --container-px:    clamp(1rem, 4vw, 2rem);
  --section-py:      clamp(4rem, 8vw, 8rem);

  /* Border Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Schatten */
  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 0 24px rgba(200, 168, 75, 0.25);
  --shadow-gold-strong: 0 0 48px rgba(200, 168, 75, 0.4);

  /* Übergänge */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
  --transition-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index-Ebenen */
  --z-below:   -1;
  --z-base:     0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;
}

/* ==========================================================================
   2. RESET & NORMALISIERUNG
   ========================================================================== */

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  hanging-punctuation: first last;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

table {
  border-collapse: collapse;
}

/* ==========================================================================
   3. BASIS-TYPOGRAFIE
   ========================================================================== */

/* H1: Playfair Display, fluid 3.5rem–6rem, Gold */
h1 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: clamp(3.5rem, 7vw, 6rem);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--color-gold);
}

/* H2: Playfair Display, fluid 2rem–3.5rem, Weiß */
h2 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--color-white);
}

/* H3: DM Sans SemiBold, fluid 1.25rem–1.75rem, Weiß */
h3 {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
  color: var(--color-white);
}

/* H4–H6: DM Sans, fallback sizes */
h4 { font-family: var(--font-body); font-weight: var(--weight-semibold); font-size: var(--text-xl); line-height: var(--leading-snug); color: var(--color-white); }
h5 { font-family: var(--font-body); font-weight: var(--weight-medium);   font-size: var(--text-lg);  line-height: var(--leading-snug); color: var(--color-white); }
h6 { font-family: var(--font-body); font-weight: var(--weight-medium);   font-size: var(--text-base);line-height: var(--leading-normal);color: var(--color-white); }

p {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: var(--leading-normal);
  color: var(--color-gray-300);
}

p + p {
  margin-top: var(--space-4);
}

strong {
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

em {
  font-style: italic;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--color-gray-700);
  color: var(--color-gold-light);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
}

pre {
  background: var(--color-gray-900);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

blockquote {
  border-left: 3px solid var(--color-gold);
  padding-left: var(--space-6);
  margin: var(--space-8) 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--color-text-muted);
}

/* Gold-Text-Gradient Utility */
.text-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================================================
   4. LAYOUT-UTILITIES
   ========================================================================== */

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

.container--narrow {
  max-width: 800px;
}

.container--prose {
  max-width: var(--max-width-prose);
}

.section {
  padding-block: var(--section-py);
}

.section--light {
  background: var(--color-white);
  color: var(--color-black);
}

.section--light p {
  color: var(--color-gray-500);
}

.section--surface {
  background: var(--color-gray-900);
}

/* Grid-System */
.grid {
  display: grid;
  gap: var(--space-8);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

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

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

/* Flex-Utilities */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap   { flex-wrap: wrap; }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* ==========================================================================
   5. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--gradient-gold);
  color: var(--color-black);
  border-color: transparent;
}

.btn--primary:hover {
  box-shadow: var(--shadow-gold-strong);
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--color-gold);
  border-color: var(--color-gold);
}

.btn--outline:hover {
  background: rgba(200, 168, 75, 0.1);
  box-shadow: var(--shadow-gold);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--ghost:hover {
  background: var(--color-gray-700);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.btn--lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-lg);
}

.btn--sm {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover { transform: none; }
}

/* ==========================================================================
   6. LINKS
   ========================================================================== */

.link {
  color: var(--color-gold);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--transition-fast);
}

.link:hover {
  text-decoration-color: var(--color-gold);
}

/* ==========================================================================
   7. KARTEN (Cards)
   ========================================================================== */

.card {
  background: var(--color-gray-900);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  border-color: rgba(200, 168, 75, 0.5);
  box-shadow: var(--shadow-gold);
  transform: translateY(-4px);
}

.card__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}

.card__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.card__text {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}

/* ==========================================================================
   8. BADGE / TAG
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-gold);
  background: rgba(200, 168, 75, 0.08);
}

/* ==========================================================================
   9. SEKTIONS-HEADINGS
   ========================================================================== */

.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-6);
}

.section-subtitle {
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* ==========================================================================
   10. FORMULARE
   ========================================================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-gray-700);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(200, 168, 75, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-gray-300);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  font-size: var(--text-sm);
  color: #ef4444;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-gray-300);
}

/* ==========================================================================
   11. SKIP LINK (Accessibility)
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-gold);
  color: var(--color-black);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ==========================================================================
   12. DIVIDER
   ========================================================================== */

.divider {
  width: 60px;
  height: 3px;
  background: var(--gradient-gold);
  border: none;
  border-radius: var(--radius-full);
  margin: var(--space-6) 0;
}

.divider--center {
  margin-inline: auto;
}

/* ==========================================================================
   13. VISUALLY HIDDEN (Accessibility)
   ========================================================================== */

.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;
}

/* ==========================================================================
   14. BILD-PLATZHALTER
   ========================================================================== */

.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gray-900);
  border: 2px dashed var(--color-gold-dark);
  border-radius: var(--radius-md);
  color: var(--color-gray-300);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-align: center;
  user-select: none;
  overflow: hidden;
}

/* Seitenverhältnis-Varianten */
.img-placeholder--16-9 { aspect-ratio: 16 / 9;  width: 100%; }
.img-placeholder--4-3  { aspect-ratio: 4 / 3;   width: 100%; }
.img-placeholder--1-1  { aspect-ratio: 1 / 1;   width: 100%; }

/* Quadratischer Logo-Platzhalter 80×80 */
.img-placeholder--sq80 {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
}

/* Portrait (Personenfoto) */
.img-placeholder--portrait {
  aspect-ratio: 3 / 4;
  width: 100%;
}

/* ==========================================================================
   15. ANIMATIONEN
   ========================================================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(200, 168, 75, 0.2); }
  50%       { box-shadow: 0 0 32px rgba(200, 168, 75, 0.5); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

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

/* ==========================================================================
   15. SCROLLBAR
   ========================================================================== */

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

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

::-webkit-scrollbar-thumb {
  background: var(--color-gray-700);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-dark);
}

/* ==========================================================================
   16. SELEKTION
   ========================================================================== */

::selection {
  background: rgba(200, 168, 75, 0.3);
  color: var(--color-text);
}

/* ==========================================================================
   17. RESPONSIVE HELPERS
   ========================================================================== */

@media (max-width: 768px) {
  .hide-mobile   { display: none !important; }
}

@media (min-width: 769px) {
  .hide-desktop  { display: none !important; }
}

/* ==========================================================================
   18. GOOGLE FONTS IMPORT
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=JetBrains+Mono:wght@400;600&display=swap');
