/* ============================================
   Maestro Graphics — Design System
   Inspired by BMW Corporate Aesthetic
   Accent: #006549
   ============================================ */

/* --- Custom Properties --- */
:root {
  --color-primary: #006549;
  --color-primary-active: #00523d;
  --color-primary-disabled: #d6d6d6;
  --color-ink: #262626;
  --color-body: #3c3c3c;
  --color-body-strong: #1a1a1a;
  --color-muted: #6b6b6b;
  --color-muted-soft: #9a9a9a;
  --color-hairline: #e6e6e6;
  --color-hairline-strong: #cccccc;
  --color-canvas: #ffffff;
  --color-surface-soft: #f7f7f7;
  --color-surface-card: #fafafa;
  --color-surface-strong: #ebebeb;
  --color-surface-dark: #1a2129;
  --color-surface-dark-elevated: #262e38;
  --color-on-primary: #ffffff;
  --color-on-dark: #ffffff;
  --color-on-dark-soft: #bbbbbb;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #dc2626;

  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
  --space-section: 80px;

  --max-width: 1440px;
  --nav-height: 64px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--color-body);
  background: var(--color-canvas);
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
ul { list-style: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* --- Typography --- */
.display-xl { font-size: 64px; font-weight: 700; line-height: 1.05; letter-spacing: 0; }
.display-lg { font-size: 48px; font-weight: 700; line-height: 1.1; letter-spacing: 0; }
.display-md { font-size: 32px; font-weight: 700; line-height: 1.15; letter-spacing: 0; }
.display-sm { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: 0; }
.title-lg { font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
.title-md { font-size: 18px; font-weight: 700; line-height: 1.4; letter-spacing: 0; }
.title-sm { font-size: 16px; font-weight: 700; line-height: 1.4; letter-spacing: 0; }
.body-md { font-size: 16px; font-weight: 300; line-height: 1.55; letter-spacing: 0; }
.body-sm { font-size: 14px; font-weight: 300; line-height: 1.55; letter-spacing: 0; }
.button-label { font-size: 14px; font-weight: 700; line-height: 1.0; letter-spacing: 0.5px; }
.nav-link { font-size: 14px; font-weight: 400; line-height: 1.4; letter-spacing: 0.3px; }
.label-uppercase { font-size: 13px; font-weight: 700; line-height: 1.3; letter-spacing: 1.5px; text-transform: uppercase; }

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-lg); }
.section { padding: var(--space-section) 0; }
.section-dark { background: var(--color-surface-dark); color: var(--color-on-dark); }
.section-green { background: var(--color-primary); color: var(--color-on-primary); }
.section-soft { background: var(--color-surface-soft); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }
.grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }

/* --- Buttons --- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: var(--color-on-primary);
  font-size: 14px; font-weight: 700; line-height: 1.0; letter-spacing: 0.5px;
  padding: 14px 32px; height: 48px; border-radius: 0;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-primary:hover { background: var(--color-primary-active); }
.btn-primary:disabled { background: var(--color-primary-disabled); color: var(--color-muted); cursor: not-allowed; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-canvas); color: var(--color-ink);
  font-size: 14px; font-weight: 700; line-height: 1.0; letter-spacing: 0.5px;
  padding: 13px 31px; height: 48px; border: 1px solid var(--color-hairline-strong); border-radius: 0;
  transition: border-color 0.2s;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--color-ink); }

.btn-secondary-on-dark {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--color-on-dark);
  font-size: 14px; font-weight: 700; line-height: 1.0; letter-spacing: 0.5px;
  padding: 13px 31px; border: 1px solid var(--color-on-dark); border-radius: 0;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-secondary-on-dark:hover { background: rgba(255,255,255,0.1); }

.text-link-uppercase {
  font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--color-ink); transition: color 0.2s;
}
.text-link-uppercase::after { content: " ›"; }
.text-link-uppercase:hover { color: var(--color-primary); }

/* --- Hero Bands --- */
.hero-dark {
  position: relative;
  background: var(--color-surface-dark);
  color: var(--color-on-dark);
  padding: var(--space-section) 0;
  overflow: hidden;
  min-height: 75vh;
  display: flex; align-items: center;
}
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(26,33,41,0.88) 0%, rgba(26,33,41,0.55) 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 720px; }
.hero-content h1 { margin-bottom: var(--space-md); animation: fadeSlideUp 0.8s ease-out both; }
.hero-content p { margin-bottom: var(--space-xl); font-size: 18px; font-weight: 300; animation: fadeSlideUp 0.8s ease-out 0.3s both; }

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

/* --- Navigation --- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--color-primary);
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  transition: box-shadow 0.3s;
}
.site-header.scrolled { box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-lg);
}
.site-logo { height: 40px; width: auto; }
.nav-list { display: flex; align-items: center; gap: var(--space-xl); }
.nav-list a:not(.btn-nav-cta) {
  font-size: 14px; font-weight: 400; letter-spacing: 0.3px;
  color: var(--color-on-dark); transition: opacity 0.2s;
  padding: 8px 0;
}
.nav-list a:not(.btn-nav-cta):hover,
.nav-list a:not(.btn-nav-cta).active { opacity: 0.75; }
.nav-list .nav-cta { margin-left: var(--space-xs); }

.btn-nav-cta {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-on-primary); color: var(--color-primary);
  font-size: 14px; font-weight: 700; line-height: 1.0; letter-spacing: 0.5px;
  padding: 14px 32px; height: 48px; border-radius: 0;
  transition: opacity 0.2s;
  text-decoration: none;
}
.btn-nav-cta:hover { opacity: 0.9; }

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  padding: 8px; cursor: pointer; background: none; border: none;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--color-on-dark); border-radius: 0;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Cards --- */
.card {
  background: var(--color-canvas);
  border-radius: 0;
  padding: var(--space-lg);
}
.card-image {
  background: var(--color-surface-card);
  aspect-ratio: 16 / 10;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card-image img, .card-image video { width: 100%; height: 100%; object-fit: cover; }
.card-image-hover { position: relative; }
.card-image-hover .img-hover { position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s ease; }
.card-image-hover:hover .img-default { opacity: 0; }
.card-image-hover:hover .img-hover { opacity: 1; }
.card-image-hover { position: relative; }
.card-image-hover .img-hover { position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s ease; }
.card-image-hover:hover .img-default { opacity: 0; }
.card-image-hover:hover .img-hover { opacity: 1; }
.card-body { padding-top: var(--space-md); }
.card-body h3 { font-size: 18px; font-weight: 700; line-height: 1.4; margin-bottom: var(--space-xs); }
.card-body p { font-size: 14px; font-weight: 300; line-height: 1.55; color: var(--color-body); }

/* --- Footer --- */
.site-footer {
  background: var(--color-surface-soft);
  padding: 64px 0 0;
  color: var(--color-body);
}
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); padding-bottom: 48px; }
.footer-col h4 { font-size: 14px; font-weight: 700; margin-bottom: var(--space-md); text-transform: uppercase; letter-spacing: 1px; }
.footer-col ul li { margin-bottom: var(--space-xs); }
.footer-col ul li a { font-size: 14px; font-weight: 300; color: var(--color-body); transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--color-primary); }
.footer-bottom {
  border-top: 1px solid var(--color-hairline);
  padding: var(--space-lg) 0;
  text-align: center;
  font-size: 13px;
  color: var(--color-muted);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center;
  padding: var(--space-lg);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--color-canvas);
  width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto;
  padding: var(--space-xl);
  position: relative;
}
.modal-close {
  position: absolute; top: var(--space-md); right: var(--space-md);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--color-ink);
  transition: color 0.2s;
  background: none; border: none; cursor: pointer;
}
.modal-close:hover { color: var(--color-primary); }
.modal h2 { margin-bottom: var(--space-lg); }

/* --- Forms --- */
.form-group { margin-bottom: var(--space-md); }
.form-group label {
  display: block;
  font-size: 13px; font-weight: 700; margin-bottom: var(--space-xs);
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--color-ink);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; height: 48px;
  padding: 14px 16px;
  border: 1px solid var(--color-hairline);
  border-radius: 0;
  font-size: 16px; font-weight: 300;
  color: var(--color-ink);
  background: var(--color-canvas);
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23262626' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
.form-group textarea { height: 120px; resize: vertical; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--color-ink); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.form-error input,
.form-error select,
.form-error textarea { border-color: var(--color-error); }
.form-error-message { color: var(--color-error); font-size: 12px; margin-top: 4px; display: none; }
.form-error .form-error-message { display: block; }

/* --- Placeholder Helper --- */
.placeholder-visual {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface-card);
  color: var(--color-muted-soft);
  font-size: 14px; font-weight: 300;
  text-align: center; padding: var(--space-md);
}

/* --- How It Works Steps --- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-xl); position: relative; }
.steps::before {
  content: ''; position: absolute; top: 36px; left: 80px;
  right: 80px; height: 2px; background: var(--color-hairline);
  z-index: 0;
}
.step {
  text-align: center; position: relative; z-index: 1;
}
.step-number {
  width: 72px; height: 72px; margin: 0 auto var(--space-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: var(--color-on-primary);
  font-size: 28px; font-weight: 700;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}
.step-number::after {
  content: ''; position: absolute; inset: -4px;
  border: 2px solid var(--color-primary);
  opacity: 0; transform: scale(0.9);
  transition: opacity 0.3s, transform 0.3s;
}
.step:hover .step-number {
  transform: scale(1.08);
  box-shadow: 0 0 0 6px rgba(0,101,73,0.2);
}
.step:hover .step-number::after {
  opacity: 1; transform: scale(1);
}
.step.revealed .step-number {
  animation: stepPop 0.5s ease forwards;
}
@keyframes stepPop {
  0% { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(0,101,73,0.3); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(0,101,73,0.15); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,101,73,0); }
}
.step h3 { font-size: 18px; font-weight: 700; line-height: 1.4; margin-bottom: var(--space-xs); }
.step p { font-size: 14px; font-weight: 300; line-height: 1.55; color: var(--color-body); max-width: 220px; margin: 0 auto; }

/* Scroll reveal animation for steps */
.step {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.step.revealed { opacity: 1; transform: translateY(0); }
.step:nth-child(1) { transition-delay: 0s; }
.step:nth-child(2) { transition-delay: 0.12s; }
.step:nth-child(3) { transition-delay: 0.24s; }
.step:nth-child(4) { transition-delay: 0.36s; }
.step:nth-child(5) { transition-delay: 0.48s; }

@media (max-width: 1024px) {
  .steps { grid-template-columns: 1fr 1fr 1fr; gap: var(--space-lg); }
  .steps::before { display: none; }
  .step p { max-width: none; }
}

@media (max-width: 768px) {
  .steps { grid-template-columns: 1fr; gap: var(--space-md); max-width: 500px; margin: 0 auto; }
  .steps::before { display: none; }
  .step {
    display: grid; grid-template-columns: 56px 1fr; gap: var(--space-sm) var(--space-md);
    text-align: left; align-items: start;
    opacity: 1; transform: none;
  }
  .step.revealed { opacity: 1; transform: none; }
  .step.revealed .step-number { animation: stepPop 0.5s ease forwards; }
  .step-number { width: 56px; height: 56px; font-size: 22px; margin: 0; grid-row: 1 / 3; }
  .step h3 { margin-bottom: 0; align-self: end; }
  .step p { font-size: 13px; margin: 0; }
}
.text-center { text-align: center; }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mt-lg { margin-top: var(--space-lg); }

/* --- Material Card Animation --- */
.material-card {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s, border-color 0.3s;
  border: 1px solid transparent;
}
.material-card.revealed {
  opacity: 1; transform: translateY(0);
}
.material-card:hover {
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transform: translateY(-4px);
}
.material-card:nth-child(1) { transition-delay: 0s; }
.material-card:nth-child(2) { transition-delay: 0.08s; }
.material-card:nth-child(3) { transition-delay: 0.16s; }
.material-card:nth-child(4) { transition-delay: 0.24s; }
.material-card:nth-child(5) { transition-delay: 0.32s; }
.material-card:nth-child(6) { transition-delay: 0.40s; }

/* --- Value Card Animation --- */
.value-card {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s;
  border-bottom: 3px solid transparent;
}
.value-card.revealed {
  opacity: 1; transform: translateY(0);
}
.value-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  border-bottom-color: var(--color-primary);
}
.value-card:nth-child(1) { transition-delay: 0s; }
.value-card:nth-child(2) { transition-delay: 0.1s; }
.value-card:nth-child(3) { transition-delay: 0.2s; }

/* --- Why Card Animation --- */
.why-card {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s, border-color 0.3s;
  border: 1px solid transparent;
}
.why-card.revealed {
  opacity: 1; transform: translateY(0);
}
.why-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 20px rgba(0,101,73,0.12);
  transform: translateY(-4px);
}
.why-card:nth-child(1) { transition-delay: 0s; }
.why-card:nth-child(2) { transition-delay: 0.12s; }
.why-card:nth-child(3) { transition-delay: 0.24s; }
.why-card:nth-child(4) { transition-delay: 0.36s; }

/* --- Story Reveal Animation --- */
.story-word {
  transition: opacity 0.12s ease;
  will-change: opacity;
}
.story-reveal-active .story-word {
  opacity: 0.15;
}
@media (prefers-reduced-motion: reduce) {
  .story-reveal-active .story-word { opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-dark { min-height: 65vh; }
}

@media (max-width: 768px) {
  .display-xl { font-size: 40px; }
  .display-lg { font-size: 32px; }
  .display-md { font-size: 24px; }
  .display-sm { font-size: 20px; }

  .nav-list {
    display: none; position: fixed; top: var(--nav-height); left: 0; right: 0;
    background: var(--color-primary); flex-direction: column;
    padding: var(--space-lg); gap: var(--space-md);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  .nav-list.open { display: flex; }
  .nav-list .nav-cta { margin-left: 0; width: 100%; text-align: center; }
  .hamburger { display: flex; }

  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }

  .hero-dark { min-height: 60vh; padding: var(--space-xxl) 0; }
  .hero-content p { font-size: 16px; }
  .section { padding: var(--space-xxl) 0; }
  .site-footer { padding: var(--space-xxl) 0 0; }
}

@media (max-width: 480px) {
  .display-xl { font-size: 32px; }
  .display-lg { font-size: 28px; }
  .card { padding: var(--space-md); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-content h1,
  .hero-content p { animation: none; }
}

/* --- Die List Table --- */
.die-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md); margin-bottom: var(--space-md); flex-wrap: wrap;
}
.die-count { font-size: 14px; font-weight: 400; color: var(--color-muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--color-hairline); }
.die-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.die-table th, .die-table td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--color-hairline);
  white-space: nowrap;
}
.die-table thead th {
  background: var(--color-surface-dark); color: var(--color-on-dark);
  font-weight: 700; font-size: 13px; letter-spacing: 0.5px; text-transform: uppercase;
}
.die-table tbody tr:nth-child(even) { background: var(--color-surface-card); }
.die-table tbody tr:hover { background: rgba(0,101,73,0.06); }
.die-filters th { background: var(--color-canvas); padding: 8px; }
.die-filters input {
  width: 100%; min-width: 90px; height: 36px; padding: 0 10px;
  border: 1px solid var(--color-hairline-strong); border-radius: 0;
  font-size: 13px; font-family: inherit;
}
.die-filters input:focus { outline: none; border-color: var(--color-ink); }
.die-empty td { text-align: center; color: var(--color-muted); padding: 40px; font-style: italic; }
