/* ========== DESIGN TOKENS ========== */
@import url('https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600,700&f[]=zodiak@400,500,700&display=swap');

:root, [data-theme="light"] {
  --font-display: 'Zodiak', Georgia, serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;

  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

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

  --color-bg:             #f7f6f2;
  --color-surface:        #f9f8f5;
  --color-surface-2:      #fbfbf9;
  --color-surface-offset: #f0ede8;
  --color-divider:        #dcd9d5;
  --color-border:         #d4d1ca;
  --color-text:           #28251d;
  --color-text-muted:     #7a7974;
  --color-text-faint:     #bab9b4;
  --color-text-inverse:   #f9f8f4;
  --color-primary:        #01696f;
  --color-primary-hover:  #0c4e54;
  --color-primary-highlight: #cedcd8;
  --color-success:        #437a22;
  --color-error:          #a13544;
  --color-warning:        #964219;
  --color-gold:           #d19900;

  --radius-sm: 0.375rem; --radius-md: 0.5rem;
  --radius-lg: 0.75rem;  --radius-xl: 1rem;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.12);
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

[data-theme="dark"] {
  --color-bg:             #171614;
  --color-surface:        #1c1b19;
  --color-surface-2:      #201f1d;
  --color-surface-offset: #1d1c1a;
  --color-divider:        #262523;
  --color-border:         #393836;
  --color-text:           #cdccca;
  --color-text-muted:     #797876;
  --color-text-faint:     #5a5957;
  --color-text-inverse:   #2b2a28;
  --color-primary:        #4f98a3;
  --color-primary-hover:  #227f8b;
  --color-primary-highlight: #313b3b;
  --color-success:        #6daa45;
  --color-error:          #dd6974;
  --color-warning:        #bb653b;
  --color-gold:           #e8af34;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #171614; --color-surface: #1c1b19; --color-surface-2: #201f1d;
    --color-surface-offset: #1d1c1a; --color-divider: #262523; --color-border: #393836;
    --color-text: #cdccca; --color-text-muted: #797876; --color-text-faint: #5a5957;
    --color-text-inverse: #2b2a28; --color-primary: #4f98a3; --color-primary-hover: #227f8b;
    --color-primary-highlight: #313b3b; --color-success: #6daa45; --color-error: #dd6974;
    --color-warning: #bb653b; --color-gold: #e8af34;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
  }
}

/* ========== GLOBAL ========== */
body { font-family: var(--font-body); }

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

.container { width: 100%; max-width: var(--content-wide); margin: 0 auto; padding: 0 var(--space-6); }
.container--narrow { max-width: var(--content-default); }

/* ========== HEADER ========== */
.header {
  position: sticky; top: 0; z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
  transition: box-shadow 0.3s ease;
}
.header--scrolled { box-shadow: var(--shadow-sm); }
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: var(--content-wide); margin: 0 auto;
  padding: 0 var(--space-6);
}
.header__logo {
  display: flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-lg); color: var(--color-text);
  text-decoration: none; white-space: nowrap;
}
.header__logo svg { flex-shrink: 0; }
.header__nav { display: flex; align-items: center; gap: var(--space-6); }
.header__nav a {
  font-size: var(--text-sm); color: var(--color-text-muted);
  text-decoration: none; font-weight: 500;
  transition: color var(--transition-interactive);
}
.header__nav a:hover { color: var(--color-text); }
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: background var(--transition-interactive), color var(--transition-interactive);
}
.theme-toggle:hover { background: var(--color-surface-offset); color: var(--color-text); }

/* ========== HERO ========== */
.hero {
  padding: clamp(var(--space-16), 10vw, var(--space-32)) 0 clamp(var(--space-12), 6vw, var(--space-20));
  text-align: center;
}
.hero__badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  background: var(--color-primary-highlight);
  border-radius: var(--radius-xl);
  font-size: var(--text-xs); font-weight: 600; color: var(--color-primary);
  margin-bottom: var(--space-6);
}
.hero__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-3xl); line-height: 1.08;
  color: var(--color-text); max-width: 16ch; margin: 0 auto var(--space-6);
}
.hero__subtitle {
  font-size: var(--text-base); color: var(--color-text-muted);
  max-width: 52ch; margin: 0 auto var(--space-8); line-height: 1.7;
}
.hero__image {
  max-width: 720px; margin: 0 auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.hero__image img { width: 100%; display: block; }

/* ========== SECTIONS ========== */
.section {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) 0;
}
.section--alt { background: var(--color-surface); }
.section__label {
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-primary); margin-bottom: var(--space-3);
}
.section__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-xl); color: var(--color-text);
  margin-bottom: var(--space-8);
}
.section__desc {
  font-size: var(--text-base); color: var(--color-text-muted);
  max-width: 60ch; margin-bottom: var(--space-10); line-height: 1.7;
}

/* ========== DATA GRID ========== */
.data-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}
.data-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}
.data-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.data-card__value {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-xl); color: var(--color-primary);
  font-feature-settings: 'tnum'; margin-bottom: var(--space-2);
}
.data-card__label {
  font-size: var(--text-sm); font-weight: 600; color: var(--color-text);
  margin-bottom: var(--space-2);
}
.data-card__desc {
  font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.6;
}
.data-card__source {
  font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-3);
}
.data-card__source a { color: var(--color-primary); font-size: var(--text-xs); }

/* ========== CASE CARDS ========== */
.case-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
}
.case-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  position: relative;
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}
.case-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.case-card__tag {
  display: inline-block; padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-xl); font-size: var(--text-xs); font-weight: 600;
  margin-bottom: var(--space-4);
}
.case-card__tag--success { background: oklch(from var(--color-success) l c h / 0.15); color: var(--color-success); }
.case-card__tag--fail { background: oklch(from var(--color-error) l c h / 0.15); color: var(--color-error); }
.case-card__name {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-lg); color: var(--color-text); margin-bottom: var(--space-1);
}
.case-card__product {
  font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-4);
}
.case-card__metric {
  display: flex; align-items: baseline; gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.case-card__metric-value {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-lg); color: var(--color-primary);
  font-feature-settings: 'tnum';
}
.case-card__metric-label {
  font-size: var(--text-xs); color: var(--color-text-muted);
}
.case-card__detail {
  font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.7;
}
.case-card__lesson {
  margin-top: var(--space-4); padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
  font-size: var(--text-xs); color: var(--color-text-muted);
  font-style: italic; line-height: 1.6;
}

/* ========== INSIGHT BLOCKS ========== */
.insight-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6);
}
@media (max-width: 768px) { .insight-grid { grid-template-columns: 1fr; } }

.insight-block {
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.insight-block--hype { background: oklch(from var(--color-error) l c h / 0.06); }
.insight-block--real { background: oklch(from var(--color-success) l c h / 0.06); }
.insight-block__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-lg); margin-bottom: var(--space-4);
}
.insight-block--hype .insight-block__title { color: var(--color-error); }
.insight-block--real .insight-block__title { color: var(--color-success); }
.insight-block__list {
  list-style: none; display: flex; flex-direction: column; gap: var(--space-3);
}
.insight-block__list li {
  font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6;
  padding-left: var(--space-6); position: relative;
}
.insight-block__list li::before {
  position: absolute; left: 0; top: 2px; font-size: var(--text-sm);
}
.insight-block--hype .insight-block__list li::before { content: '✕'; color: var(--color-error); font-weight: 700; }
.insight-block--real .insight-block__list li::before { content: '✓'; color: var(--color-success); font-weight: 700; }

/* ========== PATTERN TABLE ========== */
.pattern-table {
  width: 100%; border-collapse: collapse;
  background: var(--color-surface-2);
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--color-border);
}
.pattern-table th, .pattern-table td {
  padding: var(--space-4) var(--space-6);
  text-align: left; font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-divider);
}
.pattern-table th {
  font-weight: 600; color: var(--color-text);
  background: var(--color-surface-offset);
  font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pattern-table td { color: var(--color-text-muted); line-height: 1.6; }
.pattern-table tr:last-child td { border-bottom: none; }

/* ========== CALLOUT ========== */
.callout {
  background: var(--color-surface);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: var(--space-8);
  margin: var(--space-10) 0;
}
.callout__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-lg); color: var(--color-text); margin-bottom: var(--space-3);
}
.callout__text {
  font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.7;
}

/* ========== FOOTER ========== */
.footer {
  padding: var(--space-12) 0 var(--space-8);
  border-top: 1px solid var(--color-divider);
}
.footer__inner {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: center; gap: var(--space-4);
}
.footer__left { display: flex; flex-direction: column; gap: var(--space-2); }
.footer__brand {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-base); color: var(--color-text);
}
.footer__copy { font-size: var(--text-xs); color: var(--color-text-faint); }
.footer__links { display: flex; gap: var(--space-6); flex-wrap: wrap; }
.footer__links a { font-size: var(--text-xs); color: var(--color-text-muted); }
.footer__links a:hover { color: var(--color-primary); }

/* ========== SCROLL REVEAL ========== */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ========== LANGUAGE SWITCHER ========== */
.lang-switcher {
  position: relative; display: inline-flex; align-items: center;
}
.lang-switcher__btn {
  display: flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  font-size: var(--text-xs); font-weight: 500;
  color: var(--color-text-muted); cursor: pointer;
  transition: background var(--transition-interactive), color var(--transition-interactive);
  white-space: nowrap;
}
.lang-switcher__btn:hover { background: var(--color-surface-offset); color: var(--color-text); }
.lang-switcher__btn svg { flex-shrink: 0; transition: transform 0.2s ease; }
.lang-switcher.open .lang-switcher__btn svg { transform: rotate(180deg); }
.lang-switcher__menu {
  position: absolute; top: calc(100% + var(--space-2)); right: 0;
  min-width: 140px; padding: var(--space-2) 0;
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 60;
}
.lang-switcher.open .lang-switcher__menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.lang-switcher__menu a {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs); color: var(--color-text-muted);
  text-decoration: none; white-space: nowrap;
  transition: background var(--transition-interactive), color var(--transition-interactive);
}
.lang-switcher__menu a:hover { background: var(--color-surface-offset); color: var(--color-text); }
.lang-switcher__menu a.active { color: var(--color-primary); font-weight: 600; }

/* ========== MOBILE NAV ========== */
.mobile-toggle { display: none; }
@media (max-width: 768px) {
  .header__logo { font-size: var(--text-sm); }
  .mobile-toggle { display: flex; }
  .header__nav {
    position: fixed; top: 64px; left: 0; right: 0;
    height: calc(100vh - 64px); height: calc(100dvh - 64px);
    flex-direction: column; align-items: flex-start;
    padding: var(--space-8) var(--space-6);
    background: var(--color-bg); gap: var(--space-6);
    opacity: 0; visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 40;
    overflow-y: auto;
  }
  .header__nav.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .header__nav a { font-size: var(--text-base); }
  .case-grid { grid-template-columns: 1fr; }
  .data-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .data-grid { grid-template-columns: 1fr; }
}
