/* Shiori site — handwritten, dependency-free theme.
   Dark by default (matches the app), with a light-mode override. */

:root {
  --bg:        #0f1115;
  --bg-soft:   #161922;
  --panel:     #1b1f29;
  --panel-2:   #212634;
  --border:    #2a3040;
  --text:      #e7e9ee;
  --text-soft: #aab2c0;
  --muted:     #7e8696;
  --accent:    #e0533d;   /* bookmark red */
  --accent-2:  #f0a23a;   /* furigana orange */
  --link:      #ff7a63;
  --radius:    12px;
  --maxw:      1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #fbfaf7;
    --bg-soft:   #f3f1ec;
    --panel:     #ffffff;
    --panel-2:   #f6f4ef;
    --border:    #e3ded3;
    --text:      #1f2430;
    --text-soft: #424a59;
    --muted:     #6b7280;
    --link:      #c2412c;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.25; font-weight: 700; }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--panel-2);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

pre {
  background: var(--panel) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
}
pre code { background: none; padding: 0; font-size: 0.875rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.7rem 1.25rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--text); font-weight: 700; font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }
.brand-kanji { color: var(--accent); margin-left: 0.15rem; }
.topnav { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.topnav a { color: var(--text-soft); font-size: 0.95rem; }
.topnav a:hover { color: var(--text); text-decoration: none; }
.topnav a.ext { color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.72rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.06s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #ef6047; }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--panel); }
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- layout helpers ---------- */
main { display: block; }
section { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- hero ---------- */
.hero { text-align: center; padding-top: 4rem; padding-bottom: 1rem; }
.hero-icon { margin-bottom: 1rem; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0.2rem auto 0.8rem;
  max-width: 14ch;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-sub {
  max-width: 60ch; margin: 0 auto 1.6rem;
  color: var(--text-soft); font-size: 1.12rem;
}
.cta-row { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.hero-note { color: var(--muted); font-size: 0.9rem; margin-top: 1rem; }
.hero-shot {
  margin-top: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}

/* ---------- lede ---------- */
.lede { padding: 3rem 1.25rem 1rem; max-width: 760px; }
.lede p { font-size: 1.2rem; color: var(--text-soft); }

/* ---------- features ---------- */
.features { padding: 2rem 1.25rem; display: flex; flex-direction: column; gap: 3.5rem; }
.feature {
  display: grid; grid-template-columns: 1fr 1.15fr;
  gap: 2.5rem; align-items: center;
}
.feature.reverse .feature-text { order: 2; }
.feature h2 { font-size: 1.7rem; margin: 0 0 0.8rem; }
.feature p { color: var(--text-soft); font-size: 1.05rem; margin: 0 0 0.7rem; }
.feature .feature-aside { color: var(--muted); font-size: 0.98rem; }
.feature-media img {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

/* ---------- showcase ---------- */
.showcase { text-align: center; padding: 4rem 1.25rem 1rem; }
.showcase h2 { font-size: 1.9rem; margin-bottom: 0.5rem; }
.showcase-sub { color: var(--text-soft); max-width: 60ch; margin: 0 auto 2rem; }
.showcase-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.showcase-grid figure { margin: 0; }
.showcase-grid img { border: 1px solid var(--border); border-radius: var(--radius); }
.showcase-grid figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.6rem; }

/* ---------- everything-else cards ---------- */
.everything { padding: 4rem 1.25rem 1rem; }
.everything h2 { font-size: 1.9rem; text-align: center; margin-bottom: 2rem; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem 1.4rem;
}
.card h3 { margin: 0 0 0.5rem; font-size: 1.12rem; }
.card p { margin: 0; color: var(--text-soft); font-size: 0.97rem; }

/* ---------- bottom CTA ---------- */
.bottom-cta {
  text-align: center; margin: 5rem auto 4rem;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 20px; padding: 3rem 1.5rem;
}
.bottom-cta h2 { font-size: 1.9rem; margin: 0 0 0.7rem; }
.bottom-cta p { color: var(--text-soft); max-width: 56ch; margin: 0 auto 1.6rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 4rem; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.25rem;
  color: var(--text-soft); font-size: 0.9rem;
}
.footer-inner .muted { color: var(--muted); font-size: 0.85rem; }

/* ---------- docs ---------- */
.docs-layout {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 230px 1fr;
  gap: 2.5rem; padding: 2.5rem 1.25rem 3rem;
}
.docs-sidebar { align-self: start; position: sticky; top: 70px; }
.docs-side-title {
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.72rem; color: var(--muted); margin: 0 0 0.6rem;
}
.docs-sidebar nav { display: flex; flex-direction: column; gap: 0.1rem; }
.docs-sidebar nav a {
  color: var(--text-soft); padding: 0.4rem 0.7rem;
  border-radius: 8px; font-size: 0.94rem;
  border-left: 2px solid transparent;
}
.docs-sidebar nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.docs-sidebar nav a.active {
  color: var(--text); background: var(--panel);
  border-left-color: var(--accent); font-weight: 600;
}

.docs-content { min-width: 0; }
.docs-content h1 { font-size: 2.1rem; margin: 0 0 1.2rem; }
.docs-content h2 {
  font-size: 1.4rem; margin: 2.2rem 0 0.8rem;
  padding-bottom: 0.3rem; border-bottom: 1px solid var(--border);
}
.docs-content h3 { font-size: 1.12rem; margin: 1.6rem 0 0.5rem; }
.docs-content p, .docs-content li { color: var(--text-soft); }
.docs-content a { color: var(--link); }
.docs-content table {
  border-collapse: collapse; width: 100%; margin: 1.2rem 0;
  font-size: 0.94rem; display: block; overflow-x: auto;
}
.docs-content th, .docs-content td {
  border: 1px solid var(--border); padding: 0.55rem 0.8rem; text-align: left;
}
.docs-content th { background: var(--panel); }
.docs-content blockquote {
  margin: 1.2rem 0; padding: 0.6rem 1.1rem;
  border-left: 3px solid var(--accent); background: var(--panel);
  border-radius: 0 8px 8px 0; color: var(--text-soft);
}
.docs-content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

.docs-prevnext {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--border);
}
.docs-prevnext a {
  padding: 0.6rem 1rem; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 0.92rem;
}
.docs-prevnext a:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .feature, .showcase-grid, .card-grid { grid-template-columns: 1fr; }
  .feature.reverse .feature-text { order: 0; }
  .feature { gap: 1.4rem; }
  .docs-layout { grid-template-columns: 1fr; gap: 1.2rem; }
  .docs-sidebar {
    position: static; top: auto;
    border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
  }
  .docs-sidebar nav { flex-flow: row wrap; }
}
