/* ============================================
   WILBAK ENGINEERING — Apple-inspired Design System
   Based on DESIGN.md tokens
   ============================================ */

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* --- Design Tokens --- */
:root {
  /* Colors */
  --color-primary: #0066cc;
  --color-primary-focus: #0071e3;
  --color-primary-on-dark: #2997ff;
  --color-ink: #1d1d1f;
  --color-body: #1d1d1f;
  --color-body-on-dark: #ffffff;
  --color-body-muted: #cccccc;
  --color-ink-muted-80: #333333;
  --color-ink-muted-48: #7a7a7a;
  --color-divider-soft: #f0f0f0;
  --color-hairline: #e0e0e0;
  --color-canvas: #ffffff;
  --color-canvas-parchment: #f5f5f7;
  --color-surface-pearl: #fafafc;
  --color-surface-tile-1: #272729;
  --color-surface-tile-2: #2a2a2c;
  --color-surface-tile-3: #252527;
  --color-surface-black: #000000;
  --color-surface-chip: #d2d2d7;
  --color-on-primary: #ffffff;
  --color-on-dark: #ffffff;

  /* Typography */
  --font-display: "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  --font-text: "SF Pro Text", system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;

  /* Spacing */
  --sp-xxs: 4px;
  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-md: 17px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;
  --sp-section: 80px;

  /* Radii */
  --r-none: 0px;
  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 18px;
  --r-pill: 9999px;
  --r-full: 9999px;

  /* Shadow — product only */
  --shadow-product: rgba(0, 0, 0, 0.22) 3px 5px 30px 0;
}

/* --- Base --- */
body {
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.374px;
  color: var(--color-body);
  background-color: var(--color-canvas);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* --- Global Nav --- */
.global-nav {
  background-color: var(--color-surface-black);
  height: 44px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.global-nav-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.global-nav-logo {
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.12px;
  color: var(--color-on-dark);
  opacity: 0.88;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.global-nav-logo:hover { opacity: 1; text-decoration: none; }
.global-nav-logo img {
  height: 28px;
  width: auto;
  display: block;
}
.global-nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}
.global-nav-links a {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.12px;
  color: var(--color-on-dark);
  opacity: 0.88;
  text-decoration: none;
}
.global-nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-hamburger { display: none; background: none; border: none; cursor: pointer; color: var(--color-on-dark); font-size: 18px; }

/* --- Sub Nav (frosted) --- */
.sub-nav {
  background-color: rgba(245, 245, 247, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  height: 52px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 44px;
  z-index: 99;
  border-bottom: 1px solid var(--color-hairline);
}
.sub-nav-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sub-nav-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.231px;
  color: var(--color-ink);
}
.sub-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}
.sub-nav-links a {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.224px;
  color: var(--color-ink);
  text-decoration: none;
}
.sub-nav-links a:hover { color: var(--color-primary); text-decoration: none; }

/* --- Buttons --- */
.btn-primary {
  display: inline-block;
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.374px;
  border-radius: var(--r-pill);
  padding: 11px 22px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.btn-primary:hover { text-decoration: none; color: var(--color-on-primary); }
.btn-primary:active { transform: scale(0.95); }
.btn-primary:focus-visible { outline: 2px solid var(--color-primary-focus); }

.btn-secondary {
  display: inline-block;
  background-color: transparent;
  color: var(--color-primary);
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 400;
  border-radius: var(--r-pill);
  padding: 11px 22px;
  border: 1px solid var(--color-primary);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.btn-secondary:hover { text-decoration: none; }
.btn-secondary:active { transform: scale(0.95); }

.btn-pearl {
  display: inline-block;
  background-color: var(--color-surface-pearl);
  color: var(--color-ink-muted-80);
  font-size: 14px;
  font-weight: 400;
  border-radius: var(--r-md);
  padding: 8px 14px;
  border: 1px solid var(--color-divider-soft);
  cursor: pointer;
  text-decoration: none;
}
.btn-pearl:hover { text-decoration: none; }

.btn-store-hero {
  display: inline-block;
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--font-text);
  font-size: 18px;
  font-weight: 300;
  border-radius: var(--r-pill);
  padding: 14px 28px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.btn-store-hero:hover { text-decoration: none; color: var(--color-on-primary); }
.btn-store-hero:active { transform: scale(0.95); }

/* --- Text Links --- */
.text-link { color: var(--color-primary); text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-link-dark { color: var(--color-primary-on-dark); text-decoration: none; }
.text-link-dark:hover { text-decoration: underline; }

/* --- Product Tiles --- */
.tile {
  width: 100%;
  padding: var(--sp-section) 22px;
  text-align: center;
}
.tile-light { background-color: var(--color-canvas); color: var(--color-ink); }
.tile-parchment { background-color: var(--color-canvas-parchment); color: var(--color-ink); }
.tile-dark { background-color: var(--color-surface-tile-1); color: var(--color-on-dark); }
.tile-dark-2 { background-color: var(--color-surface-tile-2); color: var(--color-on-dark); }
.tile-dark-3 { background-color: var(--color-surface-tile-3); color: var(--color-on-dark); }

.tile-inner { max-width: 980px; margin: 0 auto; }

/* --- Headlines --- */
.hero-display {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.28px;
}
.display-lg {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
}
.display-md {
  font-family: var(--font-text);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.47;
  letter-spacing: -0.374px;
}
.lead {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0.196px;
}
.lead-airy {
  font-family: var(--font-text);
  font-size: 24px;
  font-weight: 300;
  line-height: 1.5;
}
.tagline {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.19;
  letter-spacing: 0.231px;
}
.body-strong { font-weight: 600; }
.caption { font-size: 14px; font-weight: 400; line-height: 1.43; letter-spacing: -0.224px; }
.caption-strong { font-size: 14px; font-weight: 600; line-height: 1.29; letter-spacing: -0.224px; }
.fine-print { font-size: 12px; font-weight: 400; line-height: 1.0; letter-spacing: -0.12px; }
.micro-legal { font-size: 10px; font-weight: 400; line-height: 1.3; letter-spacing: -0.08px; }

/* --- Product Image --- */
.product-image {
  max-width: 100%;
  margin: 0 auto;
  filter: drop-shadow(var(--shadow-product));
}

/* --- CTA Row --- */
.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* --- Footer --- */
.footer {
  background-color: var(--color-canvas-parchment);
  color: var(--color-ink-muted-80);
  padding: 64px 22px;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 32px;
}
.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.29;
  letter-spacing: -0.224px;
  color: var(--color-ink);
  margin-bottom: 12px;
}
.footer-col ul { list-style: none; }
.footer-col li { line-height: 2.41; }
.footer-col a {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-ink-muted-80);
  text-decoration: none;
}
.footer-col a:hover { text-decoration: underline; color: var(--color-primary); }
.footer-legal {
  border-top: 1px solid var(--color-hairline);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-legal p {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-ink-muted-48);
}
.footer-legal-links { display: flex; gap: 16px; }
.footer-legal-links a {
  font-size: 12px;
  color: var(--color-ink-muted-48);
  text-decoration: none;
}
.footer-legal-links a:hover { text-decoration: underline; }

/* --- Utility Cards (Projects) --- */
.utility-card {
  background-color: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  overflow: hidden;
}
.utility-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-sm);
  margin-bottom: 16px;
}
.utility-card h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.374px;
  margin-bottom: 4px;
}
.utility-card .location {
  font-size: 14px;
  color: var(--color-ink-muted-48);
  margin-bottom: 8px;
}
.utility-card p {
  font-size: 14px;
  line-height: 1.43;
  color: var(--color-ink-muted-80);
}

/* --- Legal Pages --- */
.legal-content {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--sp-section) 22px;
}
.legal-content h1 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 8px;
}
.legal-content .last-updated {
  font-size: 14px;
  color: var(--color-ink-muted-48);
  margin-bottom: 48px;
}
.legal-content h2 {
  font-family: var(--font-text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.47;
  letter-spacing: -0.374px;
  margin-top: 48px;
  margin-bottom: 12px;
}
.legal-content p {
  font-size: 17px;
  line-height: 1.47;
  color: var(--color-ink-muted-80);
  margin-bottom: 16px;
}
.legal-content ul {
  padding-left: 20px;
  margin-bottom: 16px;
}
.legal-content li {
  font-size: 17px;
  line-height: 1.47;
  color: var(--color-ink-muted-80);
  margin-bottom: 8px;
}

/* --- Stats Row --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 980px;
  margin: 0 auto;
}
.stat-item { text-align: center; }
.stat-number {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.28px;
}
.stat-label {
  font-size: 14px;
  color: var(--color-ink-muted-48);
  margin-top: 4px;
}

/* --- Quote Block --- */
.quote-block {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}
.quote-block blockquote {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0.196px;
  margin-bottom: 16px;
}
.quote-block cite {
  font-size: 14px;
  font-style: normal;
  color: var(--color-ink-muted-48);
}

/* --- Process Steps --- */
.process-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 980px;
  margin: 0 auto;
}
.process-step { text-align: left; }
.process-step .step-number {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.process-step h3 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.19;
  margin-bottom: 8px;
}
.process-step p {
  font-size: 17px;
  line-height: 1.47;
  color: var(--color-ink-muted-80);
}

/* --- Contact Form --- */
.contact-form {
  max-width: 580px;
  margin: 0 auto;
  text-align: left;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  font-size: 17px;
  font-family: var(--font-text);
  border: 1px solid var(--color-hairline);
  border-radius: var(--r-sm);
  background-color: var(--color-canvas);
  color: var(--color-ink);
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--color-primary);
}
.form-group textarea { resize: vertical; min-height: 120px; }

/* --- Image Grid (Projects) --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 22px;
}

/* --- Section Spacing --- */
.section-padded { padding: var(--sp-section) 0; }

/* --- Responsive --- */
@media (max-width: 1068px) {
  .hero-display { font-size: 40px; }
  .display-lg { font-size: 34px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .process-steps { grid-template-columns: 1fr; gap: 24px; }
  .footer-columns { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 833px) {
  .global-nav-links { display: none; }
  .nav-hamburger { display: block; }
  .sub-nav-links { display: none; }
  .projects-grid { grid-template-columns: 1fr; }
  .tile { padding: 48px 22px; }
}

@media (max-width: 640px) {
  .hero-display { font-size: 34px; }
  .display-lg { font-size: 28px; }
  .lead { font-size: 21px; }
  .cta-row { flex-direction: column; align-items: center; }
  .btn-primary, .btn-secondary { width: 100%; text-align: center; }
  .stats-row { grid-template-columns: 1fr; }
  .footer-columns { grid-template-columns: 1fr; }
  .footer-legal { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 419px) {
  .hero-display { font-size: 28px; }
  .tile { padding: 48px 16px; }
}
