/* styles.css — 麻雀成績管理 利用説明HP */

:root {
  /* Light theme — paper-white documentation */
  --bg: #fafaf6;
  --surface: #ffffff;
  --surface-2: #f3efe5;
  --surface-3: #eae5d6;
  --text: #1a1916;
  --text-2: #4a463d;
  --muted: #807766;
  --border: #e2dccc;
  --border-strong: #c9c2b0;
  --accent: #a82c1c;        /* 朱 */
  --accent-soft: rgba(168, 44, 28, 0.08);
  --accent-text: #8a2415;
  --code-bg: #f3efe5;
  --shadow: 0 1px 2px rgba(20,18,12,.04), 0 8px 24px rgba(20,18,12,.06);
  --phone-bg: #1a1916;
  --phone-screen: #f7f3e9;
}

:root[data-theme="dark"] {
  --bg: #16140f;
  --surface: #1f1d18;
  --surface-2: #28251f;
  --surface-3: #34302a;
  --text: #f0ece2;
  --text-2: #c8c2b3;
  --muted: #8a8174;
  --border: #34302a;
  --border-strong: #4a4538;
  --accent: #e07560;
  --accent-soft: rgba(224, 117, 96, 0.12);
  --accent-text: #e89888;
  --code-bg: #28251f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px rgba(0,0,0,.4);
  --phone-bg: #0a0908;
  --phone-screen: #1f1d18;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', -apple-system, 'Hiragino Sans', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

/* ── Top bar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 12px clamp(14px, 4vw, 24px);
  background: rgba(250, 250, 246, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
:root[data-theme="dark"] .topbar { background: rgba(22, 20, 15, 0.86); }
.topbar-menu {
  appearance: none; background: transparent; border: 1px solid var(--border);
  width: 38px; height: 38px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer;
}
.topbar-menu:hover { border-color: var(--border-strong); background: var(--surface-2); }
@media (min-width: 900px) { .topbar-menu { display: none; } }

.topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
  font-family: 'Noto Serif JP', serif;
  flex-shrink: 0;
}
.brand-text { font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.brand-sub {
  font-size: 11px; color: var(--muted); font-weight: 500;
  padding-left: 8px; margin-left: 4px;
  border-left: 1px solid var(--border);
}
@media (max-width: 480px) { .brand-sub { display: none; } }

.topbar-cta {
  margin-left: auto;
  padding: 8px 14px; border-radius: 8px;
  background: var(--accent); color: #fff !important;
  font-weight: 600; font-size: 13px;
  border: 1px solid transparent;
  transition: filter .15s ease, transform .05s ease;
}
.topbar-cta:hover { filter: brightness(1.06); }
.topbar-cta:active { transform: translateY(1px); }

/* ── Layout ──────────────────────────────────────────────────── */
.layout {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr;
  padding: 0;
}
@media (min-width: 900px) {
  .layout { grid-template-columns: 240px 1fr; gap: 40px; padding: 0 28px; }
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar-scrim {
  position: fixed; inset: 0; background: rgba(20,18,12,.45);
  z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sidebar-scrim.on { opacity: 1; pointer-events: auto; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 280px; max-width: 84vw;
  background: var(--surface); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: transform .25s ease;
  z-index: 41; padding-top: 16px;
}
.sidebar.open { transform: translateX(0); }
@media (min-width: 900px) {
  .sidebar {
    position: sticky; top: 64px; align-self: start;
    width: auto; max-width: none;
    transform: none; background: transparent; border-right: 0;
    height: calc(100vh - 80px); overflow-y: auto;
    padding-top: 32px;
  }
  .sidebar-scrim { display: none; }
}
.sidebar-inner { padding: 16px 20px 24px; }
.sidebar-eyebrow {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 10px;
}
.sidebar nav ul { list-style: none; padding: 0; margin: 0 0 20px; }
.sidebar nav li { margin: 0; }
.sidebar nav a {
  display: block;
  padding: 8px 12px; margin: 2px 0;
  font-size: 14px; color: var(--text-2);
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: color .12s, background .12s, border-color .12s;
}
.sidebar nav a:hover { color: var(--text); background: var(--surface-2); }
.sidebar nav a.on {
  color: var(--accent-text); border-left-color: var(--accent);
  background: var(--accent-soft); font-weight: 600;
}
.sidebar-divider { height: 1px; background: var(--border); margin: 16px 0; }
.sidebar-meta {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; color: var(--muted);
  padding-bottom: 16px;
}
.sidebar-meta-row { display: flex; justify-content: space-between; gap: 12px; }
.sidebar-meta-row b { color: var(--text); font-weight: 600; }
.sidebar-dl {
  display: inline-block; margin-top: 4px;
  padding: 9px 14px; border-radius: 8px;
  border: 1px solid var(--border-strong);
  font-size: 13px; font-weight: 600;
  color: var(--text);
  width: 100%; text-align: center;
}
.sidebar-dl:hover { background: var(--surface-2); }

/* ── Content ─────────────────────────────────────────────────── */
.content {
  padding: 20px clamp(16px, 5vw, 32px) 60px;
  max-width: 100%;
  min-width: 0;
}
.block {
  padding: clamp(36px, 6vw, 72px) 0;
  border-top: 1px solid var(--border);
}
.block:first-of-type { border-top: 0; }

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  display: grid; grid-template-columns: 1fr; gap: clamp(28px, 5vw, 56px);
  padding: clamp(28px, 6vw, 64px) 0 clamp(40px, 7vw, 80px);
  align-items: center;
}
@media (min-width: 760px) {
  .hero { grid-template-columns: 1.2fr 1fr; }
}
.hero-badge {
  display: inline-block; padding: 4px 10px;
  background: var(--accent-soft); color: var(--accent-text);
  border-radius: 999px; font-size: 12px; font-weight: 600;
  letter-spacing: .04em; margin-bottom: 16px;
}
.hero-title {
  font-family: 'Noto Serif JP', 'Noto Sans JP', serif;
  font-size: clamp(28px, 5.2vw, 44px); line-height: 1.35;
  font-weight: 700; margin: 0 0 18px;
  letter-spacing: .01em;
  text-wrap: pretty;
}
.hero-lead {
  font-size: clamp(14px, 1.6vw, 16px); line-height: 1.85;
  color: var(--text-2); margin: 0 0 28px;
  text-wrap: pretty;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 10px;
  font-weight: 600; font-size: 14.5px;
  transition: filter .15s, transform .05s, background .15s, border-color .15s;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff !important; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-2); }

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  margin: 0; padding: 16px 0 0;
  border-top: 1px solid var(--border);
}
.hero-stats > div { padding: 4px 0; }
.hero-stats dt {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 4px;
}
.hero-stats dd {
  margin: 0; font-size: 14.5px; font-weight: 600; color: var(--text);
}

.hero-visual { display: flex; justify-content: center; }

/* ── Section heads ───────────────────────────────────────────── */
.sec-head { margin-bottom: clamp(28px, 4vw, 44px); }
.sec-eyebrow {
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text); font-weight: 700; margin-bottom: 10px;
  font-family: 'Roboto Mono', ui-monospace, monospace;
}
.sec-title {
  font-family: 'Noto Serif JP', 'Noto Sans JP', serif;
  font-size: clamp(24px, 3.6vw, 32px); font-weight: 700;
  margin: 0 0 12px; line-height: 1.35;
  letter-spacing: .005em;
}
.sec-sub {
  margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.8;
  max-width: 64ch; text-wrap: pretty;
}

/* ── Intro grid ──────────────────────────────────────────────── */
.intro-grid {
  display: grid; grid-template-columns: 1fr; gap: 16px;
}
@media (min-width: 700px) {
  .intro-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
}
.intro-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px 24px;
  box-shadow: var(--shadow);
}
.intro-card h3 {
  margin: 0 0 12px; font-size: 16px; font-weight: 700;
}
.intro-card ul { margin: 0; padding-left: 1.2em; color: var(--text-2); }
.intro-card li { margin: 4px 0; line-height: 1.7; }
.intro-card p { margin: 0; color: var(--text-2); line-height: 1.85; }
.intro-card a { color: var(--accent-text); border-bottom: 1px solid var(--accent-soft); }
.intro-card a:hover { border-bottom-color: var(--accent); }

/* ── Steps ───────────────────────────────────────────────────── */
.steps { display: flex; flex-direction: column; gap: 0; }
.step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: clamp(14px, 2.5vw, 24px);
  padding: clamp(20px, 3vw, 28px) 0;
  border-top: 1px dashed var(--border);
}
.step:first-child { border-top: 0; padding-top: 0; }
.step-num-col {
  display: flex; flex-direction: column; align-items: center;
}
.step-num {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); color: var(--accent-text);
  border: 1.5px solid var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Roboto Mono', ui-monospace, monospace;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.step-num-line {
  width: 1.5px; flex: 1; background: var(--border);
  margin: 12px 0 0;
}
.step:last-child .step-num-line { display: none; }

.step-body { min-width: 0; }
.step-count {
  display: block;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 8px;
  font-family: 'Roboto Mono', ui-monospace, monospace;
}
.step-title {
  font-family: 'Noto Serif JP', 'Noto Sans JP', serif;
  font-size: clamp(18px, 2.4vw, 22px); font-weight: 700;
  margin: 0 0 12px; line-height: 1.4;
}
.step-desc {
  margin: 0 0 16px; color: var(--text-2); line-height: 1.85;
  text-wrap: pretty;
}
.step-notes {
  margin: 0 0 20px; padding: 14px 18px;
  background: var(--surface-2); border-radius: 8px;
  border-left: 3px solid var(--border-strong);
  list-style: none;
}
.step-notes li {
  font-size: 13.5px; color: var(--text-2); line-height: 1.7;
  padding-left: 18px; position: relative;
}
.step-notes li + li { margin-top: 4px; }
.step-notes li::before {
  content: '※'; position: absolute; left: 0; top: 0;
  color: var(--muted); font-weight: 600;
}

/* definition list inside a step (rule options, stat metrics, sub-procedures) */
.step-defs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 0 0 18px;
}
.step-defs-head {
  font-family: 'Roboto Mono', ui-monospace, monospace;
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 14px;
}
.step-defs dl {
  margin: 0;
  display: grid; grid-template-columns: 1fr; gap: 10px 0;
}
.step-defs dt {
  font-weight: 700; color: var(--text); font-size: 14px;
  margin-bottom: 2px;
}
.step-defs dt + dd { margin-top: 0; }
.step-defs dd {
  margin: 0 0 6px; color: var(--text-2);
  font-size: 13.5px; line-height: 1.75;
}
.step-defs dd:last-child { margin-bottom: 0; }
@media (min-width: 640px) {
  .step-defs dl {
    grid-template-columns: 160px 1fr;
    gap: 10px 20px;
    align-items: baseline;
  }
  .step-defs dt { margin-bottom: 0; }
  .step-defs dd { margin: 0; }
}

/* warning / caution callout */
.step-warning {
  display: flex; gap: 14px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 4px 8px 8px 4px;
  padding: 14px 18px;
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--accent-text);
  line-height: 1.75;
}
.step-warning-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 700; font-size: 12.5px; letter-spacing: .04em;
  flex-shrink: 0;
  color: var(--accent);
}
.step-warning-label svg { display: block; }

/* ── Phone frame (screenshot placeholder) ────────────────────── */
.shot { margin: 0; }
.shot figcaption {
  margin-top: 10px; font-size: 12.5px; color: var(--muted);
  text-align: center;
}
.phone {
  width: 100%; max-width: 280px; margin: 0 auto;
  background: var(--phone-bg);
  border-radius: 28px;
  padding: 6px;
  box-shadow: var(--shadow);
  position: relative;
}
.phone-tall { max-width: 320px; }
.phone-statusbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 16px 4px;
  font-size: 10.5px; color: var(--phone-screen);
  font-family: 'Roboto Mono', ui-monospace, monospace;
}
.sb-icons { display: inline-flex; gap: 3px; }
.sb-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--phone-screen); opacity: .8;
}
.phone-screen {
  aspect-ratio: 9 / 17;
  background: var(--phone-screen);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.phone-tall .phone-screen { aspect-ratio: 9 / 18.5; }
.shot-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted); font-size: 12.5px; padding: 20px; text-align: center;
}
.shot-img {
  width: 100%; height: auto; display: block;
}
.phone-screen:has(.shot-img) {
  aspect-ratio: unset;
}
.shot-multi {
  display: flex; gap: 16px; justify-content: center; align-items: flex-start;
}
.shot-multi .phone { max-width: 200px; flex: 1; }
.phone-navbar {
  display: flex; justify-content: center; gap: 28px;
  padding: 8px 0 6px;
}
.nb-ico {
  width: 14px; height: 14px;
  opacity: .55;
}
.nb-back {
  border-left: 1.5px solid var(--phone-screen);
  border-bottom: 1.5px solid var(--phone-screen);
  transform: rotate(45deg); width: 8px; height: 8px;
  margin-top: 3px;
}
.nb-home {
  border: 1.5px solid var(--phone-screen); border-radius: 2px;
}
.nb-recent {
  border: 1.5px solid var(--phone-screen);
  width: 12px; height: 12px;
}

/* ── Features grid ───────────────────────────────────────────── */
.feat-grid {
  display: grid; grid-template-columns: 1fr; gap: 14px;
}
@media (min-width: 580px) { .feat-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .feat-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .feat-grid { grid-template-columns: 1fr 1fr 1fr; } }
.feat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px 24px;
  display: flex; flex-direction: column;
  transition: border-color .12s ease, transform .12s ease;
}
.feat-card:hover { border-color: var(--border-strong); }
.feat-num {
  font-family: 'Roboto Mono', ui-monospace, monospace;
  font-size: 12px; color: var(--muted); margin-bottom: 10px;
  letter-spacing: .08em;
}
.feat-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.feat-card p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }

/* ── Changelog ───────────────────────────────────────────────── */
.chlog { list-style: none; padding: 0; margin: 0; }
.chlog-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.chlog-row:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 700px) {
  .chlog-row { grid-template-columns: 180px 1fr; gap: 28px; }
}
.chlog-meta { display: flex; flex-direction: column; gap: 2px; }
.chlog-ver {
  font-family: 'Roboto Mono', ui-monospace, monospace;
  font-size: 16px; font-weight: 700; color: var(--accent-text);
}
.chlog-date {
  font-size: 12.5px; color: var(--muted);
  font-family: 'Roboto Mono', ui-monospace, monospace;
}
.chlog-items {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 4px;
}
.chlog-items li {
  padding-left: 18px; position: relative;
  color: var(--text-2); line-height: 1.7; font-size: 14px;
}
.chlog-items li::before {
  content: ''; position: absolute; left: 0; top: 12px;
  width: 6px; height: 1.5px; background: var(--accent);
}

/* ── Footer ──────────────────────────────────────────────────── */
.foot {
  margin-top: 60px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.foot-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 36px clamp(20px, 5vw, 32px);
  display: grid; gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .foot-inner { grid-template-columns: auto 1fr auto; align-items: center; }
}
.foot-brand { font-weight: 700; font-size: 15px; }
.foot-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.foot-links {
  display: flex; flex-wrap: wrap; gap: 16px 22px;
  font-size: 13.5px; color: var(--text-2);
}
.foot-links a:hover { color: var(--accent-text); }
.foot-fine { font-size: 12px; color: var(--muted); }
