/**
 * MiniWeb - Bespoke Light Editorial Studio Design System
 * Inspired by Swiss modernism, Linear, Pentagram & Stripe.
 * High-contrast editorial typography, crisp light surfaces, tactile shadows, and fluid animations.
 */

:root {
  --bg: #F8F9FA;
  --bg-2: #FFFFFF;
  --bg-soft: #F1F3F5;
  --bg-subtle: #E9ECEF;
  --line: rgba(15, 23, 42, 0.07);
  --line-2: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.2);

  --ink: #0F172A;
  --ink-dim: #475569;
  --ink-mute: #94A3B8;

  --accent: #1D4ED8;
  --accent-hover: #1E40AF;
  --accent-2: #2563EB;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(29, 78, 216, 0.07);
  --accent-line: rgba(29, 78, 216, 0.25);

  --danger-soft: #FEF2F2;
  --danger-ink: #B91C1C;
  --danger-line: #FECACA;

  --success: #16A34A;
  --success-soft: #F0FDF4;
  --success-line: #BBF7D0;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 0 1px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 20px 40px -12px rgba(15, 23, 42, 0.12), 0 0 1px rgba(15, 23, 42, 0.15);
  --shadow-lg: 0 25px 60px -15px rgba(15, 23, 42, 0.1);

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 150ms ease, opacity 150ms ease;
}

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

.wrap {
  width: min(1260px, 100% - 48px);
  margin: 0 auto;
}

.wrap-narrow {
  width: min(840px, 100% - 48px);
  margin: 0 auto;
}

/* Editorial Typography */
.display {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-wrap: balance;
  color: var(--ink);
}

.h1 {
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.12;
}

.h2 {
  font-size: clamp(22px, 2.5vw, 34px);
  line-height: 1.18;
}

.h3 {
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.25;
}

.lede {
  font-size: clamp(14.5px, 1.05vw, 17px);
  color: var(--ink-dim);
  line-height: 1.55;
  max-width: 60ch;
  text-wrap: pretty;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.mono {
  font-family: var(--font-mono);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 2px 8px -2px rgba(29, 78, 216, 0.4), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 8px 20px -4px rgba(29, 78, 216, 0.45);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--bg-2);
  color: var(--ink);
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  background: var(--bg-soft);
  border-color: var(--line-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

/* Badges & Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-dim);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.pulse-dot {
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* Cards & Surfaces */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.card:hover {
  border-color: var(--line-2);
}

.card-elevated {
  box-shadow: var(--shadow-card);
}

.card-elevated:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.glass {
  background: rgba(248, 249, 250, 0.88);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
}

.bg-grid {
  background-image: linear-gradient(to right, rgba(15, 23, 42, 0.03) 1px, transparent 1px), linear-gradient(to bottom, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

.bg-radial {
  background: radial-gradient(800px 400px at 50% -10%, rgba(29, 78, 216, 0.06), transparent 70%), radial-gradient(600px 300px at 90% 20%, rgba(245, 158, 11, 0.04), transparent 60%);
}

/* Header & Navigation */
.header-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 68px;
}

.header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 18px;
  color: var(--ink);
}

.brand-dot {
  color: var(--accent);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  color: var(--ink-dim);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 150ms ease, background 150ms ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--ink);
  background: rgba(15, 23, 42, 0.04);
}

/* Dropdown Menu */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 110;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: flex;
}

.nav-dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-dim);
  display: flex;
  flex-direction: column;
}

.nav-dropdown-item:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.nav-dropdown-item small {
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 2px;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-2);
  padding: 3px;
  background: var(--bg-2);
  box-shadow: var(--shadow-sm);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink-mute);
  min-height: 26px;
  transition: all 140ms ease;
}

.lang-btn.active {
  background: var(--bg-soft);
  color: var(--ink);
}

.lang-btn:hover:not(.active) {
  color: var(--ink-dim);
}

/* Mobile Menu Button & Panel */
.nav-mobile {
  display: none;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--ink);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}

.nav-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.nav-mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 85vw);
  background: var(--bg-2);
  border-left: 1px solid var(--line-2);
  padding: 24px;
  z-index: 160;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), visibility 280ms;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.nav-mobile-panel.open {
  transform: translateX(0);
  visibility: visible;
}

.nav-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.nav-mobile-close {
  background: transparent;
  border: 0;
  color: var(--ink-dim);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

.nav-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-mobile-link {
  font-size: 15px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink-dim);
}

.nav-mobile-link:hover, .nav-mobile-link.active {
  color: var(--ink);
  background: var(--bg-soft);
}

.nav-mobile-panel .submenu {
  display: none;
  flex-direction: column;
  padding-left: 16px;
  margin-left: 10px;
  border-left: 2px solid var(--line-2);
  gap: 4px;
}

.nav-mobile-panel .submenu.open {
  display: flex;
}

/* Sections & Grids */
section {
  padding: clamp(48px, 5vw, 72px) 0;
  position: relative;
}

.hero-section {
  padding-top: clamp(100px, 10vw, 130px);
  padding-bottom: clamp(40px, 5vw, 64px);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 4vw, 56px);
  align-items: center;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(32px, 4vw, 56px);
  align-items: start;
}

.audit-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 4vw, 56px);
  align-items: start;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  align-items: center;
}

.two-col-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .two-col-cards {
    grid-template-columns: 1fr !important;
  }
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.four-col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.case-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
}

.case-hero-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: center;
}

.cta-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
}

/* Large Interactive Workflow Simulator */
.workflow-simulator {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.workflow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.workflow-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: var(--radius-full);
}

.workflow-tab-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  border: 0;
  cursor: pointer;
  background: transparent;
  color: var(--ink-mute);
  transition: all 150ms ease;
}

.workflow-tab-btn.active {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.35);
}

/* Compact Device / Calculator Mockup */
.calculator-demo-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 12px;
  align-items: stretch;
}

.calculator-models-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.calculator-estimate-card {
  padding: 12px 14px;
  background: var(--bg-2);
  border-radius: 8px;
  border: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mockup-model-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  height: 36px;
  min-height: 36px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--ink-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.mockup-model-btn:hover {
  background: var(--bg-soft);
  color: var(--ink);
  border-color: var(--line-strong);
}

.mockup-model-btn.selected {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  border-color: var(--accent-line) !important;
  font-weight: 600;
}

/* Interactive Diagnostic Selector */
.diagnostic-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.diagnostic-btn {
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-2);
  text-align: left;
  cursor: pointer;
  transition: all 180ms ease;
  box-shadow: var(--shadow-sm);
}

.diagnostic-btn:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.diagnostic-btn.active {
  background: var(--bg-2);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-line), var(--shadow-card);
}

/* Forms */
.form-input, .form-textarea, .form-select {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 13px 16px;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-line);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--ink-mute);
}

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

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
}

.form-status {
  font-family: var(--font-mono);
  font-size: 13px;
  min-height: 20px;
  margin: 8px 0 0;
  line-height: 1.4;
}

/* Marquee */
.marquee-wrapper {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
  padding: 12px 0;
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 40px;
  animation: marquee 30s linear infinite;
  user-select: none;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Subtle Scroll Enhancements */
.reveal {
  opacity: 1;
  transform: none;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Responsive Rules */
@media (max-width: 1024px) {
  .hero-grid, .two-col, .audit-grid, .testimonial-grid, .case-grid, .case-hero-card, .cta-grid {
    grid-template-columns: 1fr !important;
    gap: 36px;
  }

  .three-col {
    grid-template-columns: 1fr !important;
  }

  .four-col {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .wrap {
    width: min(1260px, 100% - 32px);
  }

  .nav-desktop {
    display: none !important;
  }

  .nav-mobile {
    display: flex !important;
  }

  .hero-grid, .two-col, .audit-grid, .testimonial-grid, .case-grid, .case-hero-card, .cta-grid {
    grid-template-columns: 1fr !important;
    gap: 28px;
  }

  .four-col {
    grid-template-columns: 1fr !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
  }

  .diagnostic-nav {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(1260px, 100% - 24px);
  }

  .hero-section {
    padding-top: 86px;
  }

  .workflow-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 12px 14px !important;
  }

  .workflow-tabs {
    width: 100% !important;
    display: flex !important;
  }

  .workflow-tab-btn {
    flex: 1 !important;
    text-align: center !important;
    padding: 7px 6px !important;
    font-size: 11px !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }

  .calculator-demo-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .calculator-models-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .mockup-model-btn {
    min-height: 38px !important;
    height: auto !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .calculator-estimate-card {
    padding: 14px !important;
  }
}
