/* ====== Design Tokens — MIXI Slide Kit (web edition) ======
   "The Corporate Warmth" — MIXI brand trust + approachable detail.
   White background, MIXI RED primary accent, gray callouts.
   One accent per page; red and orange never share a section. */
:root {
  /* Core — text & surfaces */
  --ink:          #282828;   /* Body text — not pure black */
  --ink-mute:     #9A9A9A;
  --ink-dim:      #555555;
  --surface:      #FFFFFF;
  --surface-2:    #F5F5F5;   /* Callout / soft block background */
  --surface-3:    #FAFAFA;   /* Card background */
  --line:         #E8E8E8;
  --line-soft:    #EEEEEE;

  /* Accent — MIXI RED primary */
  --coral:        #E5004D;   /* MIXI RED (historic var name preserved) */
  --coral-glow:   #FF3D80;
  --coral-deep:   #C40043;
  --amber:        #F5A000;   /* MIXI ORANGE — decoration only, not with red in same section */
  --ember:        #FFC040;

  /* MIXI accent (restrained) */
  --mixi-orange:  #F5A000;

  /* Semantic */
  --success:      #1F7A3F;
  --warn:         #F5A000;
  --critical:     #D85858;

  /* Typography */
  --font-sans:    "Noto Sans JP", "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-mono:    "SF Mono", "Menlo", Consolas, monospace;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 16px;  /* Slide Kit callout/card default */
  --radius-lg: 16px;

  /* Content max widths */
  --max-prose: 760px;
  --max-wide:  1200px;
}

/* ====== Reset ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "palt";
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--coral); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--coral); color: #FFFFFF; }
img, svg { max-width: 100%; display: block; }
code, pre { font-family: var(--font-mono); }

/* ====== Decorative accents — Slide Kit template chrome ======
   Template decorations (stripes, angled corners) carry the accent color so
   the content area stays clean. One accent per section. */
.deco-stripe {
  position: absolute;
  top: 0; right: 0;
  width: 40%; height: 100%;
  background: repeating-linear-gradient(
    135deg,
    transparent 0px, transparent 18px,
    var(--coral) 18px, var(--coral) 20px
  );
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}
.deco-corner {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.deco-corner.top-right {
  top: -60px; right: -60px;
  width: 280px; height: 280px;
  background: var(--coral);
  opacity: 0.05;
  border-radius: 24px;
  transform: rotate(15deg);
}
.deco-corner.bottom-left {
  bottom: -40px; left: -40px;
  width: 180px; height: 180px;
  background: var(--amber);
  opacity: 0.05;
  border-radius: 20px;
  transform: rotate(-12deg);
}

/* Pull content above decorations */
.container, .prose, main, section > .container { position: relative; z-index: 1; }

/* ====== Typography — Slide Kit display scale ====== */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--ink);
}
/* Cover-scale display for the hero (slide kit: 96px, web: clamped) */
h1 { font-size: clamp(2.25rem, 6.5vw, 4.75rem); letter-spacing: -0.01em; line-height: 1.12; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); margin-top: var(--space-16); margin-bottom: var(--space-6); }
h3 { font-size: 1.35rem; margin-top: var(--space-8); margin-bottom: var(--space-3); }
h4 { font-size: 1.05rem; margin-top: var(--space-6); margin-bottom: var(--space-2); color: var(--ink); }
p  { margin-bottom: var(--space-4); }
.lead { font-size: 1.25rem; color: var(--ink-dim); max-width: 760px; line-height: 1.7; }
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coral);
  font-weight: 700;
  margin-bottom: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 2px;
  background: var(--coral);
}

/* ====== Layout ====== */
.container { max-width: var(--max-wide); margin: 0 auto; padding: 0 var(--space-8); }
.prose     { max-width: var(--max-prose); margin: 0 auto; }
section    { padding: var(--space-24) 0; }
section + section { border-top: 1px solid var(--line); }

/* ====== Card — Slide Kit style with lift ====== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s;
  position: relative;
}
.card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
  transform: translateY(-2px);
  border-color: var(--line);
}
/* Card with coral top accent bar — for feature cards */
.card.accent {
  padding-top: var(--space-8);
}
.card.accent::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--coral);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* ====== Tables ====== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}
th { color: var(--coral); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase; }
tbody tr:hover { background: var(--surface-2); }

/* ====== Code blocks ====== */
pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  margin: var(--space-4) 0;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
}
code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--ink);
}
pre code { background: transparent; padding: 0; }

/* ====== Buttons — MIXI pill ====== */
.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-8);
  background: var(--coral);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}
.btn:hover { background: var(--coral-deep); color: #FFFFFF; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--coral); border: 1px solid var(--coral); }
.btn.ghost:hover { background: var(--surface-2); color: var(--coral); }

/* ====== Badge ====== */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  letter-spacing: 0.04em;
  font-weight: 700;
}
.badge.new     { background: var(--coral); color: #FFFFFF; }
.badge.warn    { background: #FFF4E0; color: #8A5A00; }
.badge.stable  { background: #E8F5EA; color: var(--success); }

/* ====== Callout — Slide Kit: gray body, colored left border ====== */
.callout {
  border-left: 4px solid var(--coral);
  background: var(--surface-2);
  padding: var(--space-6) var(--space-8);
  margin: var(--space-6) 0;
  border-radius: var(--radius-md);
  color: var(--ink);
}
.callout.warn     { border-left-color: var(--warn); }
.callout.critical { border-left-color: var(--critical); background: #FFF5F8; }
.callout.success  { border-left-color: var(--success); }

/* ====== Utilities ====== */
.text-mute { color: var(--ink-mute); }
.text-dim  { color: var(--ink-dim); }
.text-coral { color: var(--coral); }
.small  { font-size: 0.85rem; }
.tabular { font-variant-numeric: tabular-nums; }
.mono   { font-family: var(--font-mono); }
.hidden { display: none; }

/* ====== Alternating section tone — rhythm without noise ====== */
section.tone-soft {
  background: var(--surface-2);
}
section.tone-peach {
  background: #FFF5F8;  /* Barely-there MIXI RED tint */
}
section.tone-cream {
  background: #FFFAE8;  /* Barely-there MIXI ORANGE tint */
}

/* ====== Stat band — big colored numbers as visual anchor ====== */
.stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-8);
  margin-top: var(--space-12);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;  /* allow grid cell to shrink without overflow */
}
.stat-num {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 700;
  color: var(--coral);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;    /* keep value+unit on one line */
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-num.secondary { color: var(--amber); }
.stat-num .unit {
  font-size: 0.42em;
  color: var(--ink-dim);
  font-weight: 400;
  margin-left: 4px;
  letter-spacing: 0;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 720px) {
  .stat-band { grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
  .stat-num  { font-size: 2rem; }
}

/* ====== Visual timeline — horizontal colored bars ====== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-8) 0;
}
.tl-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--space-4);
  align-items: center;
}
.tl-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.tl-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border-left: 4px solid var(--coral);
  min-height: 56px;
}
.tl-bar.main {
  background: linear-gradient(to right, #FFF5F8, var(--surface-2));
  border-left-width: 6px;
  min-height: 72px;
}
.tl-bar.secondary { border-left-color: var(--amber); }
.tl-bar.opening   { border-left-color: var(--ink-mute); }
.tl-bar.closing   { border-left-color: var(--ink-mute); }
.tl-duration {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--coral);
  font-weight: 700;
  white-space: nowrap;
}
.tl-bar.secondary .tl-duration { color: var(--amber); }
.tl-title { font-weight: 700; color: var(--ink); }
.tl-sub   { color: var(--ink-mute); font-size: 0.85rem; }

/* ====== Numbered step badges (prep, action lists) ====== */
.numbered-list {
  list-style: none;
  counter-reset: n;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: var(--space-6) 0;
}
.numbered-list li {
  counter-increment: n;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--surface-2);
  border-radius: var(--radius-md);
}
.numbered-list li::before {
  content: counter(n, decimal-leading-zero);
  flex: 0 0 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--coral);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 50%;
}
.numbered-list.secondary li::before { background: var(--amber); }

/* ====== Section eyebrow with icon-glyph (optional) ====== */
.eyebrow-glyph {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.eyebrow-glyph .glyph {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFF5F8;
  color: var(--coral);
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
}
.eyebrow-glyph .eyebrow { margin-bottom: 0; }

/* ====== Responsive ====== */
@media (max-width: 720px) {
  .container { padding: 0 var(--space-4); }
  section    { padding: var(--space-16) 0; }
  .card      { padding: var(--space-6); }
  h1         { font-size: 2rem; }
  h2         { font-size: 1.5rem; margin-top: var(--space-8); }
  .tl-row    { grid-template-columns: 1fr; gap: var(--space-1); }
  .tl-time   { font-size: 0.75rem; }
}
