/* Awesome Japanese — homepage theme
   Aesthetic: Japanese stationery / editorial. Washi paper, sumi ink, shu vermilion.
   Generated homepage; source lives in site/. */

:root {
  --washi: #f5f1e8;
  --washi-2: #efe8d8;
  --card: #fbf8f1;
  --sumi: #1c1a16;
  --sumi-soft: #4a4438;
  --muted: #837a69;
  --line: #e2d9c6;
  --line-soft: #ece4d4;
  --shu: #be3b2e;
  --shu-deep: #9c2f24;
  --ai: #284a6b;
  --maxw: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--washi);
  color: var(--sumi);
  font-family: "Zen Kaku Gothic New", system-ui, sans-serif;
  font-size: 16.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* faint paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* obi — thin vermilion band pinned to the very top */
.obi {
  position: fixed; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--shu), var(--shu-deep));
  z-index: 50;
}

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

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 92px 24px 56px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(190,59,46,.06), transparent 60%),
    radial-gradient(80% 70% at 0% 0%, rgba(40,74,107,.05), transparent 55%);
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; position: relative; z-index: 2; }

.hero-mark { margin-bottom: 26px; }
.seal {
  display: inline-grid; place-items: center;
  width: 58px; height: 58px;
  font-family: "Shippori Mincho", serif; font-weight: 700; font-size: 30px;
  color: var(--washi); background: var(--shu);
  border-radius: 10px;
  box-shadow: 0 6px 22px rgba(190,59,46,.28);
  transform: rotate(-4deg);
}

.kicker {
  margin: 0 0 14px;
  font-size: .8rem; letter-spacing: .42em; text-transform: uppercase;
  color: var(--shu-deep); font-weight: 700;
}
.hero-title {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 8.5vw, 5.6rem);
  line-height: 1.0;
  overflow-wrap: break-word;
  letter-spacing: -.01em;
  color: var(--sumi);
}
.hero-sub {
  margin: 20px 0 0;
  max-width: 30em;
  font-size: 1.12rem;
  color: var(--sumi-soft);
}

/* big faint kana watermark */
.hero-kana {
  position: absolute; right: -2vw; top: 50%; transform: translateY(-50%);
  font-family: "Shippori Mincho", serif;
  font-size: 36vw; line-height: 1;
  color: var(--shu);
  opacity: .05;
  z-index: 1; pointer-events: none; user-select: none;
}

/* TV immersion CTA */
.tv-cta {
  display: inline-flex; align-items: center; gap: 16px;
  margin-top: 34px;
  padding: 16px 22px 16px 18px;
  background: var(--sumi);
  color: var(--washi);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(28,26,22,.22);
  transition: transform .18s ease, box-shadow .18s ease;
  max-width: 100%;
}
.tv-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(28,26,22,.28); }
.tv-cta-emoji {
  font-size: 1.7rem; line-height: 1;
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(245,241,232,.08);
  flex-shrink: 0;
}
.tv-cta-text { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.tv-cta-text strong { font-size: 1.02rem; font-weight: 700; }
.tv-cta-text span { font-size: .86rem; color: rgba(245,241,232,.72); }

/* ---------- Layout ---------- */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 24px 40px;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* sticky TOC */
.toc { position: sticky; top: 28px; }
.toc-title {
  margin: 0 0 12px;
  font-size: .72rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.toc nav ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc nav li { margin: 0; }
.toc nav a {
  display: block;
  padding: 5px 0 5px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--sumi-soft);
  font-size: .9rem;
  transition: color .15s ease, border-color .15s ease;
}
.toc nav a:hover { color: var(--shu-deep); border-left-color: var(--shu); }

/* ---------- Content (rendered markdown) ---------- */
.content { min-width: 0; overflow-wrap: break-word; }
.content > :first-child { margin-top: 0; }
.content a { overflow-wrap: anywhere; }

.content h2 {
  font-family: "Shippori Mincho", serif;
  font-weight: 700;
  font-size: 1.92rem;
  line-height: 1.2;
  margin: 64px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 24px;
}
.content h2::before {
  content: "";
  display: inline-block;
  width: 22px; height: 3px;
  vertical-align: middle;
  margin: -4px 12px 0 0;
  background: var(--shu);
}
.content h3 {
  font-family: "Shippori Mincho", serif;
  font-weight: 600;
  font-size: 1.32rem;
  margin: 38px 0 10px;
  color: var(--sumi);
  scroll-margin-top: 24px;
}
.content h4 { font-size: 1.05rem; margin: 26px 0 8px; color: var(--sumi-soft); }

.content p { margin: 14px 0; }

.content a { border-bottom: 1px solid transparent; transition: border-color .15s ease, color .15s ease; }
.content a:hover { color: var(--shu-deep); border-bottom-color: var(--shu); }

.content ul, .content ol { margin: 12px 0; padding-left: 1.3em; }
.content ul { list-style: none; }
.content ul > li { position: relative; padding-left: 1.1em; margin: 7px 0; }
.content ul > li::before {
  content: "・";
  position: absolute; left: 0; top: -1px;
  color: var(--shu); font-weight: 700;
}
.content ul ul { margin: 6px 0; }
.content ol { padding-left: 1.5em; }
.content ol > li { margin: 7px 0; }

.content li > strong:first-child { color: var(--ai); }

.content blockquote {
  margin: 18px 0;
  padding: 4px 18px;
  border-left: 3px solid var(--shu);
  background: var(--card);
  color: var(--sumi-soft);
  border-radius: 0 8px 8px 0;
}
.content blockquote p { margin: 8px 0; }

.content code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .86em;
  background: var(--washi-2);
  padding: .12em .42em; border-radius: 5px;
}
.content pre {
  background: var(--sumi); color: #ece4d4;
  padding: 16px 18px; border-radius: 10px; overflow: auto;
}
.content pre code { background: none; padding: 0; }

.content hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.content img { max-width: 100%; vertical-align: middle; }

/* tables (the indicator legend) */
.content table {
  width: 100%; border-collapse: collapse; margin: 18px 0;
  font-size: .95rem;
  background: var(--card);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 0 var(--line);
}
.content th, .content td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.content thead th {
  background: var(--washi-2);
  font-family: "Shippori Mincho", serif; font-weight: 700;
  color: var(--sumi);
}
.content tbody tr:last-child td { border-bottom: 0; }

/* ---------- Footer ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding: 34px 24px 60px;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}
.site-foot a { color: var(--shu-deep); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 44px; }
  .toc { display: none; }
  .hero { padding: 72px 22px 48px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 60px 18px 40px; }
  .seal { width: 50px; height: 50px; font-size: 26px; }
  .kicker { letter-spacing: .3em; }
  .hero-sub { font-size: 1.04rem; }
  .layout { padding: 36px 18px 28px; }
  .content h2 { font-size: 1.58rem; margin-top: 48px; }
  .content h3 { font-size: 1.2rem; }
  .tv-cta { gap: 13px; padding: 14px 18px 14px 14px; }
  .site-foot { padding: 30px 18px 52px; }
}

/* never allow the decorative hero kana to create a horizontal scrollbar */
@media (max-width: 400px) {
  .hero-kana { font-size: 44vw; right: -6vw; }
}

/* Share button — native share sheet on phones, link menu on desktop.
   Desktop: under the Contents sidebar. Mobile (<900px, sidebar hidden): in the hero. */
.toc-share { position: relative; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.hero-share { position: relative; display: none; margin-top: 16px; }
.share-btn { background: var(--shu); color: var(--washi); border: 0; border-radius: 999px;
  padding: 9px 18px; font-weight: 700; cursor: pointer; font-size: .95rem; font-family: inherit; }
.share-btn:hover { background: var(--shu-deep); }
.share-menu { position: absolute; left: 0; top: 118%; min-width: 184px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 16px 40px rgba(28,26,22,.22);
  display: flex; flex-direction: column; gap: 2px; z-index: 20; }
.share-menu[hidden] { display: none; }
.share-menu a, .share-menu button { display: block; text-align: left; background: transparent; border: 0;
  color: var(--sumi); padding: 9px 12px; border-radius: 8px; font-size: .92rem; cursor: pointer;
  text-decoration: none; font-family: inherit; }
.share-menu a:hover, .share-menu button:hover { background: var(--washi-2); }

/* On mobile the Contents sidebar (with its share button) is hidden, so show the hero one. */
@media (max-width: 900px) {
  .hero-share { display: inline-block; }
}
