/* DRIFTER — Nordic minimalist pastel theme */

:root {
  --bg: #f7f6f3;
  --bg-alt: #efece6;
  --surface: #ffffff;
  --text: #2b2b2b;
  --text-muted: #7a7a7a;
  --accent: #a8c5b8;
  --accent-2: #d4a8b5;
  --accent-3: #b8c5d4;
  --accent-4: #e8d5b8;
  --border: #e4e1db;
  --shadow: 0 2px 12px rgba(0,0,0,0.04);
  --radius: 12px;
  --max-width: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247,246,243,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 2rem;
}

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

nav .logo {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
}

nav .logo svg {
  width: 24px;
  height: 24px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.8rem;
}

nav ul a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.2s;
}

nav ul a:hover { color: var(--text); }

@media (max-width: 768px) {
  nav ul { display: none; }
}

/* HERO */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.2rem;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero .badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-cta a {
  padding: 0.8rem 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.hero-cta a.primary {
  background: var(--text);
  color: var(--surface);
}

.hero-cta a.primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.hero-cta a.secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
}

.hero-cta a.secondary:hover {
  border-color: var(--accent);
}

/* SECTIONS */
section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}

section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

section .section-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2.5rem;
}

/* CONCEPT CARDS */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.2s;
}

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

.card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.card .icon svg { width: 24px; height: 24px; }

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* DIAGRAMS */
.diagram-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  overflow-x: auto;
}

.diagram-container svg {
  max-width: 100%;
  height: auto;
}

.diagram-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* TIER ARCHITECTURE */
.tier-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.tier {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.tier-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.tier-0 .tier-number { background: var(--accent); }
.tier-1 .tier-number { background: var(--accent-3); }
.tier-2 .tier-number { background: var(--accent-4); }

.tier h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.tier p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tier .tier-duty {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  white-space: nowrap;
}

/* COMPONENTS TABLE */
.components-section {
  background: var(--bg-alt);
  padding: 4rem 0;
}

.components-section .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.comp-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.comp-filter {
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}

.comp-filter.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.comp-filter:hover:not(.active) {
  border-color: var(--accent);
}

.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.comp-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s;
}

.comp-item:hover {
  box-shadow: var(--shadow);
}

.comp-item .comp-cat {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.comp-item h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.comp-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

.comp-item .comp-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comp-item .comp-price {
  font-size: 0.85rem;
  font-weight: 600;
}

.comp-item .comp-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.comp-item .comp-link:hover {
  text-decoration: underline;
}

/* BOM TABLE */
.bom-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.bom-table th {
  background: var(--bg-alt);
  padding: 0.8rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.bom-table td {
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.bom-table tr:last-child td { border-bottom: none; }

.bom-table tr:hover { background: var(--bg-alt); }

.bom-table .bom-total td {
  font-weight: 700;
  background: var(--bg-alt);
  font-size: 1rem;
}

/* BUILD PHASES */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.phase {
  position: relative;
  padding-bottom: 2.5rem;
}

.phase::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
}

.phase h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.phase .phase-time {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.6rem;
  display: block;
}

.phase p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* POWER BUDGET */
.power-bar {
  display: flex;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

.power-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.power-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.power-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.power-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* RISK TABLE */
.risk-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.risk-table th {
  background: var(--bg-alt);
  padding: 0.8rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.risk-table td {
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.risk-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.risk-high { background: #f8d7d7; color: #c0392b; }
.risk-medium { background: #fff3d7; color: #b7950b; }
.risk-low { background: #d7f8e0; color: #27ae60; }

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 4rem;
}

footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

footer .footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1rem;
}

footer .footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

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

/* ANIMATIONS */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* SCROLL INDICATOR */
.scroll-hint {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* MOBILE */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  section { padding: 3rem 1.5rem; }
  .tier { flex-direction: column; align-items: flex-start; }
  .tier .tier-duty { margin-left: 0; }
  .comp-grid { grid-template-columns: 1fr; }
  .bom-table, .risk-table { font-size: 0.8rem; }
  .bom-table td, .risk-table td { padding: 0.6rem 0.5rem; }
}