/* ============================================================
   OpenKode — Design System
   Palette extracted from brand logo:
     #0A0A0A  near-black (bg)
     #C07020  copper/orange (brand accent)
     #CCCCCC  light gray (subtle accents)
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

/* ── Custom Properties ── */
:root {
  /* Colors — derived from logo */
  --color-bg:            #0A0A0A;
  --color-brand:         #C07020;
  --color-brand-light:   #D4853A;
  --color-brand-dark:    #A05C18;
  --color-surface:       #141414;
  --color-surface-alt:   #1A1A1A;
  --color-border:        #2A2A2A;
  --color-text:          #E6E6E6;
  --color-text-secondary:#999999;
  --color-text-muted:    #666666;
  --color-gray-light:    #CCCCCC;

  /* Typography */
  --font-mono: 'IBM Plex Mono', 'JetBrains Mono', 'Consolas', 'Menlo', monospace;
  --font-sans: 'IBM Plex Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing scale */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --max-width:     72rem;
  --header-height: 4rem;
  --border-radius: 4px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image:
    linear-gradient(rgba(192, 112, 32, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192, 112, 32, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: center center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-brand);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-brand-light);
}

/* ── Focus — visible, accessible ── */
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-brand);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  z-index: 1000;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  border-radius: var(--border-radius);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-sm);
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.header-logo img {
  height: 2rem;
  width: auto;
}

.header-logo span {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

/* ── Navigation ── */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-sm);
}

.main-nav a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: var(--border-radius);
  transition: color var(--transition-fast), background var(--transition-fast);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0.25rem;
  left: var(--space-md);
  right: var(--space-md);
  height: 1.5px;
  background: var(--color-brand);
  transform: scaleX(0);
  transform-origin: left;
}

@media (prefers-reduced-motion: no-preference) {
  .main-nav a::after {
    transition: transform var(--transition-base);
  }
}

.main-nav a:hover {
  color: var(--color-brand);
  background: transparent;
}

.main-nav a:hover::after {
  transform: scaleX(1);
}

.main-nav a[aria-current="page"] {
  color: var(--color-brand);
  background: rgba(192, 112, 32, 0.08);
}

/* ── Mobile nav toggle ── */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
}

.nav-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.nav-toggle svg {
  display: block;
}

/* ── Main Content ── */
.site-main {
  flex: 1;
}

/* ── Hero (Home "Under Construction") ── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - var(--header-height) - 4rem);
  padding: var(--space-3xl) var(--space-lg);
}

.hero-logo {
  max-width: 320px;
  width: 100%;
  margin-bottom: var(--space-2xl);
  filter: drop-shadow(0 0 30px rgba(192, 112, 32, 0.15));
  animation: fadeInUp 0.8s ease both;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-md);
  animation: fadeInUp 0.8s ease 0.12s both;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  letter-spacing: -0.02em;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--color-text-secondary);
  max-width: 36rem;
  margin-bottom: var(--space-2xl);
  line-height: 1.7;
  animation: fadeInUp 0.8s ease 0.3s both;
}

/* ── Hero Progress Bar ── */
.hero-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-progress-bar {
  width: 16rem;
  max-width: 80vw;
  height: 3px;
  background: var(--color-border);
  border-radius: 9999px;
  overflow: hidden;
}

.hero-progress-fill {
  height: 100%;
  width: 35%;
  background: var(--color-brand);
  border-radius: 9999px;
  position: relative;
}

.hero-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 40%,
    rgba(255, 255, 255, 0.15) 60%,
    transparent 100%
  );
  transform: translateX(-100%);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-progress-fill::after {
    animation: shimmer 3s ease-in-out infinite;
  }
}

.hero-progress-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

/* ── Page Section (subpages) ── */
.page-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4xl) var(--space-lg);
}

.page-heading {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: var(--space-lg);
}

.page-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--color-brand);
}

.page-description {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 40rem;
  line-height: 1.7;
}

/* ── Section heading (sub-page sub-sections) ── */
.section-heading {
  font-family: var(--font-mono);
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2xl);
  letter-spacing: -0.02em;
  padding-bottom: var(--space-md);
  position: relative;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2rem;
  height: 2px;
  background: var(--color-brand);
}

/* ── Placeholder section ── */
.placeholder-card {
  margin-top: var(--space-2xl);
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-3xl);
  text-align: center;
}

.placeholder-card svg {
  width: 48px;
  height: 48px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.placeholder-card h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.placeholder-card p {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* ── Product cards (future-ready structure) ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  transition: border-color var(--transition-base), transform var(--transition-base);
}

.product-card:hover {
  border-color: var(--color-brand);
  transform: translateY(-2px);
}

.product-card-icon {
  width: 40px;
  height: 40px;
  color: var(--color-brand);
  margin-bottom: var(--space-md);
}

.product-card h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.product-card p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.product-card .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  padding: 2px 8px;
  border-radius: var(--border-radius);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.product-card .tag.future {
  color: var(--color-brand);
  background: rgba(192, 112, 32, 0.1);
}

/* ── Contact info ── */
.contact-list {
  list-style: none;
  margin-top: var(--space-2xl);
  display: grid;
  gap: var(--space-lg);
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.contact-list svg {
  width: 24px;
  height: 24px;
  color: var(--color-brand);
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-list dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.contact-list dd {
  color: var(--color-text-secondary);
  font-size: 1rem;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: var(--space-2xl) var(--space-lg);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-brand);
}

/* ── Footer Build Version ── */
.footer-build {
  position: fixed;
  bottom: 1rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
  z-index: 10;
  pointer-events: none;
}

.footer-build:hover {
  opacity: 0.8;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(285%); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md);
  }

  .main-nav.open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav a {
    padding: var(--space-md);
    font-size: 0.875rem;
    border-radius: var(--border-radius);
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
  }

  .page-section {
    padding: var(--space-2xl) var(--space-lg);
  }

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

@media (max-width: 480px) {
  .hero-logo {
    max-width: 240px;
  }

  .header-logo span {
    font-size: 1rem;
  }

  .header-inner {
    padding: 0 var(--space-md);
  }

  .page-section {
    padding: var(--space-xl) var(--space-md);
  }
}

/* ── Utility: sr-only ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
