:root {
    --ink:       #2d2d2d;
    --ink-soft:  #3a3a3a;
    --surface:   #f2f2f0;
    --card:      #ffffff;
    --accent:    #f5c800;   /* 表紙イエロー */
    --accent2:   #c89600;   /* イエロー濃いめ */
    --accent3:   #2d2d2d;   /* CTA ダークグレー */
    --muted:     #888888;
    --line:      #ddddd8;
    --radius:    12px;
    --mono:      'Roboto Mono', monospace;
    --sans:      'Noto Sans JP', sans-serif;
    --display:   'Syne', sans-serif;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  html { scroll-behavior: smooth; }

  body {
    font-family: var(--sans);
    background: var(--surface);
    color: var(--ink);
    line-height: 1.7;
    overflow-x: hidden;
  }

  /* ── HEADER ── */
  header {
    position: sticky; top: 0; z-index: 100;
    background: #2d2d2d;
    border-bottom: 3px solid var(--accent);
    padding: 0 clamp(1.5rem, 6vw, 6rem);
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
  }
  .logo {
    font-family: var(--display);
    font-size: 1rem; font-weight: 800;
    color: #fff; letter-spacing: .04em;
    display: flex; align-items: center; gap: .5rem;
    text-decoration: none;
  }
  .logo-badge {
    background: var(--accent);
    color: var(--ink); font-size: .65rem; font-weight: 700;
    padding: 2px 7px; border-radius: 3px;
    letter-spacing: .08em;
  }
  nav { display: flex; gap: 2rem; }
  nav a {
    color: #aaaaaa; text-decoration: none;
    font-size: .875rem; font-weight: 500;
    transition: color .2s;
  }
  nav a:hover { color: var(--accent); }

  /* ── HERO ── */
  .hero {
    background: #2d2d2d;
    padding: clamp(4rem, 10vw, 7rem) clamp(1.5rem, 6vw, 6rem);
    position: relative; overflow: hidden;
  }
  .hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
      radial-gradient(ellipse 60% 60% at 80% 50%, rgba(245,200,0,.14) 0%, transparent 70%),
      radial-gradient(ellipse 40% 80% at 10% 80%, rgba(245,200,0,.07) 0%, transparent 60%);
    pointer-events: none;
  }
  /* grid lines */
  .hero::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(245,200,0,.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(245,200,0,.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
  }
  .hero-inner {
    position: relative; z-index: 1;
    max-width: 960px;
    margin: 0 auto;
  }
  .hero-eyebrow {
    font-family: var(--mono);
    font-size: .75rem; letter-spacing: .15em;
    color: var(--accent); text-transform: uppercase;
    margin-bottom: 1.2rem;
  }
  .hero h1 {
    font-family: var(--display);
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 800; line-height: 1.15;
    color: #fff;
    margin-bottom: .8rem;
  }
  .hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--accent), #fff6a0);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  }
  .hero-sub {
    font-size: 1rem; color: #aaaaaa;
    max-width: 720px; margin-bottom: 2.4rem;
  }
  .hero-cta {
    display: inline-flex; align-items: center; gap: .6rem;
    background: var(--accent);
    color: #1a1a1a; font-weight: 700; font-size: .95rem;
    padding: .8rem 1.8rem; border-radius: 6px;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 20px rgba(245,200,0,.4);
  }
  .hero-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(245,200,0,.6); }
  .hero-cta-arrow { font-size: 1.1rem; }

  /* ── SECTION WRAPPER ── */
  .section {
    padding: clamp(3.5rem, 8vw, 6rem) clamp(1.5rem, 6vw, 6rem);
    max-width: 1400px;
    margin: 0 auto;
  }
  .section-title {
    font-family: var(--sans);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800; color: var(--ink);
    margin-bottom: .5rem;
  }
  .section-title span { color: var(--accent2); }
  .section-lead {
    font-size: .95rem; color: var(--muted);
    margin-bottom: 2.5rem;
  }
  .divider {
    width: 48px; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 2px;
    margin-bottom: 1rem;
  }

  /* ── LEVEL CARDS ── */
  .levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
  }
  .level-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem;
    position: relative; overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
  }
  .level-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.1); }
  .level-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
  }
  .lv1::before { background: #f5c800; }
  .lv2::before { background: #e0b400; }
  .lv3::before { background: #c89600; }
  .lv4::before { background: #1a1a1a; }

  .level-num {
    font-family: var(--mono);
    font-size: .7rem; letter-spacing: .12em;
    color: var(--muted); margin-bottom: .6rem;
    text-transform: uppercase;
  }
  .level-title {
    font-family: var(--sans);
    font-size: 1.15rem; font-weight: 800;
    color: var(--ink); margin-bottom: .5rem;
  }
  .level-desc { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
  .level-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
  .tag {
    font-family: var(--mono);
    font-size: .7rem;
    background: #f5f0d8;
    border: 1px solid #e8d880;
    padding: 2px 8px; border-radius: 4px;
    color: #5a4a00;
  }

  /* ── DOWNLOAD SECTION ── */
  .download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
  }
  .dl-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.6rem;
    display: flex; align-items: flex-start; gap: 1rem;
    transition: border-color .2s, box-shadow .2s;
    text-decoration: none; color: inherit;
  }
  .dl-card:hover { border-color: var(--accent); box-shadow: 0 4px 20px rgba(245,200,0,.2); }
  .dl-icon {
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
  }
  .dl-icon.js   { background: #fef9d0; }
  .dl-icon.rest { background: #fef3a0; }
  .dl-icon.zip  { background: #fde87a; }
  .dl-icon.pdf  { background: #f5d800; }
  .dl-meta { flex: 1; }
  .dl-name { font-weight: 700; font-size: .95rem; margin-bottom: .25rem; color: var(--ink); }
  .dl-info { font-size: .8rem; color: var(--muted); }
  .dl-badge {
    font-family: var(--mono);
    font-size: .65rem; background: #1a1a1a;
    color: #f5c800; padding: 2px 7px;
    border-radius: 3px; white-space: nowrap; align-self: center;
  }

  /* ── TIPS STRIP ── */
  .tips-strip {
    background: #3a3a3a;
    padding: clamp(3rem, 6vw, 4.5rem) clamp(1.5rem, 6vw, 6rem);
  }
  .tips-inner { max-width: 1400px; margin: 0 auto; }
  .tips-header .section-title { color: #fff; }
  .tips-header .section-lead  { color: #aaa; }
  .tips-header .divider { background: linear-gradient(90deg, var(--accent), #fff6a0); }

  .tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
  }
  .tip-card {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(245,200,0,.18);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: background .2s, border-color .2s;
  }
  .tip-card:hover { background: rgba(245,200,0,.10); border-color: rgba(245,200,0,.4); }
  .tip-icon { font-size: 1.6rem; margin-bottom: .8rem; }
  .tip-title { font-weight: 700; color: #fff; margin-bottom: .4rem; }
  .tip-body  { font-size: .85rem; color: #aaa; }

  /* ── FAQ ── */
  .faq-list { display: flex; flex-direction: column; gap: .75rem; max-width: 780px; }
  details {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
  }
  summary {
    padding: 1.1rem 1.4rem;
    font-weight: 600; font-size: .93rem;
    cursor: pointer; list-style: none;
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem;
    transition: background .2s;
    color: var(--ink);
  }
  summary:hover { background: #fef9d0; }
  summary::after {
    content: '+'; font-size: 1.2rem;
    color: var(--accent2); flex-shrink: 0;
    transition: transform .2s;
  }
  details[open] summary::after { transform: rotate(45deg); }
  .faq-body {
    padding: 0 1.4rem 1.2rem;
    font-size: .88rem; color: var(--muted);
    line-height: 1.75;
  }

  /* ── LINKS FOOTER ── */
  .links-section {
    background: #3a3a3a;
    padding: clamp(3rem, 6vw, 4rem) clamp(1.5rem, 6vw, 6rem);
  }
  .links-inner { max-width: 1400px; margin: 0 auto; }
  .links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem; margin-top: 2rem;
  }
  .links-group h4 {
    font-family: var(--mono);
    font-size: .72rem; letter-spacing: .1em;
    color: var(--accent); text-transform: uppercase;
    margin-bottom: 1rem;
  }
  .links-group ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
  .links-group a {
    font-size: .88rem; color: #aaa;
    text-decoration: none; transition: color .2s;
  }
  .links-group a:hover { color: var(--accent); }

  /* ── SITE FOOTER ── */
  footer {
    background: #2d2d2d;
    border-top: 2px solid var(--accent);
    padding: 1.5rem clamp(1.5rem, 6vw, 6rem);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
  }
  .footer-copy { font-size: .78rem; color: #888; }
  .footer-note { font-family: var(--mono); font-size: .7rem; color: #666; }

  /* ── ANIMATIONS ── */
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .hero-inner > * {
    opacity: 0; animation: fadeUp .6s forwards;
  }
  .hero-eyebrow { animation-delay: .1s; }
  .hero h1      { animation-delay: .22s; }
  .hero-sub     { animation-delay: .34s; }
  .hero-cta     { animation-delay: .46s; }
  .hero-stats   { animation-delay: .58s; }

  /* ── RESPONSIVE ── */
  @media (max-width: 860px) {
    #book .section > div[style*="grid-template-columns:200px"] {
      grid-template-columns: 1fr 1fr !important;
    }
    #book .section > div > div:first-child {
      grid-column: 1 / -1;
      flex-direction: row !important;
      align-items: flex-start;
      gap: 1.5rem;
    }
    #book .section > div > div:first-child img {
      max-width: 140px !important;
    }
  }
  @media (max-width: 640px) {
    nav { display: none; }
    .hero-stats { gap: 1.5rem; flex-wrap: wrap; }
    .stat-num   { font-size: 1.4rem; }
    #book .section > div[style*="grid-template-columns:200px"] {
      grid-template-columns: 1fr !important;
    }
  }
