/* ─── くらしの選び方ラボ — base styles ─────────────────────────────────── */

:root {
  --kinari: #EFE7D6;
  --paper:  #F7F1E2;
  --paper-2:#FBF7EC;
  --sumi:   #1C1A17;
  --ink:    #2A2622;
  --muted:  #6B6259;
  --muted-2:#8A8276;
  --hair:   #D7CCB6;
  --hair-2: #E4DBC6;
  --wood:   #8A5A33;
  --accent: var(--wood);
  --max:    1280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--kinari);
  color: var(--ink);
  font-family: "Noto Sans JP", system-ui, -apple-system, "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; }

.serif { font-family: "Noto Serif JP", "Hiragino Mincho ProN", "YuMincho", serif; }
.mono  { font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace; letter-spacing: 0.02em; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

button { font-family: inherit; cursor: pointer; }

/* ─── shell ─────────────────────────────────────────────────────────────── */

.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

.hair { height: 1px; background: var(--hair); width: 100%; }
.hair-soft { height: 1px; background: var(--hair-2); width: 100%; }

.meta {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.kicker {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* ─── header ────────────────────────────────────────────────────────────── */

.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(239, 231, 214, 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--hair-2);
}
.hdr-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 32px;
  max-width: var(--max);
  margin: 0 auto;
  gap: 24px;
}
.hdr-meta { font-size: 10.5px; color: var(--muted); display: flex; gap: 16px; align-items: center; }
.hdr-meta .dot { width: 4px; height: 4px; border-radius: 99px; background: var(--accent); }

.logo {
  display: flex; align-items: baseline; gap: 10px;
  font-family: "Noto Serif JP", serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: var(--sumi);
}
.logo .en {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

.hdr-actions { display: flex; justify-content: flex-end; gap: 18px; align-items: center; font-size: 12.5px; color: var(--muted); }
.hdr-actions button { background: none; border: none; color: var(--muted); padding: 0; font-size: 12.5px; }
.hdr-actions button:hover { color: var(--accent); }

.subnav {
  display: flex; gap: 28px; padding: 12px 32px;
  max-width: var(--max); margin: 0 auto;
  font-size: 13px;
  color: var(--ink);
  overflow-x: auto;
}
.subnav button, .subnav a {
  background: none; border: none; padding: 0;
  color: var(--ink); font-size: 13px; white-space: nowrap;
  position: relative;
  text-decoration: none;
}
.subnav button.active, .subnav a.active { color: var(--accent); font-weight: 600; }
.subnav button.active::after, .subnav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -14px;
  height: 2px; background: var(--accent);
}

/* ─── screen transition ────────────────────────────────────────────────── */

.screen {
  animation: fadeUp .42s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* staggered fade-in for sections */
.screen > section {
  animation: fadeUp .6s cubic-bezier(.2,.7,.2,1) both;
}
.screen > section:nth-child(1) { animation-delay: .02s; }
.screen > section:nth-child(2) { animation-delay: .08s; }
.screen > section:nth-child(3) { animation-delay: .14s; }
.screen > section:nth-child(4) { animation-delay: .20s; }
.screen > section:nth-child(5) { animation-delay: .26s; }
.screen > section:nth-child(6) { animation-delay: .32s; }

/* ─── placeholder imagery ──────────────────────────────────────────────── */

.ph {
  background:
    repeating-linear-gradient(135deg,
      rgba(28,26,23,0.025) 0 1px,
      transparent 1px 14px),
    linear-gradient(180deg, #E4D8BB 0%, #DDCFAA 100%);
  position: relative; overflow: hidden;
  border: 1px solid var(--hair-2);
}
.ph.dark {
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.04) 0 1px,
      transparent 1px 14px),
    linear-gradient(180deg, #3a342b 0%, #2a251f 100%);
  border-color: rgba(255,255,255,0.06);
}
.ph-tag {
  position: absolute; top: 12px; left: 12px;
  font: 10.5px/1 "JetBrains Mono", monospace;
  letter-spacing: 0.12em;
  color: rgba(28,26,23,0.55);
  text-transform: uppercase;
}
.ph.dark .ph-tag { color: rgba(255,255,255,0.55); }
.ph-label {
  position: absolute; left: 14px; bottom: 12px; right: 14px;
  font: 11.5px/1.4 "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
  color: rgba(28,26,23,0.55);
}
.ph.dark .ph-label { color: rgba(255,255,255,0.55); }

/* ─── card ─────────────────────────────────────────────────────────────── */

.card { display: block; cursor: pointer; transition: transform .25s ease; color: inherit; }
.card:hover { transform: translateY(-2px); }
.card:hover .card-title { color: var(--accent); }
.card-title { transition: color .2s; }

/* ─── btn ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--sumi);
  color: var(--paper);
  border: 1px solid var(--sumi);
  font-size: 12.5px; letter-spacing: 0.04em;
  border-radius: 999px;
  transition: all .2s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: white; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--hair); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ─── chip ─────────────────────────────────────────────────────────────── */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  font-size: 12px; color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  transition: all .2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--sumi); border-color: var(--sumi); color: var(--paper); }
.chip.active:hover { background: var(--accent); border-color: var(--accent); color: white; }

/* ─── grid helpers ─────────────────────────────────────────────────────── */

.row { display: flex; gap: 12px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.stack { display: flex; flex-direction: column; }

/* ─── form helpers ─────────────────────────────────────────────────────── */

input { font: inherit; }

/* ─── article-specific ─────────────────────────────────────────────────── */

.toc-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  padding: 8px 0;
  border-top: 1px solid var(--hair-2);
  cursor: pointer;
  color: var(--ink);
  font-weight: 400;
  transition: color .2s;
}
.toc-item:hover { color: var(--accent); }
.toc-item.active { color: var(--accent); font-weight: 600; }

.tab-btn {
  padding: 10px 20px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hair);
  border-right: none;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.tab-btn:last-child { border-right: 1px solid var(--hair); }
.tab-btn.active {
  background: var(--sumi);
  color: var(--paper);
  border-color: var(--sumi);
}

.sort-btn {
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.sort-btn:hover { color: var(--accent); }
.sort-btn.active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* ─── footer ───────────────────────────────────────────────────────────── */

.foot {
  background: #1C1A17;
  color: #C6BDA8;
  padding: 80px 32px 40px;
  margin-top: 120px;
  font-size: 13px;
}
.foot-inner { max-width: var(--max); margin: 0 auto; }
.foot a { cursor: pointer; }
.foot a:hover { color: #E5D9BD; }
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.foot h4 {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8B8270;
  margin: 0 0 16px;
  font-weight: 500;
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 10px; }
.foot-bottom {
  display: flex; justify-content: space-between;
  padding-top: 24px;
  font-size: 11px; color: #6E6553;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
}

/* ─── utility ──────────────────────────────────────────────────────────── */

.dim { color: var(--muted); }
.dim-2 { color: var(--muted-2); }

h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; }

/* ─── responsive ───────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hdr-inner { grid-template-columns: 1fr; gap: 12px; }
  .hdr-meta, .hdr-actions { justify-content: center; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
