/* 
 * Nihonto Master CSS - Tokugawa Precision Design System
 * "Dark, restrained, precision-cut, with one accent color like a flash of hamon in the steel"
 * 
 * Design Philosophy: Tokugawa shōgun's study meets modern Apple store
 * - Monochromatic dark base (90-95%)
 * - Single vermilion accent (5-10%)
 * - Precision cuts and minimal animations
 * - Subtle steel-inspired textures
 */

/* ===== HAMON STEEL COLOR PALETTE ===== */
:root {
  /* Foundational Dark Palette - Forged Steel Inspiration */
  --bg-primary: #0D0D0D;      /* Charcoal black - forged steel base */
  --bg-surface: #1A1A1A;      /* Graphite gray - polished tang */
  --bg-card: #242428;         /* Iron gray - iron fittings */
  --bg-elevated: #2A2A2F;     /* Steel gray - raised elements */
  
  /* Typography Hierarchy - Burnished Metal */
  --text-primary: #E8E8E8;    /* Off-white - burnished paper */
  --text-secondary: #A0A0A5;  /* Cool gray - iron patina */
  --text-muted: #6A6A70;      /* Deep gray - shadow details */
  
  /* Structural Elements */
  --border: #323237;          /* Subtle gray - fine chisel marks */
  --border-light: #404047;    /* Lighter borders for elevation */
  
  /* Accent Colors - Hamon Flash */
  --accent-primary: #C03221;  /* Vermilion red - NBTHK stamp */
  --accent-dim: #8B2419;      /* Muted red - subdued hamon */
  --accent-glow: rgba(192, 50, 33, 0.2); /* Accent transparency */
  
  /* Shadows - Steel Depth */
  --shadow-minimal: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 2px 8px rgba(192, 50, 33, 0.3);
  
  /* Steel Gradients - Folded Metal */
  --gradient-card: linear-gradient(145deg, #242428 0%, #1F1F23 100%);
  --gradient-elevated: linear-gradient(145deg, #2A2A2F 0%, #252529 100%);
  --gradient-accent: linear-gradient(145deg, #C03221 0%, #A02A1B 100%);
  --gradient-hero: linear-gradient(135deg, #1A1A1A 0%, #0D0D0D 100%);
  
  /* Precision Spacing - 8px Base System */
  --space-xs: 4px;    /* 0.25rem */
  --space-sm: 8px;    /* 0.5rem */
  --space-md: 16px;   /* 1rem */
  --space-lg: 24px;   /* 1.5rem */
  --space-xl: 32px;   /* 2rem */
  --space-2xl: 48px;  /* 3rem */
  
  /* Layout Constraints */
  --container-max: 1200px;
  --card-min-width: 280px;
  --border-radius: 8px;       /* Sharp, minimal */
  --border-radius-sm: 4px;
  
  /* Blade Transitions - Swift and Precise */
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-standard: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== FOUNDATIONAL RESET ===== */
* { 
  box-sizing: border-box; 
  transition: var(--transition-fast);
}

html { 
  scroll-behavior: smooth; 
  font-size: 16px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  
  /* Subtle steel texture overlay */
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(192, 50, 33, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(192, 50, 33, 0.01) 0%, transparent 50%);
}

/* ===== TYPOGRAPHY HIERARCHY ===== */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-md) 0;
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { 
  font-size: clamp(2rem, 6vw, 3.5rem); 
  font-weight: 300;
  letter-spacing: -0.02em;
}

h2 { 
  font-size: clamp(1.5rem, 4vw, 2.25rem); 
}

h3 { 
  font-size: clamp(1.25rem, 3vw, 1.5rem); 
  font-weight: 500;
}

p {
  margin: 0 0 var(--space-md) 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

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

a:hover {
  color: var(--accent-primary);
}

.muted {
  color: var(--text-muted);
}

.lead {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== LAYOUT COMPONENTS ===== */
.container {
  max-width: var(--container-max);
  padding: 0 var(--space-lg);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
}

/* ===== HEADER - PRECISION NAVIGATION ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 13, 13, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.brand-mark {
  color: var(--accent-primary);
  filter: drop-shadow(0 2px 4px rgba(192, 50, 33, 0.4));
}

.nav-right {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-link {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius-sm);
  font-size: 0.875rem;
  opacity: 0.9;
  transition: var(--transition-fast);
}

.nav-link:hover {
  opacity: 1;
  background: rgba(192, 50, 33, 0.1);
}

.version-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 999px;
  background: var(--gradient-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ===== BUTTONS - BLADE-SHARP INTERACTIONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  left: -100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
  border-color: var(--accent-primary);
}

.btn.primary {
  background: var(--gradient-accent);
  border-color: var(--accent-dim);
  color: #FFFFFF;
  box-shadow: var(--shadow-accent);
}

.btn.primary:hover {
  background: linear-gradient(145deg, #D43B2A 0%, #B02419 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-medium), 0 0 16px rgba(192, 50, 33, 0.4);
}

.btn.primary:active {
  transform: translateY(0) scale(1);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-primary);
}

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

/* ===== HERO SECTION - COMMANDING PRESENCE ===== */
.hero {
  padding: 5rem 0 3rem;
  text-align: center;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 30% 20%, rgba(192, 50, 33, 0.05) 0%, transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(192, 50, 33, 0.03) 0%, transparent 60%);
  animation: float 30s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-8px) rotate(0.5deg); }
  66% { transform: translateY(4px) rotate(-0.5deg); }
}

.eyebrow {
  color: var(--accent-primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.75rem;
  margin: 0 0 var(--space-md) 0;
}

.hero h1 {
  margin: 0 0 var(--space-lg) 0;
}

.hero .lead {
  margin: 0 auto var(--space-2xl) auto;
  max-width: 750px;
}

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

/* ===== CARDS - PRECISION-CUT ELEMENTS ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-min-width), 1fr));
  gap: var(--space-lg);
}

.card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  box-shadow: 
    var(--shadow-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.03); /* Subtle steel shine */
  position: relative;
  overflow: hidden;
  transition: var(--transition-standard);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  left: -100%;
  background: linear-gradient(90deg, transparent, rgba(192, 50, 33, 0.08), transparent);
  transition: left 0.6s ease;
}

.card:hover::before {
  left: 100%;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 
    var(--shadow-strong),
    0 0 0 1px var(--accent-glow); /* Accent glow outline */
  border-color: var(--accent-primary);
}

.card .icon {
  font-size: 1.5rem;
  opacity: 0.9;
  margin-bottom: var(--space-sm);
}

.card h3 {
  margin: var(--space-sm) 0 var(--space-xs) 0;
  color: var(--text-primary);
  font-size: 1.125rem;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== SECTIONS - STRUCTURED HIERARCHY ===== */
.features {
  padding: 4rem 0;
}

.features h2 {
  text-align: center;
  margin: 0 0 var(--space-sm) 0;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: 0 auto var(--space-2xl) auto;
  max-width: 600px;
}

.cta {
  padding: 2rem 0 3rem;
  text-align: center;
}

/* ===== FAQ SECTION - EXPANDABLE WISDOM ===== */
.faqs {
  padding: 1.5rem 0 3rem;
}

.faq-list {
  display: grid;
  gap: var(--space-sm);
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-minimal);
  transition: var(--transition-standard);
}

.faq-item[open] {
  background: var(--bg-elevated);
  border-color: var(--accent-primary);
}

.faq-item > summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-md) var(--space-lg);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: var(--transition-fast);
}

.faq-item > summary::-webkit-details-marker {
  display: none;
}

.faq-item > summary:hover {
  background: rgba(192, 50, 33, 0.05);
}

.faq-item > summary .arrow {
  margin-left: auto;
  width: 10px;
  height: 10px;
  border: 2px solid var(--text-secondary);
  border-left: none;
  border-top: none;
  transform: rotate(45deg);
  transition: var(--transition-fast);
  opacity: 0.7;
}

.faq-item[open] > summary .arrow {
  transform: rotate(225deg);
  border-color: var(--accent-primary);
}

.answer {
  padding: 0 var(--space-lg) var(--space-md);
  color: var(--text-secondary);
}

.answer p {
  margin: 0;
}

/* ===== FOOTER - MINIMAL CLOSURE ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.footer-nav {
  display: inline-flex;
  gap: var(--space-md);
}

/* ===== RESPONSIVE DESIGN - ADAPTIVE PRECISION ===== */
@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-md);
  }
  
  .nav {
    padding: var(--space-sm) var(--space-md);
  }
  
  .nav-right {
    gap: var(--space-sm);
  }
  
  .nav-link {
    display: none;
  }
  
  .hero {
    padding: 4rem 0 2rem;
  }
  
  .features {
    padding: 2rem 0;
  }
  
  .grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .actions {
    flex-direction: column;
    align-items: center;
  }
  
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .container {
    padding: 0 var(--space-xl);
  }
  
  .hero {
    padding: 4.5rem 0 2.5rem;
  }
  
  .features {
    padding: 3rem 0;
  }
}

/* ===== ACCESSIBILITY & PERFORMANCE ===== */
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  
  .site-header,
  .site-footer {
    box-shadow: none;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  .btn {
    border: 1px solid #000;
  }
}

/* ===== SUBTLE ENHANCEMENTS ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  background: var(--bg-elevated);
  color: var(--accent-primary);
  padding: 2px 4px;
  border-radius: var(--border-radius-sm);
  font-size: 0.875em;
}

::selection {
  background: var(--accent-glow);
  color: var(--text-primary);
}
