/* ═══════════════════════════════════════════════════════════
   FRONTIER ETHICS — Critical Classicism Design System
   Deep void · Burgundy accent · Cinzel/Cormorant/Supreme
   Matched to feajch.com HP design tokens
   ═══════════════════════════════════════════════════════════ */

/* ── Design Tokens (HP-aligned) ── */
:root {
  /* Void / Background layers */
  --fe-void:          #0c0b0f;
  --fe-void-warm:     #100f13;
  --fe-surface:       #141218;
  --fe-surface-2:     #1a1820;
  --fe-surface-3:     #201e28;

  /* Text hierarchy */
  --fe-primary:       #ddd9d1;
  --fe-secondary:     rgba(221,217,209,0.62);
  --fe-tertiary:      rgba(221,217,209,0.38);
  --fe-ghost:         rgba(221,217,209,0.18);

  /* Accent colors */
  --fe-burgundy:      #7a2d3a;
  --fe-burgundy-lt:   #a04050;
  --fe-burgundy-dim:  rgba(122,45,58,0.18);
  --fe-gold:          #c8a96e;
  --fe-gold-dim:      rgba(200,169,110,0.15);

  /* Rules & Borders */
  --fe-rule:          rgba(221,217,209,0.06);
  --fe-rule-md:       rgba(221,217,209,0.12);
  --fe-rule-strong:   rgba(221,217,209,0.22);
  --fe-rule-accent:   rgba(122,45,58,0.15);
  --fe-rule-accent-md:rgba(122,45,58,0.30);

  /* Status */
  --fe-success:       #4ade80;
  --fe-warning:       #fbbf24;
  --fe-error:         #f87171;
  --fe-info:          #67e8f9;

  /* Typography */
  --font-display:     "Cinzel", "Trajan Pro 3", "Times New Roman", serif;
  --font-subtitle:    "Cormorant Garamond", "EB Garamond", "Georgia", serif;
  --font-ui:          "Inter", system-ui, sans-serif;
  --font-body:        "Noto Sans JP", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  --font-mono:        "JetBrains Mono", "Fira Code", monospace;

  /* Type scale */
  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-md:    1.0625rem;
  --text-lg:    1.1875rem;
  --text-xl:    1.375rem;
  --text-2xl:   1.75rem;
  --text-3xl:   2.25rem;

  /* Leading */
  --leading-tight:    1.2;
  --leading-snug:     1.45;
  --leading-normal:   1.65;
  --leading-relaxed:  1.9;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Motion */
  --duration-fast:   120ms;
  --duration-normal: 240ms;
  --duration-slow:   480ms;
  --ease-out:        cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:     cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --fe-shadow-sm:   0 1px 3px rgba(0,0,0,0.5);
  --fe-shadow-md:   0 4px 12px rgba(0,0,0,0.6);
  --fe-shadow-lg:   0 8px 32px rgba(0,0,0,0.7);
  --fe-shadow-glow: 0 0 24px rgba(122,45,58,0.15);
}

/* ── Base Reset ── */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--fe-primary);
  background: var(--fe-void);
  margin: 0;
  padding: 0;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: var(--leading-tight);
  color: var(--fe-primary);
}

h1 { font-size: var(--text-3xl); font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); font-weight: 500; }
h5 { font-size: var(--text-md); }

p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--fe-secondary);
  margin-bottom: var(--space-4);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--fe-void); }
::-webkit-scrollbar-thumb { background: var(--fe-rule-strong); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--fe-tertiary); }

/* ── Selection ── */
::selection {
  background: var(--fe-burgundy-dim);
  color: var(--fe-primary);
}

/* ── Focus ── */
:focus-visible {
  outline: 1px solid var(--fe-burgundy);
  outline-offset: 2px;
}

/* ── Animations ── */
@keyframes fe-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fe-slide-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fe-glow-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(122,45,58,0.25), 0 0 20px rgba(122,45,58,0.08); }
  50%      { box-shadow: 0 0 16px rgba(122,45,58,0.45), 0 0 40px rgba(122,45,58,0.18); }
}

@keyframes fe-ambient-drift {
  0%   { background-position: 20% 30%; }
  33%  { background-position: 70% 60%; }
  66%  { background-position: 40% 20%; }
  100% { background-position: 20% 30%; }
}

@keyframes fe-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fe-animate-in { animation: fe-fade-in var(--duration-slow) var(--ease-out) both; }
.fe-animate-slide { animation: fe-slide-in 0.4s var(--ease-out) both; }

/* ── Ambient section glow ── */
.fe-section-ambient { position: relative; }
.fe-section-ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 600px 400px at 20% 30%, rgba(122,45,58,0.03) 0%, transparent 70%),
    radial-gradient(ellipse 500px 350px at 70% 60%, rgba(200,169,110,0.02) 0%, transparent 70%);
  background-size: 200% 200%;
  animation: fe-ambient-drift 30s ease-in-out infinite;
  z-index: 0;
}
.fe-section-ambient > * { position: relative; z-index: 1; }

/* ── Film grain texture overlay ── */
.fe-grain::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.018;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
