/* Shinobu site. Tokens mirror DESIGN.md (dark theme). */
:root {
  --bg: #0d0d0f;
  --surface: #17171a;
  --surface2: #222226;
  --line: #2a2a2f;
  --ink: #f2f1ee;
  --ink2: #a6a5ab;
  --ink3: #85848a;
  --shu: #c8442b;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Shippori Mincho B1', 'Hiragino Mincho ProN', Georgia, serif;
  --gutter: 20px;
  --max: 680px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--ink3); }
a:hover { text-decoration-color: var(--ink); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--gutter); max-width: 1080px; margin: 0 auto;
  position: relative; z-index: 2;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.brand img { width: 28px; height: 28px; }
.wordmark { font-weight: 600; font-size: 14px; letter-spacing: 0.32em; }
.top nav { display: flex; gap: 4px; }
.top nav a {
  color: var(--ink2); text-decoration: none; font-size: 14px;
  padding: 12px 10px; min-height: 44px; display: inline-flex; align-items: center;
}
.top nav a:hover, .top nav a[aria-current='page'] { color: var(--ink); }

/* Hero */
/* The scene is the app's Today night sky: back layer, a rising moon, then the front ridge.
   Its upper (empty sky) part tucks behind the hero text. */
.hero { position: relative; overflow: hidden; }
.hero-body {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 5vh var(--gutter) 24px;
}
.scene {
  --w: min(100vw, 920px);
  position: relative; width: var(--w); aspect-ratio: 1170 / 1176;
  margin: calc(var(--w) * -0.5) auto 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 12%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 12%);
}
.scene img { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 22%;
  background: linear-gradient(to bottom, rgba(13,13,15,0), var(--bg));
}
.moon {
  position: absolute; left: 50%; top: 66.5%;
  width: 8.4%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: #f4f3ef;
  box-shadow: 0 0 24px 6px rgba(244,243,239,0.16), 0 0 120px 50px rgba(160,180,210,0.09);
  animation: rise 2.6s 0.2s var(--ease) both;
}
@keyframes rise { from { transform: translate(-50%, 40%); opacity: 0.4; } to { transform: translate(-50%, -50%); opacity: 1; } }
.hero-mark { width: 112px; height: 112px; animation: fade 1s var(--ease) both; }
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 6.4vw, 48px); line-height: 1.25; letter-spacing: -0.01em;
  margin: 28px 0 12px; max-width: 16ch;
  animation: fade 1s 0.15s var(--ease) both;
}
.hero p.lede {
  color: var(--ink2); font-size: 17px; margin: 0 0 32px; max-width: 34ch;
  animation: fade 1s 0.3s var(--ease) both;
}
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 14px;
  font: 600 16px/1 var(--sans); text-decoration: none;
  background: var(--shu); color: #fff;
  animation: fade 1s 0.45s var(--ease) both;
}
.btn svg { width: 20px; height: 20px; }
.btn.soon { background: rgba(242,241,238,0.08); color: var(--ink); border: 1px solid rgba(242,241,238,0.16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn-note { color: var(--ink3); font-size: 13px; margin-top: 12px; animation: fade 1s 0.5s var(--ease) both; }

/* Sections */
.steps { padding: 0 0 24px; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 0 16px; padding: 28px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step-n { font-family: var(--serif); font-weight: 500; font-size: 32px; line-height: 1.1; color: var(--ink3); font-variant-numeric: tabular-nums; }
.step h2 { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -0.2px; margin: 2px 0 6px; }
.step p { margin: 0; color: var(--ink2); }

.private {
  margin: 24px 0 72px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface);
}
.private h2 { font-size: 20px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.2px; }
.private p { margin: 0; color: var(--ink2); }

blockquote.teaching {
  margin: 0 0 80px; text-align: center;
  font-family: var(--serif); font-weight: 500; font-size: 21px; line-height: 1.5; color: var(--ink);
}
blockquote.teaching .kanji { display: block; font-size: 56px; line-height: 1.2; }
blockquote.teaching cite { display: block; margin-top: 10px; font: 400 14px/1.4 var(--sans); color: var(--ink3); font-style: normal; }

/* Document pages */
.doc { padding-top: 24px; padding-bottom: 72px; }
.doc h1 { font-size: 34px; line-height: 1.2; letter-spacing: -0.8px; font-weight: 600; margin: 16px 0 8px; }
.doc .meta { color: var(--ink3); font-size: 14px; margin: 0 0 32px; }
.doc .summary { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin: 0 0 32px; }
.doc .summary p { margin: 0 0 8px; }
.doc .summary ul { margin: 0; padding-left: 20px; color: var(--ink2); }
.doc h2 { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -0.2px; margin: 40px 0 8px; }
.doc h3 { font-size: 16px; font-weight: 600; margin: 24px 0 4px; }
.doc p, .doc li { color: var(--ink2); }
.doc strong { color: var(--ink); font-weight: 600; }
.doc ul { padding-left: 20px; }
.doc li { margin: 4px 0; }

.contact {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px 24px; margin: 8px 0 8px;
}
.contact p { margin: 0; }
.contact .label { color: var(--ink2); font-size: 14px; }
.contact a.email { font-weight: 600; font-size: 18px; text-decoration: none; }
.btn.small { min-height: 44px; padding: 0 18px; font-size: 16px; animation: none; background: var(--surface2); color: var(--ink); }

details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary {
  cursor: pointer; list-style: none; padding: 16px 32px 16px 0; min-height: 44px; position: relative;
  font-weight: 600; color: var(--ink);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ''; position: absolute; right: 6px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 1.5px solid var(--ink2); border-bottom: 1.5px solid var(--ink2); transform: rotate(45deg);
  transition: transform 150ms var(--ease);
}
details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
details > div { padding: 0 0 16px; }
details > div p { margin: 0 0 8px; }

.help { margin-top: 40px; padding: 20px 24px; border-radius: 20px; border: 1px solid var(--line); }
.help h2 { margin-top: 0; }

/* Footer */
footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding-top: 24px; padding-bottom: 40px; }
footer nav { display: flex; flex-wrap: wrap; gap: 0 4px; margin-left: -10px; }
footer nav a { color: var(--ink2); text-decoration: none; font-size: 14px; padding: 12px 10px; }
footer nav a:hover { color: var(--ink); }
footer small { color: var(--ink3); font-size: 13px; }

@media (min-width: 720px) {
  .scene {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent), linear-gradient(to bottom, transparent, #000 12%);
    mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent), linear-gradient(to bottom, transparent, #000 12%);
  }
  .hero-mark { width: 128px; height: 128px; }
  .step { grid-template-columns: 72px 1fr; padding: 32px 0; }
  .step-n { font-size: 40px; }
}
@media (max-width: 380px) {
  .wordmark { letter-spacing: 0.24em; }
  .top nav a { padding: 12px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
