/* =====================================================
   SHOPSTEAD — Design System & Base Styles
   ===================================================== */

/* Design tokens */
:root {
  /* Surfaces */
  --surface-deep: #0d0f14;
  --surface-dark: #12151c;
  --surface-mid: #1a1d27;
  --surface-light: #f7f6f3;
  --surface-warm: #f0efe9;

  /* Accent */
  --accent: #c87a30;
  --accent-hover: #db8f3d;
  --accent-dim: rgba(200, 122, 48, 0.15);

  /* State */
  --state-defect: #c95544;
  --state-defect-dim: rgba(201, 85, 68, 0.12);
  --state-good: #46956e;
  --state-good-dim: rgba(70, 149, 110, 0.12);
  --state-neutral: #6b7080;

  /* Text — dark backgrounds */
  --text-on-dark: #e4e1db;
  --text-muted-dark: #8a8880;
  --text-dim-dark: #5c5b56;

  /* Text — light backgrounds */
  --text-on-light: #141518;
  --text-muted-light: #636260;
  --text-dim-light: #949390;

  /* Lines */
  --line-dark: rgba(228, 225, 219, 0.08);
  --line-mid: rgba(228, 225, 219, 0.15);
  --line-strong: rgba(228, 225, 219, 0.25);
  --line-light: rgba(20, 21, 24, 0.08);
  --line-mid-light: rgba(20, 21, 24, 0.15);

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;

  /* Modular scale 1.25 */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.953rem;   /* 31px */
  --text-4xl: 2.441rem;   /* 39px */
  --text-5xl: 3.052rem;   /* 49px */

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 720px;
  --nav-height: 64px;
  --radius-sm: 4px;
  --radius-md: 8px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
  }
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: break-word;
  overflow-wrap: break-word;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: 1000;
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface-deep);
  color: var(--text-on-dark);
  font-size: var(--text-sm);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--duration-fast);
}
.skip-link:focus {
  top: 0;
  outline: none;
}

/* =====================================================
   Typography
   ===================================================== */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  word-break: normal;
  overflow-wrap: normal;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin-bottom: var(--sp-5); max-width: 65ch; }
p:last-child { margin-bottom: 0; }

.label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Monospace annotations */
.annotation {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}

/* =====================================================
   Layout
   ===================================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--sp-5);
  width: 100%;
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: var(--sp-9) 0;
}

.section + .section {
  border-top: 1px solid var(--line-mid);
}

.section--light {
  background: var(--surface-light);
  color: var(--text-on-light);
}
.section--light + .section--light {
  border-top-color: var(--line-mid-light);
}

.section--dark {
  background: var(--surface-deep);
  color: var(--text-on-dark);
}

/* =====================================================
   Buttons
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-2) var(--sp-6);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
  white-space: nowrap;
  min-height: 44px;
  text-align: center;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--outline {
  background: transparent;
  color: var(--text-muted-dark);
  border-color: var(--line-mid);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }

.btn--outline-light {
  background: transparent;
  color: var(--text-muted-light);
  border-color: var(--line-mid-light);
}
.btn--outline-light:hover { border-color: var(--accent); color: var(--accent); }

/* =====================================================
   Navigation
   ===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-dark);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.wordmark {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-on-dark);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  list-style: none;
}

.nav-link {
  color: var(--text-muted-dark);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--duration-fast);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--sp-2);
}
.nav-link:hover, .nav-link--active { color: var(--text-on-dark); }

.nav-cta {
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--sp-2);
}
.nav-cta:hover { color: var(--accent-hover); }

/* Nav toggle (mobile) */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-on-dark);
  padding: var(--sp-2);
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-list {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface-deep);
    border-bottom: 1px solid var(--line-dark);
    flex-direction: column;
    padding: var(--sp-4) var(--sp-5);
    gap: 0;
  }
  .nav-list.is-open { display: flex; }
  .nav-list li a {
    display: flex;
    padding: var(--sp-3) var(--sp-2);
    border-radius: var(--radius-sm);
  }
  .nav-list li a:hover { background: rgba(228, 225, 219, 0.04); }
}

/* =====================================================
   Footer
   ===================================================== */
.site-footer {
  background: var(--surface-deep);
  color: var(--text-muted-dark);
  padding: var(--sp-7) 0;
  border-top: 1px solid var(--line-dark);
  font-size: var(--text-sm);
}

/* =====================================================
   Page header pattern
   ===================================================== */
.page-header {
  padding: var(--sp-9) 0 var(--sp-7);
  background: var(--surface-deep);
  color: var(--text-on-dark);
  border-bottom: 1px solid var(--line-dark);
  position: relative;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 122, 48, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
.page-header h1 {
  margin-bottom: var(--sp-4);
}
.page-header .label {
  color: var(--accent);
  margin-bottom: var(--sp-4);
  display: block;
}
.page-header p {
  color: var(--text-muted-dark);
  font-size: var(--text-lg);
  max-width: 55ch;
}

/* =====================================================
   State markers
   ===================================================== */
.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.state-dot--defect { background: var(--state-defect); }
.state-dot--good { background: var(--state-good); }
.state-dot--neutral { background: var(--state-neutral); }

/* =====================================================
   Responsive text
   ===================================================== */
@media (max-width: 768px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-2xl); }
  .section { padding: var(--sp-7) 0; }
  .container { padding: 0 var(--sp-4); }
}

@media (max-width: 400px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-xl); }
  .container { padding: 0 var(--sp-3); }
  .section { padding: var(--sp-6) 0; }
}

@media (max-width: 340px) {
  .container { padding: 0 var(--sp-2); }
  .section { padding: var(--sp-5) 0; }
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-lg); }
}

@media (min-width: 1440px) {
  :root { --container-max: 1280px; }
}

@media (min-width: 2500px) {
  :root { font-size: 18px; --container-max: 1400px; }
}

/* =====================================================
   ENHANCED VISUAL STYLING
   ===================================================== */

/* Hero enhancement */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 70% 50%, rgba(200, 122, 48, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 30% 80%, rgba(70, 149, 110, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.hero { position: relative; overflow: hidden; }
.hero-inner { position: relative; z-index: 1; }

/* Hero typography enhancement */
.hero h1 {
  font-size: clamp(2rem, 4vw + 1rem, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

@media (max-width: 600px) {
  .hero h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); }
}

/* Method preview — enhanced grid */
.method-preview {
  background: var(--surface-mid);
}

.method-stage {
  position: relative;
  transition: background var(--duration-fast);
}
.method-stage:hover {
  background: rgba(228, 225, 219, 0.03);
}

.method-stage::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  bottom: 25%;
  width: 1px;
  background: var(--line-dark);
}
.method-stage:last-child::after { display: none; }

.method-stage .annotation {
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
}

/* Difference items — enhanced hover */
.difference-item {
  position: relative;
  overflow: hidden;
}

.difference-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--accent);
  transition: height var(--duration-base) var(--ease-out);
}
.difference-item:hover::before {
  height: 100%;
}

/* Page header — subtle accent line */
.page-header::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin-top: var(--sp-5);
  border-radius: 2px;
}

/* CTA band — subtle background */
.cta-band {
  position: relative;
}
.cta-band::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 122, 48, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* Footer link style */
.site-footer a {
  color: var(--text-muted-dark);
  transition: color var(--duration-fast);
}
.site-footer a:hover {
  color: var(--accent);
}

/* Selection color */
::selection {
  background: rgba(200, 122, 48, 0.25);
  color: var(--text-on-dark);
}

/* Scrollbar styling for Webkit */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--surface-deep); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* =====================================================
   Responsive CTA geometry
   Keep the decorative radial gradient inside narrow viewports
   ===================================================== */
@media (max-width: 600px) {
  .cta-band::before {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
}
@media (max-width: 400px) {
  .cta-band::before {
    width: 280px;
    height: 280px;
  }
}

/* Accessible persistent navigation targets */
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.skip-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.skip-link:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
