/* ========================================
   KlimConsult — Styles (Brandbook v1.0)
   ======================================== */

/* --- Custom Properties --- */
:root {
  /* Backgrounds */
  --color-bg:        #0A0A0A;
  --color-bg-raised: #1A1714;
  --color-divider:   #1F1C1A;

  /* Text */
  --color-text-primary:   #F0EDE8;
  --color-text-secondary: #6B6560;

  /* Accent */
  --color-accent:       #B87333;
  --color-accent-hover: #C8853D;

  /* Form */
  --color-form-border: #2A2723;
  --color-form-focus:  #B87333;

  /* State */
  --color-success: #4A7C59;
  --color-error:   #8B3A3A;

  /* Spacing */
  --space-1:  8px;
  --space-2:  16px;
  --space-3:  24px;
  --space-4:  32px;
  --space-6:  48px;
  --space-8:  64px;
  --space-12: 96px;
  --space-16: 128px;

  /* Layout */
  --max-width: 760px;
}

/* --- Light Mode --- */
[data-theme="light"] {
  --color-bg:        #F5F3EF;
  --color-bg-raised: #FFFFFF;
  --color-divider:   #E5E0DA;
  --color-text-primary:   #1A1410;
  --color-text-secondary: #4A4540;
  --color-accent:       #9A6020;
  --color-accent-hover: #7D4E18;
  --color-form-border: #D5D0CA;
  --color-form-focus:  #9A6020;
  --color-success: #3A6A49;
  --color-error:   #9B3030;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
}

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

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
  position: relative;
  z-index: 1;
}

/* --- Nav --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 100;
  background: var(--color-bg);
  transition: backdrop-filter 200ms, border-color 200ms;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--color-divider);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 52px;
  width: auto;
}

.nav-link {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--color-text-secondary);
  transition: color 200ms ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

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

/* --- Theme Toggle --- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--color-divider);
  border-radius: 2px;
  padding: 6px;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: color 200ms ease, border-color 200ms ease;
  margin-left: var(--space-1);
}

.theme-toggle:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* --- Hamburger (mobile) --- */
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 6px;
  transition: color 200ms ease;
}

.nav-hamburger:hover {
  color: var(--color-accent);
}

.nav-hamburger svg {
  display: block;
}

/* Dark mode (default): show sun icon, hide moon */
.theme-icon-moon { display: none; }
.theme-icon-sun  { display: block; }

/* Light mode: show moon icon, hide sun */
[data-theme="light"] .theme-icon-moon { display: block; }
[data-theme="light"] .theme-icon-sun  { display: none; }

/* --- Light Mode: Nav & Backgrounds --- */
[data-theme="light"] .nav {
  background: var(--color-bg);
}

[data-theme="light"] .nav.scrolled {
  background: rgba(245, 243, 239, 0.85);
}

[data-theme="light"] .nav-logo-img {
  filter: brightness(0.15);
}

[data-theme="light"] .section-bg,
[data-theme="light"] .hero-bg {
  opacity: 0.12;
  filter: brightness(0.5) contrast(2);
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--space-16);
  padding-bottom: var(--space-12);
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-bg-img {
  width: 100%;
  min-width: 100%;
  height: auto;
}

.hero-headline {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 72px;
  line-height: 1.1;
  color: var(--color-text-primary);
  max-width: 680px;
  margin-bottom: var(--space-4);
}

.hero-subline {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 680px;
}

/* --- Sections --- */
.section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.section-header {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 42px;
  line-height: 1.2;
  color: var(--color-text-primary);
  margin-bottom: var(--space-6);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
}

.section-intro {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
  max-width: 680px;
}

/* --- Prose --- */
.prose p {
  margin-bottom: var(--space-3);
}

.prose p:last-child {
  margin-bottom: 0;
}

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

/* --- Section Backgrounds --- */
.section-with-bg {
  position: relative;
  overflow: hidden;
}

.section-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* --- Services Grid --- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.service-card {
  background: var(--color-bg-raised);
  padding: var(--space-6);
  border: 1px solid var(--color-divider);
  border-radius: 2px;
  transition: border-color 200ms ease;
}

.service-card:hover {
  border-color: var(--color-accent);
}

.service-card-wide {
  grid-column: 1 / -1;
}

.service-title {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.service-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* --- Contact Form --- */
.contact-form {
  max-width: 520px;
  position: relative;
}

.form-group {
  margin-bottom: var(--space-3);
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
}

.form-input {
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-form-border);
  border-radius: 2px;
  padding: 14px 16px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text-primary);
  transition: border-color 200ms ease;
  outline: none;
}

.form-input::placeholder {
  color: var(--color-text-secondary);
}

.form-input:focus {
  border-color: var(--color-form-focus);
}

.form-input.error {
  border-color: var(--color-error);
}

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

.form-error {
  display: block;
  font-size: 13px;
  color: var(--color-error);
  margin-top: 4px;
  min-height: 0;
}

.form-submit {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-bg);
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 14px 32px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
}

.form-submit:hover {
  background: var(--color-accent-hover);
}

.form-submit:active {
  transform: scale(0.98);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  margin-top: var(--space-2);
  font-size: 15px;
}

.form-status.success {
  color: var(--color-success);
}

.form-status.error {
  color: var(--color-error);
}

/* --- Footer --- */
.footer {
  padding-top: var(--space-8);
  padding-bottom: var(--space-6);
  border-top: 1px solid var(--color-divider);
}

.footer p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.footer-link {
  color: var(--color-text-secondary);
  transition: color 200ms ease;
}

.footer-link:hover {
  color: var(--color-accent);
}

/* --- Cookie Banner --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-bg-raised);
  border-top: 1px solid var(--color-divider);
  padding: var(--space-2) 0;
  z-index: 200;
  display: none;
}

.cookie-banner.visible {
  display: block;
}

.cookie-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.cookie-text {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.cookie-link {
  color: var(--color-text-secondary);
  text-decoration: underline;
}

.cookie-link:hover {
  color: var(--color-accent);
}

.cookie-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

.cookie-btn {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 2px;
  cursor: pointer;
  border: none;
  transition: background 150ms ease;
}

.cookie-btn-decline {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-divider);
}

.cookie-btn-decline:hover {
  border-color: var(--color-text-secondary);
}

.cookie-btn-accept {
  background: var(--color-accent);
  color: var(--color-bg);
}

.cookie-btn-accept:hover {
  background: var(--color-accent-hover);
}

/* --- Animations --- */
.hero-animate {
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeIn 600ms ease-out 200ms forwards;
}

@keyframes heroFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.section-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Focus States --- */
.form-input:focus-visible {
  border-color: var(--color-form-focus);
  outline: 2px solid var(--color-form-focus);
  outline-offset: 2px;
}

.form-submit:focus-visible,
.nav-link:focus-visible,
.cookie-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .hero-headline {
    font-size: 42px;
  }

  .section-header {
    font-size: 28px;
  }

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

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

  .hero {
    padding-top: var(--space-12);
    padding-bottom: var(--space-8);
  }

  .hero-subline {
    font-size: 16px;
  }

  .hero-bg {
    opacity: 0.3;
  }

  .section-bg {
    opacity: 0.3;
  }

  .nav-inner {
    position: relative;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-divider);
    padding: var(--space-3);
    gap: var(--space-3);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    font-size: 14px;
  }

  .nav-hamburger {
    display: flex;
  }

  .theme-toggle {
    align-self: center;
  }

  .cookie-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
