/* =========================================================
   CRAFT — Claude Code School
   Tokens & values follow DESIGN.md (single source of truth)
   ========================================================= */

:root {
  /* color */
  --ink: #1F1B17;
  --ink-soft: #5C5349;
  --ink-faint: #8A8076;
  --paper: #F7F3EC;
  --paper-2: #FBF8F2;
  --paper-3: #EFE8DC;
  --clay: #C9603A;
  --clay-deep: #A84A2A;
  --clay-tint: #F0DDD2;
  --line: #E2D9CB;
  --ink-invert: #16130F;

  /* type */
  --serif: "Shippori Mincho", "Times New Roman", serif;
  --serif-en: "Fraunces", Georgia, serif;
  --sans: "Zen Kaku Gothic New", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", monospace;

  --fs-hero: clamp(2.6rem, 6vw, 4.75rem);
  --fs-h2: clamp(1.9rem, 3.6vw, 2.9rem);
  --fs-h3: clamp(1.25rem, 2vw, 1.55rem);
  --fs-lead: clamp(1.05rem, 1.4vw, 1.2rem);
  --fs-cap: 0.82rem;

  /* layout */
  --container: 1120px;
  --container-narrow: 760px;
  --section-y: clamp(5rem, 11vh, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);

  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(31,27,23,.05);
  --shadow-md: 0 14px 40px -18px rgba(31,27,23,.22);
  --shadow-lg: 0 40px 90px -40px rgba(31,27,23,.32);

  --ease: cubic-bezier(.16,1,.3,1);
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.9;
  font-size: 1rem;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--clay-tint); color: var(--clay-deep); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 4px; }
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--paper-3); }
::-webkit-scrollbar-thumb { background: #cdbfa9; border-radius: 99px; border: 3px solid var(--paper-3); }

/* paper grain texture (subtle) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .5;
  background-image: radial-gradient(rgba(31,27,23,.025) 1px, transparent 1px);
  background-size: 4px 4px;
}

/* ---------- layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.2rem, 4vw, 2rem); }
.narrow { max-width: var(--container-narrow); }
.center { text-align: center; }
.section { padding-block: var(--section-y); }
.section.alt { background: var(--paper-3); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
h2 { font-size: var(--fs-h2); line-height: 1.18; }
h3 { font-size: var(--fs-h3); line-height: 1.4; }
em { font-style: normal; color: var(--clay); }
p { color: var(--ink-soft); }

.eyebrow {
  font-family: var(--mono); font-size: var(--fs-cap); letter-spacing: .18em;
  text-transform: uppercase; color: var(--clay-deep); margin-bottom: 1.1rem;
}
.eyebrow.light { color: #E6A07F; }
.lead { font-size: var(--fs-lead); line-height: 1.85; color: var(--ink-soft); }
.section .narrow.center + .container { margin-top: clamp(2.5rem, 5vw, 4rem); }
.section .narrow.center h2 + .lead { margin-top: 1.1rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--sans); font-weight: 700; font-size: .95rem; line-height: 1;
  padding: .85em 1.6em; border-radius: var(--radius-pill);
  background: var(--clay); color: #fff; border: 1.5px solid var(--clay);
  cursor: pointer; transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.btn:hover { background: var(--clay-deep); border-color: var(--clay-deep); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-sm { padding: .6em 1.1em; font-size: .85rem; }
.btn-lg { padding: 1.05em 2em; font-size: 1.02rem; }
.btn-block { display: flex; width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { background: var(--paper-2); border-color: var(--ink); color: var(--ink); }
.btn-light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-light:hover { background: #fff; border-color: #fff; }
.btn-ghost-light { background: transparent; color: var(--paper); border-color: rgba(247,243,236,.3); box-shadow: none; }
.btn-ghost-light:hover { background: rgba(247,243,236,.08); border-color: rgba(247,243,236,.6); color: #fff; }

/* =========================================================
   Header / Nav
   ========================================================= */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(247,243,236,.85); backdrop-filter: blur(12px) saturate(1.2);
  border-bottom-color: var(--line);
}
.nav { display: flex; align-items: center; gap: 1.5rem; height: 76px; }
.brand { display: flex; align-items: baseline; gap: .5rem; }
.brand-mark { color: var(--clay); font-size: 1.1rem; transform: translateY(1px); }
.brand-name { font-family: var(--serif-en); font-weight: 600; font-size: 1.3rem; letter-spacing: .04em; }
.brand-sub { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; color: var(--ink-faint); }
.nav-links { display: flex; gap: 1.7rem; margin-left: auto; }
.nav-links a { font-size: .92rem; font-weight: 500; color: var(--ink-soft); position: relative; transition: color .2s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px; width: 0; height: 1.5px;
  background: var(--clay); transition: width .3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav .btn { margin-left: .25rem; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; margin-left: auto; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: transform .3s var(--ease), opacity .3s; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   Hero
   ========================================================= */
.hero { position: relative; padding-top: clamp(8rem, 16vh, 11rem); padding-bottom: clamp(4rem, 9vh, 7rem); overflow: hidden; }
.hero-glow {
  position: absolute; top: -10%; right: -5%; width: 60vw; height: 60vw; max-width: 720px; max-height: 720px;
  background: radial-gradient(circle, rgba(201,96,58,.16), transparent 62%);
  filter: blur(10px); z-index: 0; animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate(0,0) scale(1); } to { transform: translate(-4%, 4%) scale(1.08); } }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-title { font-size: var(--fs-hero); line-height: 1.08; letter-spacing: -.02em; font-weight: 700; }
.hero-title em { display: inline-block; }
.hero .lead { margin-top: 1.6rem; max-width: 32ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2.2rem; }
.hero-note { font-family: var(--mono); font-size: var(--fs-cap); letter-spacing: .06em; color: var(--ink-faint); margin-top: 1.8rem; }

/* terminal */
.terminal {
  background: #1c1814; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; border: 1px solid rgba(255,255,255,.06); transform: rotate(.4deg);
  transition: transform .5s var(--ease);
}
.terminal:hover { transform: rotate(0deg) translateY(-4px); }
.terminal-bar { display: flex; align-items: center; gap: .5rem; padding: .85rem 1.1rem; background: #251f1a; border-bottom: 1px solid rgba(255,255,255,.05); }
.terminal-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: #4a4039; }
.terminal-bar .dot:first-child { background: #C9603A; }
.terminal-bar .dot:nth-child(2) { background: #c9a23a; }
.terminal-bar .dot:nth-child(3) { background: #6f9e5a; }
.terminal-title { margin-left: auto; font-family: var(--mono); font-size: .72rem; color: #8a8076; letter-spacing: .03em; }
.terminal-body { padding: 1.4rem 1.3rem 1.6rem; font-family: var(--mono); font-size: .86rem; line-height: 2.1; min-height: 240px; }
.terminal-body .line { color: #d8cfc3; }
.terminal-body .prompt { color: #C9603A; margin-right: .4rem; }
.terminal-body .cmd { color: #f4ede2; }
.caret { color: #C9603A; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.terminal-body .out { opacity: 0; transform: translateY(4px); transition: opacity .4s var(--ease), transform .4s var(--ease); color: #a89e90; }
.terminal-body .out.show { opacity: 1; transform: none; }
.terminal-body .out .ok { color: #7fb069; margin-right: .4rem; }
.terminal-body .out.done { color: #e8c9b8; margin-top: .5rem; }

/* =========================================================
   Trust strip
   ========================================================= */
.trust { background: var(--ink-invert); color: var(--paper); padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem; position: relative; }
.stat:not(:last-child)::after { content: ""; position: absolute; right: -.5rem; top: 15%; bottom: 15%; width: 1px; background: rgba(247,243,236,.12); }
.stat-num { font-family: var(--serif-en); font-size: clamp(2.2rem, 4.5vw, 3.2rem); font-weight: 600; color: var(--paper); line-height: 1; }
.stat-num small { font-size: .5em; color: var(--clay); }
.stat-label { font-size: .82rem; color: #a89e90; line-height: 1.4; }

/* =========================================================
   Problem
   ========================================================= */
.problem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.problem-card { padding: 2rem 1.8rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); position: relative; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.problem-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.problem-no { font-family: var(--serif-en); font-size: 1.1rem; color: var(--clay); letter-spacing: .05em; }
.problem-card h3 { margin: .8rem 0 .7rem; font-size: 1.2rem; line-height: 1.5; }
.problem-card p { font-size: .95rem; }
.accent-rule { margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line); position: relative; }
.accent-rule::before { content: "鑿"; position: absolute; top: -.95em; left: 50%; transform: translateX(-50%); background: var(--paper); padding: 0 .6rem; font-family: var(--serif); color: var(--clay); font-size: 1.4rem; }
.section.alt .accent-rule::before { background: var(--paper-3); }

/* =========================================================
   Pillars
   ========================================================= */
.pillars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.pillar { padding: 2.4rem 2rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s; }
.pillar:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--clay-tint); }
.pillar-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: var(--clay-tint); color: var(--clay-deep); margin-bottom: 1.4rem; }
.pillar-icon svg { width: 30px; height: 30px; }
.pillar h3 { margin-bottom: .7rem; }
.pillar p { font-size: .96rem; }

/* =========================================================
   Curriculum timeline
   ========================================================= */
.timeline { list-style: none; position: relative; margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-left: 1.5rem; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--clay), var(--line)); }
.tl-item { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 1.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: none; }
.tl-item::before { content: ""; position: absolute; left: -1.5rem; top: 1.9rem; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--clay); transform: translateX(-5px); }
.tl-week { font-family: var(--mono); font-size: .82rem; letter-spacing: .04em; color: var(--clay-deep); padding-top: .15rem; font-weight: 500; }
.tl-body h3 { font-size: 1.22rem; margin-bottom: .4rem; }
.tl-body p { font-size: .95rem; }

/* =========================================================
   How it works
   ========================================================= */
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.how-card { padding: 2rem 1.8rem; text-align: center; }
.how-no { display: inline-block; font-family: var(--serif-en); font-size: 1.8rem; color: var(--clay); margin-bottom: .8rem; }
.how-card h3 { font-size: 1.18rem; margin-bottom: .7rem; }
.how-card p { font-size: .95rem; }

/* =========================================================
   Voices
   ========================================================= */
.voices-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.voice { padding: 2rem 1.9rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg); position: relative; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.voice:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.voice::before { content: "“"; font-family: var(--serif-en); font-size: 3.5rem; color: var(--clay-tint); position: absolute; top: .4rem; right: 1.1rem; line-height: 1; }
.voice blockquote { font-size: 1rem; line-height: 1.95; color: var(--ink); position: relative; z-index: 1; }
.voice figcaption { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.v-name { font-weight: 700; font-size: .95rem; }
.v-meta { font-size: .82rem; color: var(--ink-faint); }

/* =========================================================
   Pricing
   ========================================================= */
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); max-width: 880px; margin-inline: auto; }
.plan { padding: 2.6rem 2.2rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; position: relative; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.plan.featured { border-color: var(--clay); border-width: 1.5px; box-shadow: var(--shadow-md); }
.plan-badge { position: absolute; top: -.85rem; left: 50%; transform: translateX(-50%); background: var(--clay); color: #fff; font-size: .74rem; font-weight: 700; letter-spacing: .04em; padding: .4em 1em; border-radius: var(--radius-pill); white-space: nowrap; }
.plan-name { font-size: 1.4rem; margin-bottom: .4rem; }
.plan-desc { font-size: .92rem; margin-bottom: 1.3rem; }
.plan-price { font-family: var(--serif-en); font-size: 2.4rem; font-weight: 600; color: var(--ink); line-height: 1; margin-bottom: 1.6rem; }
.plan-price .yen { font-size: 1.3rem; margin-right: .15rem; }
.plan-price small { font-size: .8rem; font-family: var(--sans); color: var(--ink-faint); font-weight: 400; margin-left: .35rem; }
.plan-list { list-style: none; display: flex; flex-direction: column; gap: .85rem; margin-bottom: 2rem; flex: 1; }
.plan-list li { font-size: .94rem; color: var(--ink-soft); padding-left: 1.7rem; position: relative; }
.plan-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--clay); font-weight: 700; }
.plan-list strong { color: var(--ink); }
.note { font-size: .86rem; color: var(--ink-faint); margin-top: 1.8rem; }

/* =========================================================
   FAQ
   ========================================================= */
.faq-list { margin-top: clamp(2.5rem, 5vw, 3.5rem); display: flex; flex-direction: column; gap: .9rem; }
.faq { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .3s, box-shadow .3s; }
.faq[open] { border-color: var(--clay-tint); box-shadow: var(--shadow-sm); }
.faq summary { list-style: none; cursor: pointer; padding: 1.3rem 1.5rem; font-weight: 700; font-size: 1.02rem; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq-mark { position: relative; flex-shrink: 0; width: 18px; height: 18px; }
.faq-mark::before, .faq-mark::after { content: ""; position: absolute; background: var(--clay); border-radius: 2px; transition: transform .3s var(--ease); }
.faq-mark::before { top: 8px; left: 0; width: 18px; height: 2px; }
.faq-mark::after { top: 0; left: 8px; width: 2px; height: 18px; }
.faq[open] .faq-mark::after { transform: scaleY(0); }
.faq-a { padding: 0 1.5rem 1.4rem; }
.faq-a p { font-size: .95rem; color: var(--ink-soft); }

/* =========================================================
   Final CTA
   ========================================================= */
.cta-section { background: var(--ink-invert); color: var(--paper); padding-block: clamp(5rem, 11vh, 8rem); position: relative; overflow: hidden; }
.cta-section::before { content: ""; position: absolute; top: -30%; left: 50%; transform: translateX(-50%); width: 70vw; height: 70vw; max-width: 700px; max-height: 700px; background: radial-gradient(circle, rgba(201,96,58,.22), transparent 60%); }
.cta-section .container { position: relative; z-index: 1; }
.cta-title { color: var(--paper); }
.cta-lead { font-size: var(--fs-lead); color: #c9bfb2; margin-top: 1.3rem; max-width: 46ch; margin-inline: auto; }
.center-cta { justify-content: center; }
.cta-note { font-family: var(--mono); font-size: var(--fs-cap); letter-spacing: .06em; color: #8a8076; margin-top: 1.8rem; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer { background: var(--paper-3); padding-top: clamp(3rem, 6vw, 4rem); border-top: 1px solid var(--line); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; padding-bottom: 2.5rem; }
.footer-brand { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.footer-tag { width: 100%; font-size: .9rem; color: var(--ink-faint); margin-top: .6rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.footer-links a { font-size: .9rem; color: var(--ink-soft); transition: color .2s; }
.footer-links a:hover { color: var(--clay-deep); }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 1.5rem; }
.footer-bottom small { font-size: .8rem; color: var(--ink-faint); }

/* =========================================================
   Reveal animation
   ========================================================= */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 460px; }
  .hero .lead { max-width: none; }
  .problem-grid, .pillars-grid, .how-grid, .voices-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 480px; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav .btn-sm { display: none; }
  .nav-toggle { display: flex; }
  .site-header.menu-open { background: var(--paper); border-bottom-color: var(--line); }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 1.3rem; position: absolute; top: 76px; left: 0; right: 0;
    background: var(--paper); padding: 1.8rem clamp(1.2rem,4vw,2rem) 2.2rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
  }
  .trust-grid { grid-template-columns: 1fr 1fr; gap: 1.8rem 1rem; }
  .stat:nth-child(2)::after { display: none; }
  .problem-grid, .pillars-grid, .how-grid, .voices-grid { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 1fr; gap: .4rem; }
  .tl-item::before { top: 1.6rem; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-glow { animation: none; }
}
