/* =========================================================
   CIAO — Editorial Design System
   ========================================================= */

:root {
  /* Palette */
  --paper:      #FFFFFF;
  --cream:      #F4F1EC;
  --ink:        #0A0A0A;
  --ink-2:      #1a1a1a;
  --muted:      #6B6B6B;
  --line:       #E5E2DC;
  --line-2:     #D8D4CC;
  --blue:       #1B3FE6;
  --blue-deep:  #102A9C;
  --yellow:     #F5C518;
  --red:        #E14B3A;

  /* Type */
  --f-serif: "Noto Serif JP", "Hiragino Mincho ProN", "游明朝", "YuMincho", serif;
  --f-sans:  "BIZ UDPGothic", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "游ゴシック", "YuGothic", system-ui, -apple-system, sans-serif;
  --f-disp:  "DM Sans", "Noto Serif JP", "Hiragino Mincho ProN", "游明朝", serif;
  --f-mono:  "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* Layout */
  --max:   1440px;
  --gutter: clamp(20px, 4vw, 64px);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-sans);
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.7;
  font-size: 16px;
  letter-spacing: 0.02em;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* -------- Type primitives -------- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: currentColor;
}
.eyebrow.no-rule::before { display: none; }

/* Section heading row (shared) */
.s-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: end;
  padding: 100px 0 56px;
  border-bottom: 1px solid var(--ink);
}
.s-head .num {
  font-family: var(--f-disp);
  font-style: italic;
  font-size: clamp(48px, 6vw, 90px);
  line-height: 0.85;
  color: var(--blue);
  font-weight: 400;
}
.s-head .label-block {
  align-self: end;
  padding-bottom: 18px;
}
.s-head .label-block .eyebrow { margin-bottom: 18px; }
.s-head .label-block h2 {
  font-family: var(--f-serif);
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1.1;
  font-weight: 500;
  margin: 0;
}
.s-head .label-block h2 em {
  font-family: var(--f-disp);
  font-style: italic;
  color: var(--blue);
}
.s-head .label-block h2 .punct { color: var(--yellow); }

/* Subtitle typography (shared) */
.s-head .meta {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  align-self: end;
  padding-bottom: 22px;
  line-height: 2;
}

.hero-aside p {
  font-size: 12px;
  color: var(--muted);
}

.s-hero-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

.kicker {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
}

.disp-num {
  font-family: var(--f-disp);
  font-style: italic;
  font-weight: 400;
  line-height: 0.85;
  letter-spacing: -0.02em;
}

h1, h2, h3, h4 {
  font-family: var(--f-serif);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.01em;
  margin: 0;
  text-wrap: balance;
}

.section-title {
  font-family: var(--f-serif);
  font-size: clamp(32px, 4.4vw, 64px);
  font-weight: 500;
  line-height: 1.12;
  margin: 0;
}
.section-title em {
  font-style: italic;
  font-family: var(--f-disp);
  font-weight: 400;
  color: var(--blue);
}

.lede {
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.85;
  color: var(--ink-2);
  max-width: 56ch;
}

.small { font-size: 13px; color: var(--muted); }
.mono  { font-family: var(--f-mono); letter-spacing: 0.04em; }

/* -------- Layout -------- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.row { display: flex; }
.col { display: flex; flex-direction: column; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.rule-ink { height: 1px; background: var(--ink); border: 0; margin: 0; }

/* -------- Nav -------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  height: 72px;
}
.nav-logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.nav-logo .mark {
  font-family: var(--f-disp);
  font-style: italic;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.nav-logo .mark b {
  color: var(--blue);
  font-style: normal;
  font-family: var(--f-serif);
}
.nav-logo .sub {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0; padding: 0;
  justify-self: center;
}
.nav-links a {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; right: 100%;
  bottom: 0; height: 1px; background: var(--blue);
  transition: right .35s var(--ease);
}
.nav-links a:hover::after,
.nav-links a.is-active::after { right: 0; }
.nav-links a.is-active { color: var(--blue); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.1em;
  border-radius: 999px;
  transition: background .25s var(--ease);
}
.nav-cta:hover { background: var(--blue); }
.nav-cta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 0 rgba(245,197,24,0.65);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(245,197,24,0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(245,197,24,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,197,24,0); }
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.12em;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn .arrow {
  display: inline-block;
  width: 22px; height: 1px; background: currentColor; position: relative;
  transition: width .3s var(--ease);
}
.btn .arrow::after {
  content: "";
  position: absolute; right: 0; top: -3px;
  width: 7px; height: 7px;
  border-right: 1px solid currentColor;
  border-top: 1px solid currentColor;
  transform: rotate(45deg);
}
.btn:hover .arrow { width: 32px; }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-yellow { background: var(--yellow); color: var(--ink); }

/* -------- Footer -------- */
.footer {
  background: var(--ink);
  color: #ddd;
  padding: 80px 0 28px;
  margin-top: 120px;
}
.footer .wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
  border-bottom: 1px solid #2a2a2a;
}
.footer h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #888;
  margin: 0 0 18px;
  font-weight: 500;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer a { font-size: 14px; }
.footer a:hover { color: var(--yellow); }
.footer .mega {
  font-family: var(--f-serif);
  font-size: 40px;
  line-height: 1.05;
  color: #fff;
  margin: 0 0 16px;
}
.footer .mega em {
  font-family: var(--f-disp);
  color: var(--yellow);
  font-style: italic;
}
.footer .mega .punct {
  color: var(--yellow);
  display: inline;
  position: static;
}
.footer-top > div {
  position: relative;
  z-index: 1;
}
.footer [aria-hidden="true"] {
  pointer-events: none;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 28px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: #777;
  letter-spacing: 0.15em;
}

/* -------- Popup -------- */
.popup {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 0 rgba(27,63,230,0.35);
  transform: translateY(40px);
  opacity: 0;
  pointer-events: none;
  transition: transform .55s var(--ease), opacity .4s var(--ease);
}
.popup.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.popup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.popup-head .dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--yellow);
  border-radius: 50%;
  margin-right: 8px;
  animation: pulse 2s infinite;
}
.popup-close {
  background: transparent;
  border: 0;
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 14px;
  padding: 10px 12px;
  margin: -10px -12px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.popup-body { padding: 22px 22px 24px; }
.popup-eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--blue);
  margin: 0 0 10px;
}
.popup h3 {
  font-family: var(--f-serif);
  font-size: 17px;
  line-height: 1.35;
  margin: 0 0 12px;
}
.popup h3 em {
  font-family: var(--f-disp);
  font-style: italic;
  color: var(--blue);
}
.popup p {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0 0 18px;
  line-height: 1.7;
}
.popup-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.12em;
  border-radius: 0;
  border: 0;
  transition: background .25s var(--ease);
}
.popup-cta:hover { background: var(--blue-deep); }

/* -------- Tweaks panel -------- */
.tweaks-trigger {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 180;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  font-family: var(--f-mono);
  font-size: 14px;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 18px rgba(0,0,0,0.15);
}
.tweaks-panel {
  position: fixed;
  left: 24px;
  bottom: 80px;
  z-index: 190;
  width: 280px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 0 var(--ink);
  padding: 18px;
  display: none;
}
.tweaks-panel.is-open { display: block; }
.tweaks-panel h5 {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  margin: 0 0 12px;
  text-transform: uppercase;
  color: var(--muted);
}
.tweaks-row { margin-bottom: 18px; }
.tweaks-row:last-child { margin-bottom: 0; }
.tweaks-swatches { display: flex; gap: 6px; }
.tweaks-swatch {
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  cursor: pointer;
  position: relative;
}
.tweaks-swatch.is-active {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.tweaks-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tweaks-fonts button {
  padding: 8px 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.tweaks-fonts button.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* -------- Animations -------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

/* -------- Marquee strip -------- */
.marquee {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--yellow);
  overflow: hidden;
  position: relative;
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 18px 0;
  animation: marquee 38s linear infinite;
  gap: 56px;
}
.marquee-item {
  font-family: var(--f-serif);
  font-size: 22px;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 56px;
  color: var(--ink);
}
.marquee-item em {
  font-family: var(--f-disp);
  font-style: italic;
  color: var(--blue-deep);
}
.marquee-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* -------- Placeholder image -------- */
.ph {
  background: var(--cream);
  position: relative;
  overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.ph svg {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.45;
}

/* Support phases (subsidy) */
.phase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.phase-step {
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.phase-num {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
  display: block;
  margin-bottom: 10px;
}
.phase-step h4 {
  font-family: var(--f-serif);
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 8px;
  line-height: 1.4;
}
.phase-step p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
}

/* responsive */
@media (max-width: 768px) {
  body { font-size: 15px; line-height: 1.8; }
  .wrap { padding-left: 20px; padding-right: 20px; }
  .s-head {
    grid-template-columns: 1fr;
    padding: 56px 0 32px;
    gap: 12px;
  }
  .s-head .meta { text-align: left; }
  .s-head .num { font-size: 48px; }
  .phase-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .nav-links { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer .mega { font-size: 32px; }
  .popup { width: calc(100vw - 32px); }
}
