:root {
  --bg: #f5f1e8;
  --surface: #fffdf8;
  --surface-2: #eee9df;
  --text: #242621;
  --muted: #6c7067;
  --line: #d9d4c8;
  --green: #66765f;
  --green-strong: #465542;
  --amber: #ba8a3b;
  --focus: #2c5d8a;
  --shadow: 0 10px 30px rgba(53, 47, 35, .055);
  --radius: 18px;
  --max: 1180px;
}

[data-theme="dark"] {
  --bg: #181a17;
  --surface: #20231f;
  --surface-2: #282c27;
  --text: #ece8df;
  --muted: #a7aca1;
  --line: #353a34;
  --green: #94aa8a;
  --green-strong: #b8c8b1;
  --amber: #d5a75c;
  --focus: #88bce8;
  --shadow: 0 10px 30px rgba(0,0,0,.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.skip-link { position:absolute; left:-9999px; top:auto; }
.skip-link:focus { left:18px; top:18px; z-index:999; background:var(--surface); padding:10px 14px; border:1px solid var(--line); border-radius:10px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  font-weight: 800;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.nav { margin-left: auto; display:flex; gap:6px; align-items:center; }
.nav a, .icon-button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
}
.nav a:hover, .nav a[aria-current="page"], .icon-button:hover { color:var(--text); border-color:var(--line); background:var(--surface); }
.header-actions { display:flex; gap:6px; }
.icon-button { width: 42px; height: 42px; display:grid; place-items:center; }
.menu-button { display:none; }

main { max-width: var(--max); margin: 0 auto; padding: 44px 22px 80px; min-height: calc(100vh - 150px); }
.hero { padding: 58px 0 54px; max-width: 900px; }
.eyebrow { text-transform: uppercase; letter-spacing:.16em; font-size:.74rem; font-weight:800; color:var(--green); }
h1, h2, h3 { line-height:1.15; margin:0; letter-spacing:-.035em; }
h1 { font-size: clamp(2.7rem, 7vw, 6.3rem); max-width: 950px; }
.hero p { font-size: clamp(1.08rem, 2vw, 1.45rem); color:var(--muted); max-width:720px; margin:24px 0 0; }
.section { margin-top: 56px; }
.section-head { display:flex; justify-content:space-between; gap:20px; align-items:end; margin-bottom:18px; }
.section-head h2 { font-size: clamp(1.55rem, 3vw, 2.3rem); }
.section-head p { margin:0; color:var(--muted); max-width:620px; }

.grid { display:grid; gap:16px; }
.grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.grid-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.card {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px;
  transition: transform .16s ease, border-color .16s ease;
}
.card:hover { transform:translateY(-2px); border-color:color-mix(in srgb, var(--green) 50%, var(--line)); }
.card h3 { font-size:1.15rem; margin:7px 0 6px; }
.card p { margin:0; color:var(--muted); }
.card .meta { font-size:.86rem; color:var(--muted); }
.card-icon { font-size:1.35rem; }
.card-link { display:block; height:100%; }

.current-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
.current-card { padding:18px; }
.current-card strong { display:block; margin-top:6px; line-height:1.35; }
.current-card small { color:var(--muted); }

.explore-card { min-height:165px; display:flex; flex-direction:column; justify-content:space-between; }
.explore-card .arrow { color:var(--green); font-weight:700; }

.timeline { border-left:1px solid var(--line); margin-left:8px; padding-left:24px; }
.timeline-item { position:relative; padding:0 0 26px; }
.timeline-item::before { content:""; position:absolute; left:-30px; top:.5em; width:10px; height:10px; border-radius:50%; background:var(--bg); border:2px solid var(--green); }
.timeline-item time { font-size:.82rem; color:var(--muted); }
.timeline-item p { margin:2px 0 0; }

.page-hero { padding:36px 0 20px; }
.page-hero h1 { font-size:clamp(2.5rem, 6vw, 5rem); }
.page-hero p { color:var(--muted); max-width:760px; font-size:1.08rem; }

.tabs, .chips { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0 24px; }
.chip, .tab {
  border:1px solid var(--line); background:var(--surface); color:var(--muted);
  border-radius:999px; padding:8px 12px;
}
.tab.active, .chip.active { background:var(--text); color:var(--bg); border-color:var(--text); }
.badge { display:inline-flex; align-items:center; gap:6px; font-size:.78rem; border:1px solid var(--line); border-radius:999px; padding:5px 9px; color:var(--muted); }
.status-dot { width:7px; height:7px; border-radius:50%; background:var(--green); }

.progress { height:8px; background:var(--surface-2); border-radius:999px; overflow:hidden; margin-top:12px; }
.progress > span { display:block; height:100%; background:var(--green); border-radius:999px; }

.detail-layout { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(260px,.7fr); gap:24px; align-items:start; }
.detail-panel h2 { margin-bottom:16px; }
.list-clean { list-style:none; margin:0; padding:0; }
.list-clean li { padding:12px 0; border-bottom:1px solid var(--line); }
.list-clean li:last-child { border-bottom:0; }

.spoiler { border:1px dashed var(--line); border-radius:14px; padding:14px; background:var(--surface-2); }
.spoiler[aria-expanded="false"] .spoiler-content { filter:blur(7px); user-select:none; opacity:.75; }
.spoiler-toggle { border:0; background:transparent; color:var(--green-strong); font-weight:700; padding:0; margin-bottom:8px; }

.note-card .note-title { font-size:1.08rem; font-weight:760; }
.note-card .note-body { margin-top:10px; color:var(--text); }
.note-card .tags { margin-top:14px; display:flex; gap:6px; flex-wrap:wrap; }
.tag { font-size:.74rem; padding:4px 8px; border-radius:999px; background:var(--surface-2); color:var(--muted); }

.search-overlay { position:fixed; inset:0; z-index:100; background:rgba(0,0,0,.34); display:none; padding:10vh 18px 18px; }
.search-overlay.open { display:block; }
.search-dialog { max-width:760px; margin:0 auto; background:var(--surface); border:1px solid var(--line); border-radius:20px; box-shadow:0 30px 80px rgba(0,0,0,.25); overflow:hidden; }
.search-box { width:100%; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--text); padding:20px 22px; outline:none; font-size:1.05rem; }
.search-results { max-height:58vh; overflow:auto; padding:10px; }
.search-result { display:block; padding:12px; border-radius:12px; }
.search-result:hover, .search-result:focus { background:var(--surface-2); outline:none; }
.search-result small { color:var(--muted); display:block; }
.search-empty { color:var(--muted); padding:22px; }

.dashboard { display:grid; grid-template-columns:1.1fr .9fr; gap:20px; }
.practice-step { display:grid; grid-template-columns:72px 1fr; gap:14px; padding:14px 0; border-bottom:1px solid var(--line); }
.practice-step:last-child { border-bottom:0; }
.practice-step strong { font-size:1.3rem; }
.practice-check { display:flex; align-items:flex-start; gap:10px; padding:9px 0; }
.practice-check input { margin-top:5px; width:18px; height:18px; accent-color:var(--green); }
.stat-row { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:14px; }
.stat { background:var(--surface-2); border-radius:14px; padding:14px; }
.stat strong { display:block; font-size:1.35rem; }

.primary-button, .secondary-button {
  border-radius:12px; padding:10px 14px; border:1px solid var(--line); font-weight:700;
}
.primary-button { background:var(--text); color:var(--bg); border-color:var(--text); }
.secondary-button { background:var(--surface); color:var(--text); }
.button-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }

.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:16px; background:var(--surface); }
table { width:100%; border-collapse:collapse; min-width:680px; }
th, td { text-align:left; padding:14px 16px; border-bottom:1px solid var(--line); }
th { font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); }
tr:last-child td { border-bottom:0; }
.trend-up { color:var(--green-strong); font-weight:800; }

.gallery-placeholder { aspect-ratio:4/3; border-radius:14px; background:linear-gradient(145deg,var(--surface-2),color-mix(in srgb,var(--amber) 20%,var(--surface))); display:grid; place-items:center; color:var(--muted); border:1px solid var(--line); }

.tool-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.tool-card input, .tool-card select { width:100%; border:1px solid var(--line); background:var(--bg); color:var(--text); border-radius:10px; padding:10px 11px; margin-top:8px; }
.tool-output { min-height:48px; background:var(--surface-2); border-radius:12px; padding:12px; margin-top:12px; }

.empty { padding:32px; color:var(--muted); text-align:center; border:1px dashed var(--line); border-radius:16px; }

.site-footer { border-top:1px solid var(--line); }
.footer-inner { max-width:var(--max); margin:0 auto; padding:28px 22px 44px; display:flex; justify-content:space-between; gap:20px; color:var(--muted); font-size:.9rem; }
.footer-inner strong { color:var(--text); }

:focus-visible { outline:3px solid color-mix(in srgb,var(--focus) 55%,transparent); outline-offset:3px; }

@media (max-width: 1000px) {
  .current-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .grid-3 { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .header-inner { flex-wrap:wrap; }
  .menu-button { display:grid; }
  .nav { order:3; width:100%; display:none; flex-direction:column; align-items:stretch; margin-left:0; padding-top:6px; }
  .nav.open { display:flex; }
  .nav a { padding:10px 12px; }
  .header-actions { margin-left:auto; }
  main { padding-top:28px; }
  .hero { padding:40px 0 32px; }
  h1 { font-size:clamp(2.55rem,13vw,4.6rem); }
  .current-grid, .grid-2, .grid-3, .grid-4, .dashboard, .detail-layout, .tool-grid { grid-template-columns:1fr; }
  .current-grid { gap:10px; }
  .current-card { display:grid; grid-template-columns:40px 1fr; gap:6px 10px; align-items:center; }
  .current-card .card-icon { grid-row:1/3; }
  .section { margin-top:42px; }
  .section-head { display:block; }
  .section-head p { margin-top:7px; }
  .footer-inner { flex-direction:column; }
  .stat-row { grid-template-columns:1fr; }
}
