/* ==========================================================================
   Nagivel — base styles
   Accent: navy only. Hierarchy comes from type, rules and spacing, not shadows.
   ========================================================================== */

:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --tint: #F3F2EE;
  --text: #222222;
  --text-2: #666666;
  --text-3: #8A8883;
  --line: #E3E1DB;
  --line-strong: #CFCCC4;
  --accent: #1F3A5F;
  --accent-hover: #162B47;
  --accent-weak: #ECF0F5;
  --error: #B3261E;

  --serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif;

  --container: 1120px;
  --gutter: 24px;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.03em;
  line-break: strict;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
img, svg { max-width: 100%; }

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

.sr-only, .hp {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- Typography ---------------------------------------------------------- */

h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-feature-settings: "palt";
  word-break: auto-phrase;
}
h1 { font-size: clamp(30px, 3.6vw, 42px); line-height: 1.5; }
h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.5; }
.h2-small { font-size: 20px; }
h3 { font-size: 17px; font-weight: 700; line-height: 1.6; letter-spacing: 0.04em; }

/* ---- Header -------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 40px;
  height: 64px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-size: 18px; font-weight: 700; letter-spacing: 0.01em;
}
.logo:hover { color: var(--text); }
.logo-mark { width: 28px; height: 28px; flex: 0 0 auto; color: var(--accent); }
.global-nav { display: flex; gap: 28px; font-size: 14px; }
.global-nav a { color: var(--text-2); text-decoration: none; }
.global-nav a:hover { color: var(--text); }
.header-cta {
  margin-left: auto;
  padding: 7px 14px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background-color .15s, color .15s;
}
.header-cta:hover { background: var(--accent); color: #fff; }

/* ---- Buttons & fields ---------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: #fff;
  font: 500 15px/1 var(--sans); letter-spacing: 0.05em;
  cursor: pointer;
  transition: background-color .15s;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-secondary { background: transparent; color: var(--accent); }
.btn-secondary:hover { background: var(--accent-weak); }

input, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font: 16px/1.6 var(--sans);
  transition: border-color .15s;
}
input:hover, textarea:hover { border-color: var(--text-3); }
input:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-weak); }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #A5A39D; }

.form-msg { min-height: 0; font-size: 14px; margin-top: 8px; }
.form-msg:empty { margin-top: 0; }
.form-msg.error { color: var(--error); }
.form-msg.success { color: var(--accent); }

/* Success state (rendered by app.js) */
.success-panel {
  padding: 20px 22px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
}
.success-panel strong { display: block; font-size: 16px; margin-bottom: 4px; }
.success-panel p { color: var(--text-2); font-size: 14px; }
.share-row { display: flex; gap: 8px; margin-top: 12px; }
.share-row input { font-size: 13px; padding: 8px 12px; color: var(--text-2); }
.share-row .btn { flex: 0 0 auto; white-space: nowrap; min-height: 40px; padding: 0 16px; font-size: 14px; background: transparent; color: var(--accent); }
.share-row .btn:hover { background: var(--accent-weak); }

/* ---- Intro (first view) -------------------------------------------------- */

.intro { padding: 64px 0 56px; }
.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
  gap: 64px;
  align-items: start;
}
.intro-label {
  font-size: 14px; color: var(--accent); font-weight: 500;
  margin-bottom: 16px;
}
.intro h1 { margin-bottom: 24px; }
.lede { color: var(--text-2); max-width: 36em; margin-bottom: 32px; }

.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.inline-field { display: flex; gap: 8px; max-width: 480px; }
.inline-field input { flex: 1; min-height: 48px; }
.fineprint { margin-top: 12px; font-size: 13px; line-height: 1.8; color: var(--text-3); max-width: 480px; }

/* Figure: a plain processing log, captioned like an editorial figure */
.figure { margin-top: 8px; }
.log {
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface);
  font-size: 13.5px; line-height: 1.7;
}
.log-head, .log-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 64px;
  gap: 12px;
  padding: 10px 16px;
}
.log-head {
  font-size: 12px; color: var(--text-3);
  border-bottom: 1px solid var(--line);
  background: var(--tint);
}
.log-row + .log-row { border-top: 1px solid var(--line); }
.log-time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.log-state { color: var(--text-3); font-size: 12px; text-align: right; }
.log-row.is-approval { background: var(--accent-weak); }
.log-row.is-approval .log-state { color: var(--accent); font-weight: 700; }
.figure figcaption { margin-top: 12px; font-size: 13px; line-height: 1.8; color: var(--text-2); }

/* ---- Sections ------------------------------------------------------------ */

/* Spacing varies by role: overview is reference material (tight),
   core content breathes more. */
.section { padding: 80px 0; }
.section-md { padding: 80px 0; }
.section-lg { padding: 96px 0; }
.overview { padding: 48px 0 64px; border-top: 1px solid var(--line); }
.section-tint { background: var(--tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-rule { border-top: 1px solid var(--line); }

.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head h2 { margin-bottom: 12px; }
.section-head p, .split-head p { color: var(--text-2); }

/* Overview spec list */
.overview h2 { margin-bottom: 20px; }
.spec { border-top: 1px solid var(--text); }
.spec > div {
  display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.spec dt { font-size: 14px; font-weight: 700; color: var(--text); }
.spec dd { color: var(--text-2); max-width: 46em; }

/* Split layout: heading column + content column */
.split {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 64px;
}
.split-head h2 { margin-bottom: 16px; }
.split-head { align-self: start; position: sticky; top: 96px; }

.tasks { border-top: 1px solid var(--text); }
.task {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.task ul { list-style: none; color: var(--text-2); }
.task li { position: relative; padding-left: 1.1em; }
.task li + li { margin-top: 4px; }
.task li::before { content: ""; position: absolute; left: 0; top: .9em; width: 6px; height: 1px; background: var(--text-3); }

/* Process */
.process { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--text); }
.process li { display: flex; gap: 16px; padding: 24px 28px 8px 0; }
.process li + li { padding-left: 28px; border-left: 1px solid var(--line-strong); }
.process-no {
  flex: 0 0 auto;
  font-family: var(--serif); font-size: 26px; line-height: 1.2; font-weight: 500;
  color: var(--accent);
}
.process h3 { margin-bottom: 8px; }
.process p { color: var(--text-2); font-size: 15px; }

/* Policies */
.policies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.policies > div { padding-top: 20px; border-top: 1px solid var(--line-strong); }
.policies h3 { margin-bottom: 8px; }
.policies p { color: var(--text-2); font-size: 15px; }
.policy-note {
  margin-top: 40px; padding: 16px 20px;
  background: var(--tint); border-radius: 4px;
  color: var(--text-2); font-size: 14px;
  max-width: 760px;
}

/* FAQ */
.faq { border-top: 1px solid var(--text); max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 20px 0; cursor: pointer; list-style: none;
  font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: 0 0 auto;
  width: 8px; height: 8px; margin-right: 4px;
  border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3);
  transform: translateY(-3px) rotate(45deg);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq summary:hover { color: var(--accent); }
.faq details p { padding: 0 0 22px; color: var(--text-2); max-width: 40em; }

/* Join */
.join { background: var(--surface); border-top: 1px solid var(--line); }
.join-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  gap: 72px;
  align-items: start;
}
.join-copy h2 { margin-bottom: 16px; }
.join-copy > p { color: var(--text-2); max-width: 32em; }
.join-sub { margin-top: 32px; margin-bottom: 8px; font-size: 15px; }
.plain-list { list-style: none; color: var(--text-2); }
.plain-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.plain-list li:first-child { border-top: 1px solid var(--line); }

.waitlist-form-full { display: grid; gap: 20px; }
.waitlist-form-full label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.req {
  margin-left: 6px; padding: 1px 6px;
  border-radius: 3px;
  background: var(--accent-weak); color: var(--accent);
  font-size: 11px; font-weight: 500;
}
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.consent { font-size: 13px; color: var(--text-3); }

/* ---- Footer -------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--line); padding: 48px 0 24px; font-size: 14px; }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
}
.footer-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.footer-logo .logo-mark { width: 22px; height: 22px; }
.footer-tagline { font-family: var(--serif); font-weight: 600; color: var(--text) !important; margin-bottom: 4px; }
.footer-about p:not(.footer-logo) { color: var(--text-2); max-width: 28em; }
.footer-heading { font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.footer-nav { display: grid; gap: 4px; align-content: start; }
.footer-nav a { color: var(--text-2); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--text-3); }

/* ---- Document pages (privacy policy etc.) -------------------------------- */

.doc { padding: 56px 0 96px; }
.doc .container { max-width: calc(760px + var(--gutter) * 2); }
.doc h1 { font-size: clamp(26px, 3.2vw, 34px); margin-bottom: 12px; }
.doc .doc-meta { color: var(--text-3); font-size: 14px; margin-bottom: 40px; }
.doc h2 { font-size: 20px; margin: 40px 0 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.doc p, .doc li { color: var(--text-2); }
.doc ul { padding-left: 1.4em; margin: 8px 0; }
.doc p + p { margin-top: 12px; }

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 1024px) {
  .intro-grid, .join-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .figure { max-width: 640px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .split-head { position: static; max-width: 720px; }
  .policies { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .process { grid-template-columns: minmax(0, 1fr); }
  .process li, .process li + li { padding: 20px 0; border-left: 0; }
  .process li + li { border-top: 1px solid var(--line); }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { font-size: 15.5px; line-height: 1.85; }
  html { scroll-padding-top: 108px; }

  .header-inner { flex-wrap: wrap; height: auto; gap: 0 16px; padding-top: 10px; }
  .header-cta { padding: 6px 12px; font-size: 13px; }
  .global-nav {
    order: 3; width: 100%;
    gap: 22px; padding: 6px 0 8px;
    overflow-x: auto; white-space: nowrap;
    scrollbar-width: none;
  }
  .global-nav::-webkit-scrollbar { display: none; }

  .intro { padding: 40px 0 48px; }
  .intro h1 { margin-bottom: 20px; }
  .inline-field { flex-direction: column; }
  .inline-field .btn { width: 100%; }

  .log-head, .log-row { grid-template-columns: 44px minmax(0, 1fr); gap: 4px 10px; padding: 10px 12px; }
  .log-head span:last-child { display: none; }
  .log-state { grid-column: 2; text-align: left; }

  .section, .section-md { padding: 56px 0; }
  .section-lg { padding: 64px 0; }
  .overview { padding: 40px 0 48px; }

  .spec > div, .task { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .task { padding: 20px 0; }
  .task h3 { margin-bottom: 2px; }

  .field-row { grid-template-columns: minmax(0, 1fr); }
  .form-actions .btn { width: 100%; }

  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-about { grid-column: 1 / -1; }
  .footer-nav a { padding: 4px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
