/* Yoroten — Daylight-First Japanese Editorial & Studio-Catalog Stylesheet
 * Palette tokens verified against WCAG 2.1 AA contrast pairs:
 *   Paper: #FAF8F3 | Surface: #FFFFFF | Tint: #F3EFE6
 *   Ink: #1F2328 (14.9:1) | Muted: #5A5F66 (6.0:1)
 *   Brand: #1B5E52 (7.1:1 on paper, 7.6:1 with #FFFFFF)
 *   Support: #3E6E8C (5.2:1 on paper, 5.5:1 with #FFFFFF)
 *   Accent fill (UI/icons/borders only): #C95D3A
 *   Accent text (body/labels/links): #A8452A (5.57:1 on paper)
 */

:root {
  --bg-paper: #FAF8F3;
  --bg-surface: #FFFFFF;
  --bg-tint: #F3EFE6;
  --bg-cedar-soft: #EBF3F1;
  --bg-slate-soft: #EEF3F7;
  --bg-terracotta-soft: #FBF0EC;

  --ink: #1F2328;
  --ink-muted: #5A5F66;

  --brand: #1B5E52;
  --brand-hover: #13473E;
  --brand-active: #0D362F;
  --on-brand: #FFFFFF;

  --support: #3E6E8C;
  --on-support: #FFFFFF;

  /* #C95D3A is strictly for graphic fills, borders & icon accents — never body/link text on paper. */
  --accent-fill: #C95D3A;
  --accent-ink: #A8452A;

  --border: #D2CBC0;
  --border-strong: #8F877A;

  --status-live-fg: #14533C;
  --status-live-bg: #E3F5EC;
  --status-prep-fg: #454B52;
  --status-prep-bg: #ECEAE4;
  --status-warn-fg: #7A4B00;
  --status-warn-bg: #FDF3DF;

  --font-display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 6px;
  --radius-lg: 10px;
  --max-w: 1080px;
  --measure: 68ch;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg-paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

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

a {
  color: var(--brand);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--brand-hover);
}

:focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--on-brand);
  padding: 0.6rem 1rem;
  font-weight: 700;
  z-index: 999;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Top non-official disclosure strip */
.notice-strip {
  background: var(--bg-tint);
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-muted);
  padding: 0.5rem 0;
}

.notice-strip p {
  margin: 0;
}

/* Sticky daylight editorial header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 243, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: block;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--ink);
}

.brand-sub {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-muted);
  border-left: 1px solid var(--border-strong);
  padding-left: 0.625rem;
  line-height: 1.2;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-desktop a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-desktop a:hover {
  background: var(--bg-tint);
  color: var(--brand);
}

.nav-desktop a[aria-current="page"] {
  background: var(--bg-cedar-soft);
  color: var(--brand);
}

/* Native no-JS mobile navigation drawer */
.nav-mobile {
  display: none;
  position: relative;
}

.nav-mobile summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
}

.nav-mobile summary::-webkit-details-marker {
  display: none;
}

.nav-mobile-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(280px, calc(100vw - 2rem));
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 28px rgba(31, 35, 40, 0.12);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 60;
}

.nav-mobile-panel a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
}

.nav-mobile-panel a[aria-current="page"] {
  background: var(--bg-cedar-soft);
  color: var(--brand);
}

/* Breadcrumb */
.breadcrumb {
  padding: 1rem 0 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--border-strong);
}

/* Headings — Shippori Mincho B1 strictly >= 18px */
h1,
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.32;
  letter-spacing: 0.01em;
  text-wrap: balance;
  word-break: auto-phrase;
}

h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  margin: 0.35rem 0 0.85rem;
}

h2 {
  font-size: clamp(1.32rem, 2.2vw, 1.75rem);
  margin: 0 0 0.75rem;
}

h3 {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 3px;
  background: var(--accent-fill);
  border-radius: 2px;
}

.lede {
  font-size: 1.03rem;
  color: var(--ink-muted);
  max-width: var(--measure);
  margin: 0 0 1.25rem;
}

/* Editorial Hero Band */
.hero-band {
  padding: 2.75rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(250, 248, 243, 0) 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr);
  gap: 2rem;
  align-items: start;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.hero-aside {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-top: 4px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
}

.hero-aside h2 {
  font-size: 1.18rem;
  margin-bottom: 0.65rem;
}

.fact-dl {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.fact-dl div {
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.fact-dl div:first-child {
  padding-top: 0;
  border-top: none;
}

.fact-dl dt {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 700;
}

.fact-dl dd {
  margin: 0.15rem 0 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
}

.fact-dl dd.fact-hint {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* Sections & alternating paper/tint editorial rhythm */
.section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.section-tint {
  background: var(--bg-tint);
}

.section-head {
  margin-bottom: 1.5rem;
  max-width: 48rem;
}

.section-head p:last-child {
  margin-bottom: 0;
  color: var(--ink-muted);
}

/* Grids & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.card-accent {
  border-left: 4px solid var(--accent-fill);
}

.card-brand {
  border-left: 4px solid var(--brand);
}

.card-support {
  border-left: 4px solid var(--support);
}

.card p {
  margin: 0;
}

.card-meta {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.94rem;
  padding: 0.68rem 1.2rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.3;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
}

.btn-primary:hover {
  background: var(--brand-hover);
  color: var(--on-brand);
}

.btn-primary:active {
  background: var(--brand-active);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--brand);
  border-color: var(--brand);
}

.btn-secondary:hover {
  background: var(--bg-cedar-soft);
  color: var(--brand-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--bg-tint);
}

.btn-sm {
  font-size: 0.84rem;
  padding: 0.45rem 0.85rem;
}

/* Status Chips (text + shape, never color alone) */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  line-height: 1.2;
}

.chip-live {
  color: var(--status-live-fg);
  background: var(--status-live-bg);
}

.chip-prep {
  color: var(--status-prep-fg);
  background: var(--status-prep-bg);
}

.chip-warn {
  color: var(--status-warn-fg);
  background: var(--status-warn-bg);
}

/* PR / Self-Listing Disclosure Box (adjacent to every outbound Yahoo! link) */
.pr-box {
  background: var(--bg-terracotta-soft);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent-fill);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pr-line {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink);
}

.pr-tag {
  color: var(--accent-ink);
  font-weight: 700;
}

/* Trust Strip */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1.1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--ink);
}

.trust-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

/* Callouts */
.callout {
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-size: 0.92rem;
}

.callout-info {
  background: var(--bg-slate-soft);
  border-left: 4px solid var(--support);
}

.callout-live {
  background: var(--bg-cedar-soft);
  border-left: 4px solid var(--brand);
}

.callout-warn {
  background: var(--status-warn-bg);
  border-left: 4px solid var(--accent-fill);
  color: var(--ink);
}

.callout p {
  margin: 0.35rem 0 0;
}

.callout p:first-child {
  margin-top: 0;
}

/* Tables */
.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  background: var(--bg-tint);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: none;
}

.cite-note {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 0.65rem;
}

.fact-unverified {
  color: var(--ink-muted);
  font-style: normal;
}

/* Numbered editorial steps */
.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  counter-reset: step;
}

.steps-list li {
  counter-increment: step;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.2rem;
}

.steps-list li::before {
  content: "STEP 0" counter(step);
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--support);
  margin-bottom: 0.35rem;
}

/* Interactive Calculator & Checklist Controls */
.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

label {
  font-weight: 700;
  font-size: 0.92rem;
}

select,
input[type="number"],
input[type="text"] {
  font: inherit;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--ink);
  width: 100%;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
  cursor: pointer;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
}

.bar-track {
  display: flex;
  height: 22px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-tint);
  margin: 0.65rem 0 0.5rem;
}

.bar-seg-used {
  background: var(--brand);
}

.bar-seg-unused {
  background: #C7C1B5;
}

.bar-seg-shortfall {
  background: var(--accent-fill);
}

.bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.legend-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  margin-right: 0.3rem;
  vertical-align: -1px;
}

/* Pre-check checklists */
.mini-check-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  margin: 0.25rem 0;
  background: var(--bg-paper);
}

.mini-check-group legend {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted);
  padding: 0 0.35rem;
}

.mini-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 400;
  font-size: 0.88rem;
  margin: 0.4rem 0;
  cursor: pointer;
}

.mini-check input[type="checkbox"] {
  margin-top: 0.28rem;
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.checklist-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.check-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 0.22rem;
  accent-color: var(--brand);
  flex-shrink: 0;
}

.check-item strong {
  display: block;
  margin-bottom: 0.15rem;
}

.check-item span {
  font-size: 0.88rem;
  color: var(--ink-muted);
  font-weight: 400;
}

/* FAQ accordions */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

details.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1.2rem;
}

details.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.5;
}

details.faq-item[open] summary {
  color: var(--brand);
  margin-bottom: 0.65rem;
}

details.faq-item p {
  margin: 0;
  color: var(--ink-muted);
}

/* Inline Schematic Diagram Plate */
.diagram-plate {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.diagram-caption {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin: 0.75rem 0 0;
}

/* Footer */
.site-footer {
  background: var(--bg-tint);
  border-top: 1px solid var(--border-strong);
  padding: 2.25rem 0 2.5rem;
  font-size: 0.86rem;
  color: var(--ink-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.75rem;
}

.footer-heading {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.65rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.footer-links a,
.footer-links button {
  color: var(--brand);
  font-size: 0.86rem;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
  color: var(--brand);
}

.link-btn:hover {
  color: var(--brand-hover);
}

.footer-bottom {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
}

/* Cookie Banner & Dialog */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  box-shadow: 0 12px 32px rgba(31, 35, 40, 0.16);
  z-index: 90;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

dialog.cookie-dialog {
  max-width: 560px;
  width: calc(100vw - 2rem);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--ink);
  padding: 1.35rem;
}

dialog.cookie-dialog::backdrop {
  background: rgba(31, 35, 40, 0.45);
}

/* Pure-static /go/* redirect screen */
.go-shell {
  max-width: 560px;
  margin: 3.5rem auto;
  padding: 1.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-top: 4px solid var(--brand);
  border-radius: var(--radius-lg);
}

/* Responsive */
@media (max-width: 860px) {
  .hero-grid,
  .calc-layout,
  .grid-3,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-desktop {
    display: none;
  }

  .nav-mobile {
    display: block;
  }

  .brand-sub {
    display: none;
  }

  .hero-band {
    padding: 1.75rem 0 1.75rem;
  }

  .section {
    padding: 1.9rem 0;
  }
}

@media print {
  .site-header,
  .nav-mobile,
  .cookie-banner,
  dialog.cookie-dialog {
    display: none !important;
  }

  body,
  .section-tint,
  .card {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
}
