/* ============================================================
   TESSERAS — Industrial Shipping Container Design System
   ============================================================ */

/* === DESIGN TOKENS === */
:root {
  /* Colors */
  --bg: #0e0e10;
  --bg-dark: #080809;
  --surface: #1c1c20;
  --surface-hover: #222228;
  --text: #e8e8ec;
  --text-muted: #8a8a94;
  --text-light: #e8e8ec;
  --text-on-accent: #0e0e10;
  --accent: #f26522;
  --accent-hover: #ff7a3d;
  --border: #2a2a30;
  --border-light: #1f1f24;
  --border-emphasis: #3a3a42;

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --font-body: 'DM Sans', sans-serif;

  /* Type Scale */
  --text-hero: clamp(3rem, 8vw, 6rem);
  --text-h1: clamp(2rem, 5vw, 3.5rem);
  --text-h2: clamp(1.25rem, 3vw, 1.75rem);
  --text-body: 1rem;
  --text-label: 0.75rem;
  --text-micro: 0.625rem;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 80px;

  /* Layout */
  --container-max: 1200px;
  --border-w: 1px;
  --border-w-heavy: 2px;

  /* Letter Spacing */
  --track-tight: -0.02em;
  --track-wide: 0.1em;
  --track-ultra: 0.25em;
}


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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border: 1px solid var(--border-light);
}

::selection {
  background: rgba(242, 101, 34, 0.3);
  color: var(--text);
}


/* === CORRUGATED CONTAINER TEXTURE === */
.corrugated {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}


/* === TYPOGRAPHY CLASSES === */

/* Display — massive headlines */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-hero);
  line-height: 0.92;
  letter-spacing: var(--track-tight);
  color: var(--text);
  overflow: hidden;
}

/* Page title */
.title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-h1);
  line-height: 1.05;
  letter-spacing: var(--track-tight);
}

/* Section heading */
.heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-h2);
  line-height: 1.15;
}

/* Technical label — monospaced, uppercase */
.label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--text-muted);
}

/* Micro text — serial numbers, reference codes */
.micro {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--track-ultra);
  color: var(--text-muted);
}


/* === INDUSTRIAL COMPONENTS === */

/* Status badge — black bg, light text */
.status-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  padding: var(--space-xs) var(--space-sm);
  background: var(--border-emphasis);
  color: var(--text);
  line-height: 1.4;
}

/* Accent badge — orange bg */
.accent-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  padding: 3px var(--space-sm);
  background: var(--accent);
  color: var(--text-on-accent);
  line-height: 1.4;
}

/* Heavy divider — 4px black rule */
.divider-heavy {
  border: none;
  height: var(--border-w-heavy);
  background: var(--border);
  margin: var(--space-lg) 0;
}

/* Thin divider */
.divider {
  border: none;
  height: 1px;
  background: var(--border-light);
  margin: var(--space-md) 0;
}

/* Container card — bordered panel with sharp corners */
.container-card {
  border: var(--border-w) solid var(--border);
  padding: var(--space-lg);
  position: relative;
  background: var(--surface);
}

/* Crop marks on container cards */
.crop-marks {
  position: relative;
}
.crop-marks::before,
.crop-marks::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.crop-marks::before {
  top: -4px;
  left: -4px;
  border-top: var(--border-w) solid var(--text-muted);
  border-left: var(--border-w) solid var(--text-muted);
}
.crop-marks::after {
  bottom: -4px;
  right: -4px;
  border-bottom: var(--border-w) solid var(--text-muted);
  border-right: var(--border-w) solid var(--text-muted);
}

/* Primary button — orange industrial */
.btn-primary {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  padding: 10px var(--space-md);
  background: var(--accent);
  color: var(--text-on-accent);
  text-decoration: none;
  border: var(--border-w) solid var(--accent);
  transition: background 0.15s ease, border-color 0.15s ease;
  line-height: 1.4;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Secondary button — bordered */
.btn-secondary {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  padding: 10px var(--space-md);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  border: var(--border-w) solid var(--border);
  transition: border-color 0.15s ease;
  line-height: 1.4;
}
.btn-secondary:hover {
  border-color: var(--accent);
}

/* Spec table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
}
.spec-table thead {
  background: var(--border-emphasis);
  color: var(--text);
}
.spec-table th,
.spec-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
}
.spec-table th {
  font-weight: 500;
}
.spec-table td {
  border-bottom: 1px solid var(--border-light);
  font-weight: 400;
  text-transform: none;
  color: var(--text-muted);
}

/* Spec list — square orange bullets */
.spec-list {
  list-style: none;
  padding: 0;
}
.spec-list li {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--text-muted);
  padding: var(--space-sm) 0 var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  line-height: 1.55;
}
.spec-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--accent);
}

/* Procedure list — numbered steps with mono counters */
.procedure-list {
  list-style: none;
  padding: 0;
  counter-reset: step;
}
.procedure-list li {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--text-muted);
  padding: var(--space-sm) 0 var(--space-sm) 40px;
  border-bottom: 1px solid var(--border-light);
  position: relative;
  counter-increment: step;
  line-height: 1.55;
}
.procedure-list li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  color: var(--accent);
  position: absolute;
  left: 0;
  top: var(--space-sm);
  letter-spacing: var(--track-wide);
}

/* Chevron link list */
.chevron-list {
  list-style: none;
  padding: 0;
}
.chevron-list li {
  border-bottom: 1px solid var(--border-light);
}
.chevron-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.chevron-list a:hover {
  color: var(--text);
}
.chevron-list a::after {
  content: '>>>';
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: var(--track-wide);
}


/* === LAYOUT === */

/* Page shell */
.page-shell {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Site header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--space-md);
  border-bottom: var(--border-w-heavy) solid var(--border-emphasis);
  margin-bottom: var(--space-xl);
  gap: var(--space-md);
}
.site-header a {
  text-decoration: none;
}

/* Site footer */
.site-footer {
  border-top: var(--border-w-heavy) solid var(--border-emphasis);
  padding-top: var(--space-md);
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--space-md);
}


/* === LANDING PAGE === */

.hero {
  padding: var(--space-lg) 0 var(--space-xl);
}
.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-md);
}
.hero-sub {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.project-index {
  padding: var(--space-lg) 0 var(--space-xl);
}
.project-index-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-lg);
}

.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: var(--space-lg);
  transition: border-color 0.2s ease;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(242, 101, 34, 0.08);
}
.project-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.project-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-h2);
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}
.project-card-desc {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--text-muted);
  max-width: 60ch;
  line-height: 1.55;
  margin-bottom: var(--space-md);
}
.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-sm);
}
.project-card-footer .chevron {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: var(--track-wide);
}


/* === PRODUCT PAGE === */

.product-hero {
  padding: var(--space-lg) 0;
}
.product-hero-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.product-tagline {
  font-family: var(--font-mono);
  font-size: var(--text-body);
  color: var(--text-muted);
  max-width: 55ch;
  margin-top: var(--space-md);
  line-height: 1.55;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  padding: var(--space-lg) 0 var(--space-xl);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.section-heading {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  border-bottom: var(--border-w) solid var(--border);
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-md);
}

.meta-line {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}


/* === DOCUMENT PAGES (Privacy, Support) === */

.document {
  max-width: 780px;
}
.document-header {
  margin-bottom: var(--space-lg);
}
.document-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-h1);
  line-height: 1.05;
  margin-bottom: var(--space-sm);
}
.document-subtitle {
  margin-bottom: var(--space-sm);
}
.document-meta {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

.document-section {
  margin-bottom: var(--space-lg);
}
.document-section p {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}
.document-section p:last-child {
  margin-bottom: 0;
}
.document-section strong {
  color: var(--text);
  font-weight: 500;
}

.document-actions {
  margin-bottom: var(--space-xl);
}

.section-num {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: var(--track-ultra);
  margin-right: var(--space-sm);
}


/* === SHOWCASE GALLERY === */

.showcase {
  padding: var(--space-xl) 0;
}

.showcase-hero {
  margin-bottom: var(--space-lg);
}

.showcase-hero + .showcase-grid {
  margin-top: 0;
}

.showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.showcase-item {
  border: var(--border-w) solid var(--border);
  background: var(--surface);
  position: relative;
}

.showcase-item-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

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

@media (max-width: 768px) {
  .showcase-grid {
    grid-template-columns: 1fr;
  }
}


/* === WATER TRAIL === */

.water-trail {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.water-trail canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

@media (max-width: 1024px) {
  .water-trail {
    display: none;
  }
}


/* === PRELOADER === */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.preloader__overlay {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.preloader__overlay--primary {
  background: var(--accent);
  z-index: 2;
}

.preloader__overlay--secondary {
  background: #1c1c20;
  z-index: 1;
}

.preloader__logo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.preloader__logo-text {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: var(--track-ultra);
}


/* === RESPONSIVE === */

@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    gap: var(--space-xs);
    align-items: flex-start;
  }

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

  .action-row {
    flex-direction: column;
  }
  .action-row .btn-primary,
  .action-row .btn-secondary {
    text-align: center;
  }

  .site-footer {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .hero-meta {
    flex-direction: column;
    gap: var(--space-xs);
  }
}

@media (max-width: 480px) {
  .container-card {
    padding: var(--space-md);
  }

  .crop-marks::before,
  .crop-marks::after {
    display: none;
  }

  .document-meta {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .project-index-meta {
    flex-direction: column;
    gap: var(--space-xs);
  }
}
