@import url('./css/components/cards.css');
/* ═══════════════════════════════════════════════════════════
   THE AI RANK いわて · Editorial Archive
   — by Aqsh Inc., MMXXVI —
   Fonts: Bricolage Grotesque / Instrument Sans / Shippori Mincho B1 / JetBrains Mono
   ═══════════════════════════════════════════════════════════ */

:root {
  --paper: #F1ECE0;
  --paper-deep: #E6DDC9;
  --paper-shadow: #D9CFB7;
  --ink: #17130F;
  --ink-soft: #2A241E;
  --ink-muted: #5C5247;
  --ink-ghost: #958A7C;
  --accent: #8B2514;
  --accent-deep: #5C1A0E;
  --brass: #B18B4E;
  --brass-soft: #D1B680;
  --gold: #C9A14A;
  --highlight: #EFE6D1;
  --red-tint: #F5EBE3;

  --line: rgba(23, 19, 15, 0.18);
  --line-strong: rgba(23, 19, 15, 0.42);

  --font-display: "Bricolage Grotesque", "Shippori Mincho B1", sans-serif;
  --font-body: "Instrument Sans", "Shippori Mincho B1", sans-serif;
  --font-ja: "Shippori Mincho B1", "Instrument Sans", serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --easing: cubic-bezier(0.2, 0.8, 0.2, 1);
  --easing-out: cubic-bezier(0.16, 1, 0.3, 1);

  --gutter: clamp(20px, 5vw, 80px);
  --max-w: 1380px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-text-size-adjust: 100%;
}

img, svg { display: block; max-width: 100%; }
button { background: none; border: none; font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol, li { list-style: none; }

/* ─── Textures ─── */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  opacity: 0.065; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='1'/></svg>");
  /* animation: grainShift 7s steps(6) infinite; */ /* Stopped to improve performance */
}
@keyframes grainShift {
  0%  { transform: translate(0, 0); }
  10% { transform: translate(-2%, -3%); }
  20% { transform: translate(-4%, 2%); }
  30% { transform: translate(3%, -4%); }
  40% { transform: translate(-3%, 4%); }
  50% { transform: translate(-8%, -2%); }
  60% { transform: translate(4%, 0); }
  70% { transform: translate(0, 3%); }
  80% { transform: translate(-4%, -1%); }
  90% { transform: translate(2%, 6%); }
  100% { transform: translate(0, 0); }
}
.paper-noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(139, 37, 20, 0.035) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(177, 139, 78, 0.045) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(23, 19, 15, 0.03) 0%, transparent 70%);
}

/* ─── Scroll progress ─── */
.scroll-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--accent); z-index: 10001;
  transition: width 0.08s linear;
  box-shadow: 0 0 8px rgba(139, 37, 20, 0.35);
}

/* ─── Masthead ─── */
.masthead {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  display: grid; grid-template-columns: 1fr auto 1fr;
  padding: 14px var(--gutter); gap: 20px;
  background: rgba(241, 236, 224, 0.78);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0; transform: translateY(-100%);
  transition: opacity 0.6s var(--easing), transform 0.6s var(--easing);
}
.masthead.visible { opacity: 1; transform: translateY(0); }
.masthead-col { display: flex; align-items: center; gap: 10px; }
.masthead-col.left { justify-content: flex-start; }
.masthead-col.center { justify-content: center; }
.masthead-col.right { justify-content: flex-end; gap: 8px; }

.masthead-nav { display: flex; align-items: center; gap: 12px; }
.masthead-link {
  position: relative;
  letter-spacing: 0.18em;
  padding: 2px 0;
  color: var(--ink-soft);
  transition: color 0.2s;
  white-space: nowrap;
}
.masthead-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.28s var(--easing-out);
}
.masthead-link:hover { color: var(--accent); }
.masthead-link:hover::after { transform: scaleX(1); transform-origin: left; }
.masthead-sep { color: var(--ink-muted); }
.masthead .dim { color: var(--ink-muted); opacity: 0.7; }
.folio { font-weight: 500; color: var(--accent); }

/* ─── Language switcher ─── */
.lang-switch, .lang-switch-float {
  display: inline-flex; align-items: center; gap: 6px;
}
.lang-switch-float {
  position: fixed; top: 14px; right: 14px; z-index: 10005;
  background: rgba(241, 236, 224, 0.92);
  backdrop-filter: blur(6px);
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
}
.masthead .lang-switch { margin-right: 14px; }
.masthead.visible ~ .lang-switch-float { display: none; }

.lang-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-muted);
  padding: 3px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s;
  font-weight: 500;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.active {
  color: var(--accent);
  font-weight: 700;
  border-bottom: 1px solid var(--accent);
}
.lang-sep { color: var(--ink-ghost); font-family: var(--font-mono); font-size: 10px; }
@media (max-width: 780px) {
  .lang-btn { cursor: auto; }
}

/* ─── Typography utilities ─── */
.mono { font-family: var(--font-mono); letter-spacing: 0.08em; font-weight: 400; }
.mono.small { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
.dim { color: var(--ink-muted); }
.hairline { flex: 1; height: 1px; background: var(--line-strong); }

em {
  font-style: italic; color: var(--accent); font-weight: 500;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 30, "wdth" 85;
}

strong { font-weight: 600; color: var(--ink); }

/* ═══════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════ */
.hero {
  position: relative; min-height: 100vh;
  padding: clamp(60px, 8vh, 100px) var(--gutter) 40px;
  display: flex; flex-direction: column; justify-content: center;
  z-index: 2;
}

.hero-crossmark {
  position: absolute; top: clamp(40px, 6vh, 80px); right: var(--gutter);
  color: var(--ink-soft); opacity: 0;
  animation: fadeIn 1.4s var(--easing) 0.6s forwards;
}
.hero-crossmark svg { stroke: currentColor; stroke-width: 0.6; fill: none; }

.hero-top-meta {
  display: flex; align-items: center; gap: 16px;
  max-width: 720px; margin-bottom: clamp(20px, 3.5vh, 50px);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0; animation: fadeInUp 0.9s var(--easing) 0.4s forwards;
}

.masthead-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 96, "wdth" 85;
  line-height: 0.86;
  letter-spacing: -0.035em;
  margin-bottom: clamp(32px, 5vh, 64px);
}
.title-line {
  display: block;
  font-size: clamp(72px, 17vw, 260px);
  overflow: hidden;
  position: relative;
}
.title-line .reveal {
  display: inline-block;
  transform: translateY(110%) rotate(2deg);
  opacity: 0;
  animation: titleRise 1.1s var(--easing-out) forwards;
}
.title-line.line-1 .reveal { animation-delay: 0.15s; }
.title-line.line-2 .reveal { animation-delay: 0.3s; color: var(--accent); font-style: italic; font-variation-settings: "opsz" 96, "wdth" 75, "wght" 800; }
.title-line.line-3 .reveal { animation-delay: 0.45s; }

@keyframes titleRise {
  0% { transform: translateY(110%) rotate(3deg); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: translateY(0) rotate(0); opacity: 1; }
}

.hero-sub { max-width: 720px; margin-bottom: clamp(40px, 6vh, 80px); opacity: 0; animation: fadeInUp 1s var(--easing) 0.95s forwards; }
.sub-ja {
  font-family: var(--font-ja);
  font-size: clamp(16px, 2.2vw, 26px);
  font-weight: 500; letter-spacing: 0.08em; line-height: 1.4;
  margin-bottom: 8px;
}
.sub-ja em { font-weight: 600; letter-spacing: 0.04em; }
.sub-en {
  font-size: 11px; letter-spacing: 0.3em; color: var(--ink-muted);
}

.hero-stat {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 60px);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  padding: clamp(20px, 3vh, 40px) 0;
  margin-bottom: clamp(30px, 5vh, 60px);
  opacity: 0; animation: fadeInUp 1s var(--easing) 1.15s forwards;
}
.stat-col { display: flex; flex-direction: column; gap: 8px; }
.stat-big {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  font-variation-settings: "opsz" 60, "wdth" 90;
  line-height: 1;
}
.stat-col:nth-child(2) .stat-big { color: var(--accent); font-style: italic; font-variation-settings: "opsz" 60, "wdth" 80, "wght" 700; }
.stat-label { font-size: 10px; color: var(--ink-muted); }

/* Hero CTAs */
.hero-ctas {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-bottom: clamp(30px, 5vh, 50px);
  opacity: 0; animation: fadeInUp 1s var(--easing) 1.3s forwards;
}
.hero-cta {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 20px 28px 18px;
  border: 1px solid var(--ink);
  font-family: var(--font-display);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 600;
  letter-spacing: 0.1em;
  font-variation-settings: "opsz" 36, "wdth" 90;
  transition: all 0.35s var(--easing);
  position: relative; overflow: hidden;
  min-width: 240px;
}
.hero-cta::before {
  content: ""; position: absolute; inset: 0;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.4s var(--easing-out);
  z-index: 0;
}
.hero-cta > * { position: relative; z-index: 1; transition: color 0.3s; }
.hero-cta .mono { font-size: 14px; color: var(--accent); margin-bottom: 2px; }
.hero-cta-sub { color: var(--ink-muted); font-size: 9px !important; font-weight: 400 !important; letter-spacing: 0.25em; margin-top: 6px; font-variation-settings: normal; }
.hero-cta:hover::before { transform: translateY(0); }
.hero-cta:hover { border-color: var(--ink); }
.hero-cta:hover > * { color: var(--paper); }
.hero-cta:hover .hero-cta-sub { color: var(--brass-soft); }
.hero-cta:hover .mono { color: var(--brass-soft); }

.hero-cta.primary { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.hero-cta.primary::before { background: var(--ink); }
.hero-cta.primary .mono { color: var(--brass-soft); }
.hero-cta.primary .hero-cta-sub { color: rgba(241, 236, 224, 0.7); }
.hero-cta.primary:hover { border-color: var(--ink); }

.hero-scroll {
  display: flex; align-items: center; gap: 16px;
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0; animation: fadeInUp 1s var(--easing) 1.55s forwards;
}
.vertical-line {
  display: inline-block; width: 1px; height: 28px;
  background: var(--ink-soft);
  animation: vLineGrow 2s var(--easing) infinite;
  transform-origin: top;
}
@keyframes vLineGrow {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

@keyframes fadeIn { to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Hero 2-Column Layout (Desktop) ─── */
@media (min-width: 1024px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: max-content max-content max-content 1fr;
    column-gap: clamp(40px, 4vw, 80px);
    align-items: start;
    padding-top: clamp(10px, 5vh, 50px); /* 余白を約70px削減して要素を上へ */
    padding-bottom: 40px;
  }

  .title-line { font-size: clamp(72px, 17vw, 240px); } /* 文字の大きさを元の巨大なインパクトへ復元 */

  /* -- 左側カラム -- */
  .hero-top-meta { grid-column: 1; grid-row: 1; margin-bottom: 24px; align-self: end; }
  .masthead-title { grid-column: 1; grid-row: 2; margin-bottom: 32px; }
  .hero-sub { grid-column: 1; grid-row: 3; margin-bottom: 0; }
  .hero-scroll { grid-column: 1; grid-row: 4; align-self: start; margin-top: clamp(40px, 6vh, 80px); padding-top: 0; }

  /* -- 右側カラム（インフォメーションボード化） -- */
  .hero-stat {
    grid-column: 2;
    grid-row: 1 / 3; /* metaとtitleの行をまたぐことで、左側の上下余白を押し広げません */
    display: flex;
    flex-direction: column;
    border-top: none;
    border-bottom: none;
    border-left: 1px solid var(--line-strong);
    padding: 0 0 0 32px;
    margin-bottom: 0;
    gap: 24px;
    margin-top: clamp(40px, 5vh, 80px); /* 1行目の高さから少し下げる */
    min-width: 240px;
    align-self: start;
  }
  .hero-stat .stat-col {
    flex-direction: column;
    gap: 8px;
  }

  /* -- 右側のCTA群を「左右」に並べる -- */
  .hero-ctas {
    grid-column: 2;
    grid-row: 3 / 5; /* subとscrollの行をまたぐ */
    display: flex;
    flex-direction: row; /* 横並びに変更 */
    gap: 16px;
    margin-bottom: 0;
    align-self: start;
    padding-left: 32px;
    margin-top: 16px; /* hero-statとの視覚的な間隔 */
  }
  .hero-ctas .hero-cta { 
    width: auto; 
    min-width: 200px; /* 小さくなりすぎないように制御 */
    flex: 1; 
  }
}

/* ═══════════════════════════════════════════════════════════
   CHAPTER MARKER (shared)
   ═══════════════════════════════════════════════════════════ */
.chapter-marker {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(40px, 6vh, 90px);
  font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase;
}

.section-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(44px, 7vw, 100px);
  line-height: 0.95; letter-spacing: -0.03em;
  font-variation-settings: "opsz" 96, "wdth" 85;
  margin-bottom: 20px; max-width: var(--max-w); margin-left: auto; margin-right: auto;
}
.section-title em { font-variation-settings: "opsz" 96, "wdth" 75, "wght" 800; display: inline-block; }
.section-sub {
  font-family: var(--font-body); font-size: clamp(16px, 1.4vw, 20px);
  color: var(--ink-soft); line-height: 1.6;
  max-width: var(--max-w); margin: 0 auto clamp(40px, 6vh, 70px);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════
   PROLOGUE
   ═══════════════════════════════════════════════════════════ */
.prologue { padding: clamp(60px, 10vh, 140px) var(--gutter); position: relative; z-index: 2; }
.prologue-grid {
  display: grid; grid-template-columns: 200px 1fr;
  gap: clamp(24px, 5vw, 100px);
  max-width: var(--max-w); margin: 0 auto;
}
.prologue-meta {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-muted); line-height: 2.2; border-right: 1px solid var(--line); padding-right: 20px;
  align-self: start; position: sticky; top: 100px;
}
.prologue-meta p:first-child { color: var(--accent); font-size: 28px; font-family: var(--font-display); margin-bottom: 12px; letter-spacing: 0; font-weight: 600; }

.prologue-body { font-family: var(--font-body); font-size: clamp(16px, 1.4vw, 19px); line-height: 1.7; color: var(--ink-soft); max-width: 780px; }
.prologue-body p { margin-bottom: 1.2em; }
.prologue-body .lead {
  font-size: clamp(22px, 2.4vw, 30px); line-height: 1.45; color: var(--ink); font-weight: 500;
  font-family: var(--font-display); letter-spacing: -0.01em;
  font-variation-settings: "opsz" 60, "wdth" 90;
}
.drop-cap {
  float: left; font-family: var(--font-display);
  font-size: 4.2em; line-height: 0.86; margin: 0.06em 0.12em 0 0;
  font-weight: 700; color: var(--accent);
  font-variation-settings: "opsz" 96, "wdth" 80, "wght" 800;
}
.prologue-closer {
  border-top: 1px solid var(--line); padding-top: 1.2em;
  font-style: italic; font-size: clamp(16px, 1.4vw, 19px);
  color: var(--ink-muted);
}

/* ═══════════════════════════════════════════════════════════
   PYRAMID SECTION
   ═══════════════════════════════════════════════════════════ */
.pyramid-section {
  padding: clamp(80px, 12vh, 160px) var(--gutter);
  background: linear-gradient(180deg, var(--paper-deep) 0%, var(--paper) 100%);
  position: relative; z-index: 2;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pyramid-head { max-width: var(--max-w); margin: 0 auto clamp(40px, 6vh, 70px); }

.pyramid {
  max-width: 900px; margin: 0 auto clamp(30px, 5vh, 50px);
  display: flex; flex-direction: column; align-items: center;
  gap: 5px;
}
.tier {
  display: flex; justify-content: center; align-items: center;
  width: 100%; padding: 14px 20px;
  min-height: 72px;
  background: var(--paper);
  border: 1px solid var(--ink);
  transition: all 0.3s var(--easing);
  position: relative; overflow: hidden;
}
.tier::before {
  content: ""; position: absolute; inset: 0;
  background: var(--ink); transform: translateX(-101%);
  transition: transform 0.4s var(--easing-out);
  z-index: 0;
}
.tier-inner {
  position: relative; z-index: 1;
  display: flex; align-items: baseline;
  gap: 14px; justify-content: center;
  transition: color 0.3s;
  flex-wrap: nowrap;
  max-width: 100%;
}
.tier-name, .tier-ja { white-space: nowrap; }

/* Hide Japanese on narrowest tiers to keep single-line layout */
.tier[data-rank="7"] .tier-ja,
.tier[data-rank="8"] .tier-ja,
.tier[data-rank="9"] .tier-ja { display: none; }

/* Tight layout for narrow top tiers so English always fits */
.tier[data-rank="7"],
.tier[data-rank="8"],
.tier[data-rank="9"] { padding: 12px 14px; }
.tier[data-rank="7"] .tier-num,
.tier[data-rank="8"] .tier-num,
.tier[data-rank="9"] .tier-num { min-width: 36px; }
.tier[data-rank="7"] .tier-inner,
.tier[data-rank="8"] .tier-inner,
.tier[data-rank="9"] .tier-inner { gap: 10px; }
.tier[data-rank="9"] .tier-name { font-size: clamp(12px, 1.25vw, 16px); }
.tier:hover::before { transform: translateX(0); }
.tier:hover .tier-inner { color: var(--paper); }
.tier:hover .tier-ja { color: var(--brass-soft); }
.tier:hover .tier-num { color: var(--brass-soft); }

.tier-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(20px, 2.4vw, 30px);
  color: var(--accent); letter-spacing: 0;
  font-variation-settings: "opsz" 60, "wdth" 85;
  min-width: 52px; text-align: right;
  font-style: italic;
  line-height: 1;
}
.tier-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(13px, 1.4vw, 18px);
  letter-spacing: 0.1em;
  font-variation-settings: "opsz" 24, "wdth" 85;
}
.tier-ja {
  font-family: var(--font-ja);
  font-size: clamp(10px, 1vw, 12px);
  font-weight: 400; letter-spacing: 0.2em;
  color: var(--ink-muted);
}

/* Widths — linear 10% taper, 20% top → 100% bottom */
.tier[data-rank="9"] { width: 20%; }
.tier[data-rank="8"] { width: 30%; }
.tier[data-rank="7"] { width: 40%; }
.tier[data-rank="6"] { width: 50%; }
.tier[data-rank="5"] { width: 60%; }
.tier[data-rank="4"] { width: 70%; }
.tier[data-rank="3"] { width: 80%; }
.tier[data-rank="2"] { width: 90%; }
.tier[data-rank="1"] { width: 100%; }

/* Milestone tiers (IV, VI) */
.tier.milestone { border-color: var(--accent); background: rgba(139, 37, 20, 0.05); }
.tier.milestone .tier-num { color: var(--accent-deep); }
.tier.milestone::before { background: var(--accent); }

/* Gold tier (VIII) */
.tier.gold { border-color: var(--gold); background: rgba(201, 161, 74, 0.08); }
.tier.gold .tier-num { color: var(--accent-deep); }
.tier.gold::before { background: var(--accent-deep); }
.tier.gold:hover .tier-num { color: var(--gold); }

/* Top tier (IX) */
.tier[data-rank="9"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tier[data-rank="9"] .tier-num { color: var(--brass-soft); }
.tier[data-rank="9"] .tier-ja { color: rgba(241, 236, 224, 0.6); }
.tier[data-rank="9"]::before { background: var(--accent); }
.tier[data-rank="9"]:hover .tier-inner { color: var(--paper); }
.tier[data-rank="9"]:hover .tier-num { color: var(--paper); }

/* Entry animation */
.pyramid-section .tier {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s var(--easing-out), transform 0.6s var(--easing-out);
}
.pyramid-section.in .tier { opacity: 1; transform: translateY(0); }
.pyramid-section.in .tier[data-rank="9"] { transition-delay: 0.1s; }
.pyramid-section.in .tier[data-rank="8"] { transition-delay: 0.18s; }
.pyramid-section.in .tier[data-rank="7"] { transition-delay: 0.26s; }
.pyramid-section.in .tier[data-rank="6"] { transition-delay: 0.34s; }
.pyramid-section.in .tier[data-rank="5"] { transition-delay: 0.42s; }
.pyramid-section.in .tier[data-rank="4"] { transition-delay: 0.5s; }
.pyramid-section.in .tier[data-rank="3"] { transition-delay: 0.58s; }
.pyramid-section.in .tier[data-rank="2"] { transition-delay: 0.66s; }
.pyramid-section.in .tier[data-rank="1"] { transition-delay: 0.74s; }

.pyramid-legend {
  max-width: 900px; margin: 0 auto clamp(30px, 5vh, 50px);
  display: flex; gap: 28px; flex-wrap: wrap; justify-content: center;
  padding-top: 20px; border-top: 1px solid var(--line);
}
.legend-item { display: flex; align-items: center; gap: 8px; }
.swatch {
  width: 16px; height: 10px; border: 1px solid var(--ink);
  background: var(--paper);
}
.swatch.primary { background: rgba(139, 37, 20, 0.15); border-color: var(--accent); }
.swatch.gold { background: rgba(201, 161, 74, 0.2); border-color: var(--gold); }

.pyramid-cta { text-align: center; max-width: var(--max-w); margin: 0 auto; }
.pyramid-cta-btn {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 22px 44px;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink);
  font-family: var(--font-display); font-size: clamp(18px, 1.8vw, 22px); font-weight: 700;
  letter-spacing: 0.08em;
  font-variation-settings: "opsz" 36, "wdth" 85;
  transition: all 0.35s var(--easing);
  position: relative; overflow: hidden;
}
.pyramid-cta-btn::before {
  content: ""; position: absolute; inset: 0;
  background: var(--accent); transform: translateY(101%);
  transition: transform 0.4s var(--easing-out);
}
.pyramid-cta-btn > * { position: relative; z-index: 1; }
.pyramid-cta-btn .mono:first-child { color: var(--brass-soft); }
.pyramid-cta-btn .mono.small { margin-top: 6px; font-weight: 400; letter-spacing: 0.25em; font-variation-settings: normal; }
.pyramid-cta-btn:hover::before { transform: translateY(0); }
.pyramid-cta-btn:hover { border-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   LEVELS
   ═══════════════════════════════════════════════════════════ */
.levels { position: relative; z-index: 2; }
.level {
  padding: clamp(80px, 14vh, 180px) var(--gutter) clamp(60px, 10vh, 140px);
  border-top: 1px solid var(--line);
  position: relative;
  scroll-margin-top: 80px;
}
.level:first-of-type { border-top: 2px solid var(--ink); }

.level-head {
  display: grid; grid-template-columns: minmax(200px, 320px) 1fr;
  gap: clamp(30px, 5vw, 80px);
  max-width: var(--max-w); margin: 0 auto clamp(40px, 6vh, 80px);
  align-items: start;
}

.level-numeral-wrap {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding-top: 4px;
}
.level-numeral {
  font-family: var(--font-display);
  font-size: clamp(140px, 18vw, 260px);
  font-weight: 500;
  font-variation-settings: "opsz" 96, "wdth" 85;
  line-height: 0.78;
  color: var(--ink);
  letter-spacing: -0.03em;
  transform: translateY(-10px);
  display: inline-block;
}
.level.milestone .level-numeral { color: var(--accent); font-style: italic; font-variation-settings: "opsz" 96, "wdth" 80, "wght" 700; }
.level.gold .level-numeral { color: var(--accent); font-variation-settings: "opsz" 96, "wdth" 85, "wght" 700; }
.level.final .level-numeral { color: var(--ink); font-style: italic; font-variation-settings: "opsz" 96, "wdth" 75, "wght" 700; }
.level-folio {
  font-size: 11px; color: var(--ink-muted); letter-spacing: 0.2em;
  border-top: 1px solid var(--line-strong); padding-top: 8px; display: inline-block; width: fit-content;
}
.milestone-badge {
  display: inline-block; margin-top: 6px; font-size: 9px; letter-spacing: 0.2em;
  color: var(--accent); border: 1px solid var(--accent); padding: 4px 8px;
  width: fit-content;
}
.milestone-badge.gold { color: var(--accent-deep); border-color: var(--gold); background: rgba(201, 161, 74, 0.08); }
.milestone-badge.final-badge { color: var(--paper); background: var(--ink); border-color: var(--ink); }

.level-heading { padding-top: clamp(10px, 1vh, 30px); }
.level-kicker {
  font-size: 10px; letter-spacing: 0.3em; color: var(--ink-muted);
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  display: inline-block;
}
.level-title {
  font-family: var(--font-display); line-height: 0.95;
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 18px;
}
.title-en {
  font-size: clamp(36px, 5.4vw, 76px);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 96, "wdth" 85;
  color: var(--ink);
}
.level.milestone .title-en { color: var(--accent); }
.level.final .title-en { font-style: italic; font-variation-settings: "opsz" 96, "wdth" 75, "wght" 700; }

.title-ja {
  font-family: var(--font-ja);
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 500; letter-spacing: 0.3em;
  color: var(--ink-muted);
}
.title-ja .sep { color: var(--line-strong); font-size: 0.7em; margin: 0 0.1em; }

.level-tagline {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(16px, 1.5vw, 20px);
  color: var(--accent); font-weight: 500;
  font-variation-settings: "opsz" 36, "wdth" 85;
}

.level-body { max-width: var(--max-w); margin: 0 auto; }
.level-def {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.9vw, 24px);
  font-weight: 400;
  line-height: 1.55; letter-spacing: -0.005em;
  color: var(--ink);
  max-width: 880px; margin-bottom: clamp(40px, 6vh, 80px);
  font-variation-settings: "opsz" 36, "wdth" 90;
  border-left: 2px solid var(--accent); padding-left: clamp(16px, 2vw, 28px);
}
.level-def em { font-style: italic; }
.level.final .level-def { color: var(--ink); border-left-color: var(--ink); }
.final-note {
  display: block; margin-top: 14px;
  font-size: 13px; font-family: var(--font-mono); letter-spacing: 0.1em;
  color: var(--ink-muted); font-style: normal;
  font-variation-settings: normal;
}

.level-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 60px);
  padding: clamp(30px, 5vh, 60px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.grid-col { min-width: 0; }
.col-label {
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--accent);
  display: inline-block;
}

.tasks, .outputs { font-family: var(--font-body); font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); }
.tasks li, .outputs li {
  padding: 8px 0 8px 18px;
  border-bottom: 1px dotted var(--line);
  position: relative;
}
.tasks li::before { content: "·"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.outputs li::before { content: "▢"; position: absolute; left: 0; color: var(--ink-muted); font-size: 10px; top: 10px; }
.tasks li:last-child, .outputs li:last-child { border-bottom: none; }

.ba { display: flex; flex-direction: column; gap: 14px; font-size: 15px; }
.ba p { line-height: 1.5; padding: 14px 16px; background: var(--highlight); border: 1px solid var(--line); position: relative; }
.ba p:nth-child(2) { background: rgba(139, 37, 20, 0.06); border-color: rgba(139, 37, 20, 0.25); }
.ba-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.25em;
  padding: 3px 6px; margin-right: 10px; background: var(--ink); color: var(--paper);
  vertical-align: 2px;
}
.ba-tag.after { background: var(--accent); }

/* Level VIII types */
.three-types { grid-template-columns: repeat(3, 1fr); border-bottom: none; padding-bottom: 0; margin-bottom: 30px; }
.type-card {
  padding: 24px; background: var(--paper-deep); border: 1px solid var(--line);
  position: relative; overflow: hidden; transition: transform 0.4s var(--easing), background 0.4s;
}
.type-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 0;
  background: var(--accent); transition: height 0.5s var(--easing);
}
.type-card:hover { transform: translateY(-4px); background: var(--highlight); }
.type-card:hover::before { height: 100%; }
.type-num { font-size: 10px; letter-spacing: 0.25em; color: var(--accent); margin-bottom: 12px; }
.type-title {
  font-family: var(--font-display); font-size: clamp(20px, 2vw, 26px); font-weight: 600;
  margin-bottom: 10px; font-variation-settings: "opsz" 36, "wdth" 85;
}
.type-desc { font-size: 14px; line-height: 1.6; color: var(--ink-soft); }

.level-foot {
  padding: clamp(24px, 3vh, 40px) 0 0;
  font-family: var(--font-body); font-size: 14px; line-height: 1.7;
  color: var(--ink-soft);
}
.foot-item { padding: 6px 0; border-bottom: 1px dotted var(--line); }
.foot-item:last-child { border-bottom: none; }
.foot-item .mono { font-size: 10px; letter-spacing: 0.2em; margin-right: 10px; }

/* ═══════════════════════════════════════════════════════════
   CROSSROADS
   ═══════════════════════════════════════════════════════════ */
.crossroads {
  padding: clamp(80px, 14vh, 160px) var(--gutter);
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  position: relative; z-index: 2;
  border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}

.crossroads-table {
  max-width: var(--max-w); margin: 0 auto;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.cr-row {
  display: grid; grid-template-columns: 80px 1fr 1fr;
  gap: clamp(12px, 2vw, 40px);
  padding: clamp(16px, 2.2vh, 24px) 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s;
}
.cr-row:last-child { border-bottom: none; }
.cr-row:hover { background: var(--highlight); }
.cr-row.cr-head {
  border-bottom: 1px solid var(--ink);
  font-size: 10px; letter-spacing: 0.2em; color: var(--ink-muted);
}
.cr-lv {
  font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 36px); font-weight: 700;
  color: var(--ink); line-height: 1;
  font-variation-settings: "opsz" 60, "wdth" 85;
}
.cr-row.star .cr-lv, .cr-row.star em { color: var(--accent); }
.cr-row.gold .cr-lv { color: var(--accent-deep); }
.cr-row.gold { background: rgba(201, 161, 74, 0.08); }
.cr-row.final .cr-lv { color: var(--paper); }
.cr-row.final { background: var(--ink); color: var(--paper); border-color: transparent; }
.cr-row.final:hover { background: var(--ink-soft); }
.cr-row.final .cr-cell { color: var(--paper); }
.cr-row.final em { color: var(--brass-soft); }
.cr-cell { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); align-self: center; }

/* ═══════════════════════════════════════════════════════════
   DIAGNOSIS — Multi-step
   ═══════════════════════════════════════════════════════════ */
.diagnosis {
  padding: clamp(80px, 14vh, 160px) var(--gutter);
  position: relative; z-index: 2;
  scroll-margin-top: 80px;
}

.diag-wrapper {
  max-width: 860px; margin: 0 auto;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
}
.diag-wrapper > .diag-step,
.diag-wrapper > .diag-quiz {
  grid-row: 1;
  grid-column: 1;
}
.diag-quiz {
  display: grid;
  grid-template-columns: 1fr;
}
.diag-quiz > .diag-step {
  grid-row: 1;
  grid-column: 1;
}

.diag-step {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transition: opacity 0.45s var(--easing-out), visibility 0s linear 0.45s;
}
.diag-step[data-active="true"] {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  position: relative;
  transition-delay: 0s;
}

.step-inner {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: clamp(32px, 5vw, 64px);
  position: relative;
}

/* Top row: back (left) + next (right) above each question */
.step-top-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 18px;
}

.step-back-btn, .step-next-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line-strong);
  transition: all 0.25s var(--easing);
  cursor: pointer;
}
.step-back-btn { color: var(--ink-muted); }
.step-back-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--highlight);
}
.step-back-btn .mono { font-size: 12px; }
.step-back-btn .back-label, .step-next-btn .next-label { font-weight: 500; }

.step-next-btn { color: var(--ink); border-color: var(--ink); }
.step-next-btn .mono { font-size: 12px; }
.step-next-btn:not(:disabled):hover {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}
.step-next-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 900px) {
  .step-top-row { margin-bottom: 10px; }
  .step-back-btn, .step-next-btn {
    cursor: auto;
    padding: 6px 10px;
    font-size: 9px;
  }
  .step-back-btn .back-label, .step-next-btn .next-label { letter-spacing: 0.12em; }
  .diag-step .step-inner { display: flex; flex-direction: column; }
}
.step-kicker {
  font-size: 10px; letter-spacing: 0.3em; color: var(--accent);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.step-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.8vw, 48px);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 72, "wdth" 85;
  margin-bottom: 20px;
}
.step-title em { font-variation-settings: "opsz" 72, "wdth" 75, "wght" 800; }
.step-desc {
  font-family: var(--font-body); font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.65; color: var(--ink-soft);
  margin-bottom: 24px;
  max-width: 680px;
}

.step-field {
  padding: 20px 24px; background: var(--highlight);
  border: 1px solid var(--line);
  margin-bottom: clamp(24px, 3vh, 36px);
}
.diag-name-label {
  display: block; font-size: 10px; letter-spacing: 0.2em;
  color: var(--ink-muted); margin-bottom: 8px;
}
.diag-name-input {
  width: 100%; background: transparent; border: none;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 600; font-variation-settings: "opsz" 48, "wdth" 85;
  color: var(--ink); padding: 4px 0;
  outline: none; caret-color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.diag-name-input:focus { border-color: var(--accent); }
.diag-name-input::placeholder { color: var(--ink-ghost); font-style: italic; font-weight: 400; }

.step-nav {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-top: clamp(20px, 3vh, 32px);
}

.step-btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 28px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  border: 1px solid var(--ink);
  transition: all 0.35s var(--easing);
  position: relative; overflow: hidden;
}
.step-btn > * { position: relative; z-index: 1; transition: color 0.3s; }
.step-btn::before {
  content: ""; position: absolute; inset: 0;
  transform: translateY(101%);
  transition: transform 0.4s var(--easing-out);
}
.step-btn.primary { background: var(--ink); color: var(--paper); }
.step-btn.primary::before { background: var(--accent); }
.step-btn.primary:hover::before { transform: translateY(0); }
.step-btn.primary:hover { border-color: var(--accent); }
.step-btn.primary[disabled] { opacity: 0.35; cursor: not-allowed; }
.step-btn.primary[disabled]:hover::before { transform: translateY(101%); }
.step-btn.primary[disabled]:hover { border-color: var(--ink); }

.step-btn.ghost { background: transparent; color: var(--ink); }
.step-btn.ghost::before { background: var(--ink); }
.step-btn.ghost:hover::before { transform: translateY(0); }
.step-btn.ghost:hover > * { color: var(--paper); }

.step-meta {
  margin-top: 16px; line-height: 1.8;
}

/* Quiz question */
.diag-question .step-title {
  font-size: clamp(24px, 3.2vw, 38px);
}
.diag-question-sub {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.25em;
  color: var(--ink-muted); margin-bottom: 24px; text-transform: uppercase;
}

.diag-options {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 16px;
}
.diag-option {
  display: block; position: relative;
  padding: 18px 22px 18px 64px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  transition: all 0.25s var(--easing);
  font-family: var(--font-body); font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.5;
}
.diag-option input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.diag-option:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.diag-option .opt-letter {
  position: absolute; left: 20px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border: 1px solid var(--ink-muted);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0; color: var(--ink-muted);
  transition: all 0.3s var(--easing);
}
.diag-option:hover { background: var(--highlight); border-color: var(--ink); }
.diag-option:hover .opt-letter { border-color: var(--ink); color: var(--ink); }
.diag-option.selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.diag-option.selected .opt-letter { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.diag-option.selected::after {
  content: "✓"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  color: var(--brass-soft); font-size: 16px; font-weight: 700;
}

/* Progress bar */
.diag-progress {
  max-width: 860px; margin: 16px auto 0;
  padding: 14px 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--easing);
}
.diag-progress.active { opacity: 1; pointer-events: auto; }
.diag-progress-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  margin-bottom: 10px;
}
.diag-progress-track {
  height: 2px; background: var(--line);
  overflow: hidden;
}
.diag-progress-fill {
  height: 100%; background: var(--accent);
  width: 0%; transition: width 0.5s var(--easing-out);
}

/* Nav (during quiz) */
.diag-nav {
  max-width: 860px; margin: 16px auto 0;
  display: flex; justify-content: space-between; gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--easing);
}
.diag-nav.active { opacity: 1; pointer-events: auto; }

/* Final / result step */
.diag-final .step-inner { padding: clamp(40px, 6vw, 72px) clamp(28px, 4vw, 60px); }

/* ─── Certificate (unchanged structure, updated font stacks) ─── */
.certificate {
  position: relative;
  padding: clamp(40px, 6vw, 72px) clamp(30px, 5vw, 80px);
  background:
    repeating-linear-gradient(0deg, transparent, transparent 29px, rgba(23, 19, 15, 0.02) 29px, rgba(23, 19, 15, 0.02) 30px),
    linear-gradient(180deg, #FAF5E9, #F2EAD5);
  border: 2px solid var(--ink);
  box-shadow: 0 30px 60px -30px rgba(23, 19, 15, 0.3), 0 0 0 8px var(--paper), 0 0 0 9px var(--ink-muted);
  margin: 28px 0 36px;
  overflow: hidden;
}
.cert-corner {
  position: absolute; width: 28px; height: 28px;
  border: 1px solid var(--ink);
}
.cert-corner.tl { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.cert-corner.tr { top: 14px; right: 14px; border-left: none; border-bottom: none; }
.cert-corner.bl { bottom: 14px; left: 14px; border-right: none; border-top: none; }
.cert-corner.br { bottom: 14px; right: 14px; border-left: none; border-top: none; }

.cert-inner { text-align: center; }
.cert-header { font-size: 11px; letter-spacing: 0.35em; color: var(--accent); margin-bottom: 6px; }
.cert-sub { font-size: 9px; letter-spacing: 0.4em; margin-bottom: clamp(30px, 5vh, 50px); color: var(--ink-muted); }

.cert-intro {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em;
  color: var(--ink-muted); margin-bottom: 12px;
}
.cert-name {
  font-family: var(--font-display); font-size: clamp(32px, 5vw, 60px);
  font-weight: 700; font-variation-settings: "opsz" 96, "wdth" 80, "wght" 700;
  font-style: italic; color: var(--ink);
  padding: 10px 0; margin-bottom: 14px;
  border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
  letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.cert-verb {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em;
  color: var(--ink-muted); margin-bottom: 20px;
}
.cert-rank-block {
  margin-bottom: clamp(20px, 4vh, 40px);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.cert-numeral {
  font-family: var(--font-display); font-size: clamp(80px, 12vw, 160px); font-weight: 700;
  line-height: 0.9; color: var(--accent);
  font-variation-settings: "opsz" 96, "wdth" 75, "wght" 800; font-style: italic;
}
.cert-name-en {
  font-family: var(--font-display); font-size: clamp(22px, 3vw, 36px); font-weight: 700;
  letter-spacing: 0.05em; color: var(--ink);
  font-variation-settings: "opsz" 60, "wdth" 85;
}
.cert-name-ja {
  font-family: var(--font-ja); font-size: clamp(12px, 1.2vw, 15px);
  letter-spacing: 0.3em; color: var(--ink-muted); font-weight: 400;
}

.cert-definition {
  font-family: var(--font-display); font-size: clamp(14px, 1.3vw, 17px);
  line-height: 1.55; color: var(--ink-soft);
  max-width: 560px; margin: 0 auto clamp(30px, 5vh, 50px);
  font-weight: 400; font-variation-settings: "opsz" 24, "wdth" 90;
}

.cert-footer {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 30px; align-items: center;
  padding-top: clamp(20px, 3vh, 30px);
  border-top: 1px solid var(--line-strong);
}
.cert-sign { text-align: left; }
.cert-sign p { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; color: var(--ink-muted); }
.cert-brand {
  font-family: var(--font-display) !important; font-size: 16px !important;
  letter-spacing: 0.08em !important; color: var(--ink) !important;
  font-weight: 700 !important; margin: 4px 0;
  font-variation-settings: "opsz" 36, "wdth" 85;
}
.cert-serial { text-align: right; }
.cert-serial p { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.15em; }
.cert-serial-num { color: var(--ink); font-size: 11px !important; margin: 4px 0; font-weight: 500; }
.cert-seal { color: var(--accent); opacity: 0.9; transition: transform 0.6s var(--easing); }
.certificate:hover .cert-seal { transform: rotate(-12deg); }

/* Share bar */
.share-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.share-btn {
  flex: 1; min-width: 180px;
  padding: 16px 22px;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--ink);
  transition: all 0.3s var(--easing);
  position: relative; overflow: hidden;
}
.share-btn::before {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: translateY(101%); transition: transform 0.4s var(--easing-out);
}
.share-btn span { position: relative; z-index: 1; }
.share-btn:hover:not([disabled])::before { transform: translateY(0); }
.share-btn:hover:not([disabled]) { border-color: var(--accent); }
.share-btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.share-btn.ghost::before { background: var(--ink); }
.share-btn.ghost:hover:not([disabled]) { color: var(--paper); }
.share-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.share-note { text-align: center; margin-bottom: 24px; }

.diag-result { max-width: 860px; margin: 0 auto; }

/* ═══════════════════════════════════════════════════════════
   ENTERPRISE
   ═══════════════════════════════════════════════════════════ */
.enterprise {
  padding: clamp(80px, 14vh, 160px) var(--gutter);
  background: var(--ink); color: var(--paper);
  position: relative; z-index: 2;
}
.enterprise .chapter-marker { border-color: rgba(241, 236, 224, 0.2); color: var(--paper); }
.enterprise .chapter-marker .dim { color: var(--brass-soft); opacity: 0.7; }
.enterprise .section-title { color: var(--paper); }
.enterprise .section-title em { color: var(--brass-soft); font-variation-settings: "opsz" 96, "wdth" 75, "wght" 800; }
.enterprise .section-sub { color: rgba(241, 236, 224, 0.7); }
.enterprise .section-sub em { color: var(--brass-soft); font-variation-settings: "opsz" 36, "wdth" 85; }

.ent-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: rgba(241, 236, 224, 0.15);
  border: 1px solid rgba(241, 236, 224, 0.2);
  max-width: var(--max-w); margin: 0 auto clamp(40px, 6vh, 80px);
}
.ent-card {
  padding: clamp(24px, 3vw, 40px); background: var(--ink);
  transition: background 0.3s var(--easing);
  position: relative;
}
.ent-card:hover { background: var(--ink-soft); }
.ent-num { font-size: 10px; letter-spacing: 0.3em; color: var(--brass-soft); margin-bottom: 14px; }
.ent-title {
  font-family: var(--font-display); font-size: clamp(19px, 1.9vw, 24px); font-weight: 600;
  margin-bottom: 12px; color: var(--paper);
  font-variation-settings: "opsz" 36, "wdth" 85;
}
.ent-desc { font-size: 14px; line-height: 1.65; color: rgba(241, 236, 224, 0.7); }

.ent-pricing {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
  max-width: var(--max-w); margin: 0 auto clamp(30px, 5vh, 50px);
}
.ent-pricing-block {
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(241, 236, 224, 0.25);
  transition: all 0.3s var(--easing);
}
.ent-pricing-block:hover { border-color: var(--brass-soft); }
.ent-pricing-block.primary { background: linear-gradient(135deg, rgba(201, 161, 74, 0.1), rgba(201, 161, 74, 0.02)); border-color: var(--gold); }
.ent-pricing-title {
  font-family: var(--font-display); font-size: clamp(20px, 2vw, 26px); font-weight: 600;
  margin: 10px 0 14px; color: var(--paper);
  font-variation-settings: "opsz" 36, "wdth" 85;
}
.ent-pricing-price {
  font-family: var(--font-display); font-size: clamp(36px, 5vw, 56px);
  font-weight: 700; font-style: italic;
  color: var(--brass-soft); line-height: 1; margin-bottom: 18px;
  font-variation-settings: "opsz" 96, "wdth" 75, "wght" 800;
  display: flex; align-items: baseline; gap: 10px;
}
.coming {
  font-size: 10px; font-style: normal; font-family: var(--font-mono);
  letter-spacing: 0.25em; color: var(--gold);
  border: 1px solid var(--gold); padding: 3px 7px;
  font-variation-settings: normal;
}
.ent-pricing-note { line-height: 1.7; }

.ent-cta { text-align: center; max-width: var(--max-w); margin: 0 auto; }
.cta-button {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 22px 44px;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.25em;
  border: 1px solid var(--paper);
  margin-bottom: 14px;
  transition: all 0.3s var(--easing);
  position: relative; overflow: hidden;
}
.cta-button::before {
  content: ""; position: absolute; inset: 0; background: var(--brass-soft);
  transform: translateX(-101%); transition: transform 0.5s var(--easing-out);
}
.cta-button > * { position: relative; z-index: 1; }
.cta-button:hover::before { transform: translateX(0); }
.cta-button:hover { border-color: var(--brass-soft); color: var(--ink); }

/* ═══════════════════════════════════════════════════════════
   PRINCIPLES
   ═══════════════════════════════════════════════════════════ */
.principles {
  padding: clamp(80px, 14vh, 160px) var(--gutter);
  position: relative; z-index: 2;
  background: var(--paper-deep);
}
.principles-list {
  max-width: 900px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 0;
}
.principles-list li {
  display: grid; grid-template-columns: 100px 1fr;
  gap: 40px; padding: clamp(24px, 3.5vh, 40px) 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.principles-list li:first-child { border-top: 1px solid var(--ink); }
.principles-list li:last-child { border-bottom: 1px solid var(--ink); }
.principle-num {
  font-family: var(--font-display); font-size: clamp(40px, 5vw, 64px);
  font-weight: 700; color: var(--accent); line-height: 1;
  font-variation-settings: "opsz" 96, "wdth" 75, "wght" 700; font-style: italic;
}
.principle-body h3 {
  font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 700; margin-bottom: 8px;
  font-variation-settings: "opsz" 60, "wdth" 85;
}
.principle-body p { font-size: clamp(14px, 1.2vw, 16px); color: var(--ink-muted); line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════
   COLOPHON
   ═══════════════════════════════════════════════════════════ */
.colophon {
  padding: clamp(80px, 14vh, 140px) var(--gutter) 60px;
  background: var(--paper); position: relative; z-index: 2;
  border-top: 1px solid var(--ink);
}
.colophon .chapter-marker { margin-bottom: clamp(40px, 6vh, 80px); }

.colophon-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 50px);
  max-width: var(--max-w); margin: 0 auto clamp(40px, 6vh, 80px);
}
.col-block p:first-child { margin-bottom: 8px; }
.col-value {
  font-family: var(--font-display); font-size: clamp(16px, 1.6vw, 20px); font-weight: 600;
  line-height: 1.4; font-variation-settings: "opsz" 36, "wdth" 85;
}
.mono-small { font-family: var(--font-mono); font-size: 11px !important; letter-spacing: 0.12em !important; line-height: 1.5 !important; font-weight: 400 !important; }

.colophon-sign {
  max-width: 900px; margin: 0 auto clamp(40px, 6vh, 80px);
  padding: clamp(30px, 5vh, 60px) 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  text-align: center;
}
.sign-quote {
  font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 500; line-height: 1.5; color: var(--ink);
  margin-bottom: 20px; font-variation-settings: "opsz" 60, "wdth" 85;
}
.sign-author { font-size: 11px; letter-spacing: 0.3em; color: var(--accent); }

.colophon-mark {
  display: flex; justify-content: space-between; gap: 20px;
  max-width: var(--max-w); margin: 0 auto;
  padding-top: 30px; border-top: 1px solid var(--line);
  font-size: 9px; letter-spacing: 0.2em; flex-wrap: wrap;
}

/* ─── Creator card ─── */
.creator-card {
  max-width: 900px; margin: clamp(40px, 6vh, 80px) auto;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--ink);
  background: var(--paper-deep);
  position: relative;
}
.creator-head {
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: 0.25em;
}
.creator-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.creator-meta { display: flex; flex-direction: column; gap: 12px; }
.creator-name {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variation-settings: "opsz" 60, "wdth" 85;
  line-height: 1.1;
}
.creator-alt {
  font-size: 0.55em; color: var(--ink-muted); font-weight: 400;
  letter-spacing: 0.08em; font-variation-settings: "opsz" 24, "wdth" 95;
}
.creator-role {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.16em;
  color: var(--accent); text-transform: uppercase;
}
.creator-bio {
  font-family: var(--font-body);
  font-size: 15px; line-height: 1.65; color: var(--ink-soft);
  margin-top: 4px;
}

.creator-links { display: flex; flex-direction: column; gap: 10px; }
.creator-link {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--ink);
  transition: all 0.25s var(--easing);
  position: relative; overflow: hidden;
}
.creator-link::before {
  content: ""; position: absolute; inset: 0;
  background: var(--ink); transform: translateX(-101%);
  transition: transform 0.4s var(--easing-out); z-index: 0;
}
.creator-link > * { position: relative; z-index: 1; transition: color 0.3s; }
.creator-link:hover::before { transform: translateX(0); }
.creator-link:hover { border-color: var(--accent); }
.creator-link:hover .link-label { color: var(--brass-soft); }
.creator-link:hover .link-handle,
.creator-link:hover .link-arrow { color: var(--paper); }

.link-label {
  font-size: 10px; letter-spacing: 0.2em; color: var(--accent);
  white-space: nowrap;
}
.link-handle {
  font-family: var(--font-body);
  font-size: 14px; font-weight: 500; color: var(--ink);
  letter-spacing: 0;
}
.link-arrow {
  font-size: 14px; color: var(--ink-muted);
}

.creator-note {
  font-family: var(--font-body);
  font-size: 13px; line-height: 1.7; text-align: left;
}
.creator-note strong { font-weight: 700; color: var(--accent); }

@media (max-width: 780px) {
  .creator-body { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 10002;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s var(--easing);
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(23, 19, 15, 0.7); backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  max-width: 480px; width: calc(100% - 40px);
  margin: clamp(40px, 8vh, 100px) auto;
  padding: clamp(32px, 4vw, 48px);
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5);
  transform: translateY(30px) scale(0.96);
  transition: transform 0.4s var(--easing-out);
}
.modal.open .modal-panel { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute; top: 18px; right: 18px;
  width: 30px; height: 30px;
  font-size: 20px; color: var(--ink-muted);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--accent); }
.modal-kicker { font-size: 10px; letter-spacing: 0.3em; color: var(--accent); margin-bottom: 12px; }
.modal-title {
  font-family: var(--font-display); font-size: clamp(30px, 3.6vw, 44px); font-weight: 700;
  line-height: 1; letter-spacing: -0.025em; margin-bottom: 18px;
  font-variation-settings: "opsz" 72, "wdth" 85;
}
.modal-title em { font-variation-settings: "opsz" 72, "wdth" 75, "wght" 800; }
.modal-desc {
  font-family: var(--font-body); font-size: 15px; line-height: 1.65; color: var(--ink-soft);
  margin-bottom: clamp(24px, 3vh, 32px);
}

.auth-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; width: 100%; padding: 16px 20px;
  border: 1px solid var(--ink); background: var(--paper);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em;
  color: var(--ink); font-weight: 500;
  transition: all 0.3s var(--easing); margin-bottom: 14px;
  position: relative; overflow: hidden;
}
.auth-btn::before {
  content: ""; position: absolute; inset: 0; background: var(--ink);
  transform: translateY(101%); transition: transform 0.35s var(--easing-out); z-index: 0;
}
.auth-btn > * { position: relative; z-index: 1; transition: color 0.3s; }
.auth-btn:hover::before { transform: translateY(0); }
.auth-btn:hover, .auth-btn:hover > span { color: var(--paper); }
.auth-btn.google svg { flex-shrink: 0; }
.auth-btn.email { background: var(--ink); color: var(--paper); }
.auth-btn.email::before { background: var(--accent); }
.auth-btn.email:hover { border-color: var(--accent); }

.auth-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0;
}
.auth-divider .hairline { height: 1px; background: var(--line-strong); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-form label { display: block; }
.auth-form input {
  display: block; width: 100%; padding: 12px 14px;
  border: 1px solid var(--ink); background: var(--paper);
  font-family: var(--font-body); font-size: 15px;
  outline: none;
  transition: border-color 0.3s, background 0.3s;
}
.auth-form input:focus { border-color: var(--accent); background: var(--highlight); }
.auth-form .auth-btn { margin-top: 6px; }

/* Required asterisk + select + textarea + two-column row for enterprise form */
.auth-field .req { color: var(--accent); margin-left: 4px; }
.auth-form select,
.auth-form textarea {
  display: block; width: 100%; padding: 12px 14px;
  border: 1px solid var(--ink); background: var(--paper);
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  outline: none; border-radius: 0;
  transition: border-color 0.3s, background 0.3s;
  appearance: none; -webkit-appearance: none;
}
.auth-form select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.auth-form textarea { resize: vertical; min-height: 84px; font-family: var(--font-body); }
.auth-form select:focus,
.auth-form textarea:focus { border-color: var(--accent); background: var(--highlight); }

.auth-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .auth-row-2 { grid-template-columns: 1fr; } }

.modal-panel-wide { max-width: 640px; }

/* Checkbox / radio groups for enterprise inquiry */
.auth-form fieldset.auth-field { border: 0; padding: 0; margin: 0; }
.auth-form fieldset.auth-field legend { padding: 0; margin-bottom: 8px; }

.chk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
@media (max-width: 560px) { .chk-grid { grid-template-columns: 1fr; } }
.auth-form .chk-item, .auth-form .rad-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-family: var(--font-body); font-size: 14px; color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  line-height: 1.3;
}
.auth-form .chk-item:hover, .auth-form .rad-item:hover { border-color: var(--ink); }
.auth-form .chk-item input, .auth-form .rad-item input {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; margin: 0; padding: 0;
  border: 1px solid var(--ink); background: var(--paper);
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  display: inline-block;
}
.rad-item input { border-radius: 50%; }
.auth-form .chk-item input:checked, .auth-form .rad-item input:checked {
  background: var(--ink); border-color: var(--ink);
}
.auth-form .chk-item input:checked::after {
  content: ""; position: absolute; inset: 2px;
  background: var(--paper);
  clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 20%, 86% 6%, 38% 70%);
}
.auth-form .rad-item input:checked::after {
  content: ""; position: absolute; inset: 3px;
  border-radius: 50%;
  background: var(--paper);
}
.auth-form .chk-item:has(input:checked), .auth-form .rad-item:has(input:checked) {
  border-color: var(--accent);
  background: var(--highlight);
}
.radio-group { display: flex; flex-direction: column; gap: 8px; }

.auth-privacy {
  margin: 14px 0 10px;
  font-size: 10.5px;
  line-height: 1.7;
  text-align: left;
}
.auth-privacy a {
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s var(--easing), border-color 0.2s var(--easing);
}
.auth-privacy a:hover { color: var(--accent); border-color: var(--accent); }

.modal-legal { margin-top: 24px; line-height: 1.7; text-align: left; }

/* ═══════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translate(-50%, 100px); z-index: 10003;
  padding: 14px 22px;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  border: 1px solid var(--accent);
  opacity: 0; transition: all 0.4s var(--easing-out);
  max-width: calc(100% - 40px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ═══════════════════════════════════════════════════════════
   SCROLL REVEAL
   ═══════════════════════════════════════════════════════════ */
.reveal-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.9s var(--easing-out), transform 0.9s var(--easing-out); }
.reveal-on-scroll.in { opacity: 1; transform: translateY(0); }

.level .level-numeral {
  opacity: 0; transform: translateY(40px) rotate(-3deg);
  transition: opacity 1.2s var(--easing-out), transform 1.2s var(--easing-out);
}
.level.in .level-numeral { opacity: 1; transform: translateY(0) rotate(0); }

.level .level-heading > * { opacity: 0; transform: translateY(20px); transition: opacity 0.8s var(--easing-out), transform 0.8s var(--easing-out); }
.level.in .level-heading > * { opacity: 1; transform: translateY(0); }
.level.in .level-kicker { transition-delay: 0.1s; }
.level.in .level-title { transition-delay: 0.2s; }
.level.in .level-tagline { transition-delay: 0.3s; }

.level .level-def { opacity: 0; transform: translateX(-20px); transition: opacity 0.9s var(--easing-out) 0.3s, transform 0.9s var(--easing-out) 0.3s; }
.level.in .level-def { opacity: 1; transform: translateX(0); }

.level .level-grid > .grid-col { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--easing-out), transform 0.8s var(--easing-out); }
.level.in .level-grid > .grid-col:nth-child(1) { transition-delay: 0.4s; }
.level.in .level-grid > .grid-col:nth-child(2) { transition-delay: 0.55s; }
.level.in .level-grid > .grid-col:nth-child(3) { transition-delay: 0.7s; }
.level.in .level-grid > .grid-col { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .level-head { grid-template-columns: 1fr; }
  .level-numeral { font-size: clamp(100px, 22vw, 200px); }
  .level-grid { grid-template-columns: 1fr; gap: 30px; }
  .cr-row { grid-template-columns: 60px 1fr 1fr; font-size: 13px; }
  .ent-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
  .masthead { grid-template-columns: auto 1fr auto; font-size: 9px; padding: 10px 12px; gap: 8px; }
  .masthead-col.left { font-size: 9px; }
  .masthead-col.left .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 88px; }
  .masthead-col.center { display: flex; justify-self: center; }
  .masthead-nav { gap: 8px; }
  .masthead-link { font-size: 9px; letter-spacing: 0.12em; }
  .masthead .folio { display: none; }
  .hero { padding: 60px 20px 20px; }
  .hero-stat { grid-template-columns: 1fr; gap: 20px; text-align: left; }
  .hero-ctas { flex-direction: column; }
  .hero-cta { width: 100%; }
  .prologue-grid { grid-template-columns: 1fr; }
  .prologue-meta { border-right: none; border-bottom: 1px solid var(--line); padding: 0 0 20px; position: static; }
  .principles-list li { grid-template-columns: 1fr; gap: 10px; }
  .cr-row { grid-template-columns: 50px 1fr; }
  .cr-row > div:last-child { grid-column: 2; }
  .cr-row.cr-head > div:last-child { display: none; }
  .ent-grid { grid-template-columns: 1fr; }
  .ent-pricing { grid-template-columns: 1fr; }
  .colophon-grid { grid-template-columns: 1fr 1fr; }
  .colophon-mark { flex-direction: column; gap: 8px; }
  .cert-footer { grid-template-columns: 1fr; text-align: center; gap: 20px; }
  .cert-sign, .cert-serial { text-align: center; }
  .share-bar { flex-direction: column; }
  .share-btn { min-width: 0; }
  /* Pyramid smaller widths */
  .tier[data-rank="9"] { width: 42%; }
  .tier[data-rank="8"] { width: 50%; }
  .tier[data-rank="7"] { width: 58%; }
  .tier[data-rank="6"] { width: 66%; }
  .tier[data-rank="5"] { width: 74%; }
  .tier[data-rank="4"] { width: 82%; }
  .tier[data-rank="3"] { width: 90%; }
  .tier[data-rank="2"] { width: 96%; }
  .tier[data-rank="1"] { width: 100%; }
  .tier-inner { flex-direction: column; gap: 2px; align-items: center; }
  .tier-num { min-width: 0; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .grain { display: none; }
}
/* ═══════════════════════════════════════════════════════════
   GLOBAL HEADER & FOOTER
   ═══════════════════════════════════════════════════════════ */
.global-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10000;
  background: rgba(244, 241, 237, 0.85); /* var(--lp-bg) based */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0 var(--gutter);
}
.gh-container {
  max-width: var(--max-w); margin: 0 auto;
  height: 70px; display: flex; align-items: center; justify-content: space-between;
}
.gh-logo {
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  letter-spacing: 0.05em; color: var(--ink); text-decoration: none;
}
.gh-right {
  display: flex; align-items: center; gap: 24px;
}
.gh-link {
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--ink-soft); text-decoration: none; transition: color 0.2s;
}
.gh-link:hover { color: var(--accent); }
.gh-btn {
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  background: var(--ink); color: var(--paper) !important;
  padding: 8px 16px; border-radius: 4px; text-decoration: none;
  transition: background 0.2s;
}
.gh-btn:hover { background: var(--accent); }

.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 30px; height: 30px; background: transparent; border: none; cursor: pointer; z-index: 10006; }
.hamburger span { width: 100%; height: 2px; background: var(--ink); border-radius: 2px; transition: all 0.3s; }
.hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 800px) {
  .hamburger { display: flex; margin-left: 16px; }
  .gh-right {
    position: fixed; top: 0; left: 0; right: 0; padding: 100px 24px 40px;
    background: var(--paper); border-bottom: 1px solid var(--border);
    flex-direction: column; gap: 24px;
    transform: translateY(-100%); opacity: 0; pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  }
  .gh-right.is-active {
    transform: translateY(0); opacity: 1; pointer-events: auto;
  }
  .gh-link { font-size: 18px; width: 100%; text-align: center; }
  .gh-btn { width: 100%; text-align: center; font-size: 16px; padding: 16px; }
  /* 言語切り替え用要素強制非表示 */
}
.lang-switch-float, .lang-switch { display: none !important; }

/* Base adjustment for fixed header */
body { padding-top: 70px; }

/* Global Footer */
.global-footer {
  background: var(--ink); color: var(--paper);
  padding: 80px var(--gutter) 40px; font-family: var(--font-body);
}
.gf-container {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 40px;
  margin-bottom: 24px;
}
.gf-col h4 {
  font-family: var(--font-display); font-size: 16px; font-weight: 600;
  margin-bottom: 16px; letter-spacing: 0.1em; color: var(--brass-soft);
}
.gf-col p { font-size: 14px; color: var(--ink-ghost); }
.gf-col nav { display: flex; flex-direction: column; gap: 12px; }
.gf-col nav a {
  font-size: 14px; color: rgba(255,255,255,0.7); text-decoration: none;
  transition: color 0.2s;
}
.gf-col nav a:hover { color: var(--paper); }
.gf-bottom { text-align: center; font-size: 12px; color: rgba(255,255,255,0.4); }

/* =========================================================================
   BLOG INDEX & SEARCH
   ========================================================================= */
.page-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 140px 24px 100px;
  min-height: 100vh;
}
.page-header {
  margin-bottom: 60px;
  text-align: center;
}
.page-title {
  font-family: var(--font-ja);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 40px;
}
/* Search Box */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}
.search-input {
  width: 100%;
  padding: 16px 20px 16px 50px;
  font-size: 1.1rem;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 161, 74, 0.2);
}
.search-icon {
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}
.search-highlight {
  background: var(--accent);
  color: #fff;
  padding: 0 2px;
  border-radius: 2px;
}

/* Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border-color: var(--accent-hover);
}
.card-image-wrap {
  width: 100%;
  aspect-ratio: 1200 / 630;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.article-card:hover .card-image {
  transform: scale(1.03);
}
.card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.card-date {
  color: var(--accent);
  margin-bottom: 12px;
}
.card-title {
  font-family: var(--font-ja);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-excerpt {
  flex-grow: 1;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Tags ─── */
.tags-filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
}
.filter-tag {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}
.filter-tag:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.filter-tag.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.card-tag {
  background: rgba(139, 37, 20, 0.05);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid rgba(139, 37, 20, 0.1);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.article-tag {
  display: inline-block;
  background: var(--highlight);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* ─── Search Input in Blog Index ─── */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto 20px;
}
.search-input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  border-radius: 50px;
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  outline: none;
}
.search-input:hover {
  border-color: var(--ink);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(139, 37, 20, 0.12);
}
.search-input::placeholder {
  color: var(--ink-ghost);
}
.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

/* ─── Author Profile Component (E-E-A-T) ─── */
.author-profile-box {
  margin-top: 64px;
  padding: 40px;
  background: var(--lp-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}
.author-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.author-info {
  display: flex;
  flex-direction: column;
}
.author-title {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}
.author-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
}
.author-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--ink-soft);
  margin: 0;
}
@media (max-width: 600px) {
  .author-profile-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px;
  }
}

/* ─── Breadcrumbs ─── */
.breadcrumbs {
  margin-bottom: 32px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.breadcrumbs li {
  display: flex;
  align-items: center;
}
.breadcrumbs li:not(:last-child)::after {
  content: '>';
  margin-left: 8px;
  font-family: var(--font-en);
  opacity: 0.5;
}
.breadcrumbs a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumbs a:hover {
  color: var(--accent);
}
.breadcrumbs li[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  /* Truncate long titles */
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 600px) {
  .breadcrumbs li[aria-current="page"] { max-width: 120px; }
}

/* ─── Company Info Footer ─── */
 .gf-col-company { grid-column: span 2; }
 .company-info-dl {
   display: grid;
   grid-template-columns: 70px 1fr;
   gap: 8px 12px;
   font-size: 13px;
   color: rgba(255,255,255,0.7);
   line-height: 1.5;
   margin-top: 16px;
 }
 .company-info-dl dt { color: var(--brass-soft); font-weight: 500; }
 .company-info-dl dd { margin: 0; }
 @media (max-width: 780px) {
   .gf-col-company { grid-column: 1 / -1; }
 }




.svc-card {
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
}
html.dark .svc-card {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.svc-card:hover { transform: translateY(-4px); }

.svc-title {
  padding: 16px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: 0.5px;
}
html.dark .svc-title { font-weight: 600; }

.svc-val {
  padding: 24px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-ink);
  margin: 0;
  background: var(--color-surface);
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Specific colors matching the provided image */









.ent-sub-heading {
  font-family: 'Bricolage Grotesque', 'Shippori Mincho B1', sans-serif;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--color-ink);
  margin: 60px 0 24px;
}
html.dark .ent-sub-heading {
  color: #fff;
}





.svc-card {
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-top-width: 6px; /* Thick accent border on top */
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
}
html.dark .svc-card {
  background: #14110E; /* Deep dark background matching the dark mode body */
  border-color: #2A241E; /* Subtle border */
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.svc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
html.dark .svc-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
}

.svc-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px 0;
  letter-spacing: 0.5px;
}

.svc-val {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-ink);
  margin: 0;
  line-height: 1.6;
}

/* Accent colors applied to top border and title text */
.svc-blue { border-top-color: #3B82F6; }
.svc-blue .svc-title { color: #2563EB; }
html.dark .svc-blue { border-top-color: #60A5FA; }
html.dark .svc-blue .svc-title { color: #60A5FA; }

.svc-green { border-top-color: #10B981; }
.svc-green .svc-title { color: #059669; }
html.dark .svc-green { border-top-color: #34D399; }
html.dark .svc-green .svc-title { color: #34D399; }

.svc-orange { border-top-color: #F59E0B; }
.svc-orange .svc-title { color: #D97706; }
html.dark .svc-orange { border-top-color: #FBBF24; }
html.dark .svc-orange .svc-title { color: #FBBF24; }

.svc-purple { border-top-color: #8B5CF6; }
.svc-purple .svc-title { color: #7C3AED; }
html.dark .svc-purple { border-top-color: #A78BFA; }
html.dark .svc-purple .svc-title { color: #A78BFA; }





/* Glassmorphism specifically for Dark Mode */
html.dark .svc-card {
  background: rgba(255, 255, 255, 0.035); /* Elegant glass tint */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle glowing rim */
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
html.dark .svc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.svc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.svc-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px 0;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 2;
}
html.dark .svc-title {
  color: #fff;
}

.svc-val {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-ink);
  margin: 0;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}
html.dark .svc-val {
  color: rgba(255, 255, 255, 0.75);
}

/* Glow gradient pseudo-element */
.svc-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120px;
  z-index: 1;
  opacity: 0.5; /* Always show slight glow in dark mode */
  transition: opacity 0.4s ease;
  border-top: 2px solid transparent;
  pointer-events: none;
}
/* In light mode, hide glow unless hovered, and don't use translucent grad */
.svc-card::before {
  opacity: 0;
}
html.dark .svc-card::before {
  opacity: 0.3;
}
html.dark .svc-card:hover::before {
  opacity: 1; /* Brighten glow on hover */
}

/* ─── Light mode standard borders ─── */
.svc-blue { border-top-color: #3B82F6; border-top-width: 4px; }
.svc-green { border-top-color: #10B981; border-top-width: 4px; }
.svc-orange { border-top-color: #F59E0B; border-top-width: 4px; }
.svc-purple { border-top-color: #8B5CF6; border-top-width: 4px; }

/* ─── Dark mode glow logic ─── */
html.dark .svc-blue { border-top-width: 1px; }
html.dark .svc-blue::before {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.15) 0%, transparent 100%);
  border-top-color: rgba(59, 130, 246, 0.8);
}
html.dark .svc-blue:hover { border-color: rgba(59, 130, 246, 0.4); }

html.dark .svc-green { border-top-width: 1px; }
html.dark .svc-green::before {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.15) 0%, transparent 100%);
  border-top-color: rgba(16, 185, 129, 0.8);
}
html.dark .svc-green:hover { border-color: rgba(16, 185, 129, 0.4); }

html.dark .svc-orange { border-top-width: 1px; }
html.dark .svc-orange::before {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.15) 0%, transparent 100%);
  border-top-color: rgba(245, 158, 11, 0.8);
}
html.dark .svc-orange:hover { border-color: rgba(245, 158, 11, 0.4); }

html.dark .svc-purple { border-top-width: 1px; }
html.dark .svc-purple::before {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.15) 0%, transparent 100%);
  border-top-color: rgba(139, 92, 246, 0.8);
}
html.dark .svc-purple:hover { border-color: rgba(139, 92, 246, 0.4); }

