/* ============================================
   HotelTech Industry Research — Shared Design System
   Editorial / data journalism aesthetic
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+JP:wght@300;400;500;700&family=Newsreader:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  /* Color Palette */
  --bg: #faf8f3;
  --bg-elevated: #ffffff;
  --bg-subtle: #f0ebe1;
  --ink: #1a1a1a;
  --ink-muted: #5a5a5a;
  --ink-light: #8a8a8a;
  --line: #d8d2c4;
  --line-strong: #b8b0a0;

  --accent: #b8351c;       /* Editorial red, like FT pink-red */
  --accent-soft: #f4ddd6;
  --accent-deep: #8a2515;

  --success: #2e6b3a;
  --warning: #b8761c;
  --danger: #b8351c;
  --info: #1c5a8a;

  /* Typography */
  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Newsreader', 'Noto Serif JP', Georgia, serif;
  --font-mono: 'SF Mono', Menlo, Consolas, monospace;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  /* Layout */
  --w-narrow: 680px;
  --w-content: 880px;
  --w-wide: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 var(--s-4);
}

h1 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.025em; font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); }

p { margin: 0 0 var(--s-4); }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
a:hover { text-decoration-color: var(--accent); color: var(--accent-deep); }

strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

/* Numbers — tabular */
.num, td.num, th.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Pull quote / drop emphasis */
.lede {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--ink-muted);
  font-style: italic;
  margin-bottom: var(--s-6);
}

/* ============================================
   Layout
   ============================================ */

.container { max-width: var(--w-wide); margin: 0 auto; padding: 0 var(--s-5); }
.container-content { max-width: var(--w-content); margin: 0 auto; padding: 0 var(--s-5); }
.container-narrow { max-width: var(--w-narrow); margin: 0 auto; padding: 0 var(--s-5); }

.section { padding: var(--s-7) 0; }
.section-tight { padding: var(--s-5) 0; }

/* Top nav bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: var(--s-3) 0;
  backdrop-filter: blur(8px);
  background: rgba(250, 248, 243, 0.92);
}
.topbar-inner {
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: 0 var(--s-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}
.topbar a { text-decoration: none; }
.topbar-brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.topbar-brand .accent { color: var(--accent); }
.topbar-meta { color: var(--ink-muted); font-size: 0.85rem; }

/* Page hero */
.hero {
  padding: var(--s-8) 0 var(--s-7);
  border-bottom: 1px solid var(--line);
}
.hero .kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--s-4);
}
.hero h1 { margin-bottom: var(--s-4); }
.hero .lede { margin-bottom: 0; max-width: 720px; }

/* Footer */
.site-footer {
  margin-top: var(--s-9);
  padding: var(--s-7) 0;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* ============================================
   Components
   ============================================ */

/* Card */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: var(--s-5);
}
.card-padded { padding: var(--s-6); }

/* Pill / tag */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.pill-accent { background: var(--accent-soft); color: var(--accent-deep); }
.pill-success { background: #e0ecdf; color: #2e6b3a; }
.pill-warning { background: #f5e9d0; color: #8a5a14; }
.pill-danger { background: #f4ddd6; color: var(--accent-deep); }
.pill-info { background: #d6e4ee; color: #1c4a6e; }

/* Stat block */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  font-weight: 500;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-value-large { font-size: 2.8rem; }
.stat-sub {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: var(--s-5) 0;
  font-variant-numeric: tabular-nums;
}
table th, table td {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  border-bottom: 2px solid var(--ink);
  background: transparent;
}
table tr:hover td { background: rgba(0,0,0,0.015); }
table.no-hover tr:hover td { background: transparent; }
.t-num { text-align: right; font-variant-numeric: tabular-nums; }
.t-center { text-align: center; }

/* Highlighted row */
table tr.row-emphasis td {
  background: var(--accent-soft);
  font-weight: 600;
}
table tr.row-emphasis:hover td {
  background: var(--accent-soft);
}

/* Grid utilities */
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Flex utilities */
.flex { display: flex; gap: var(--s-3); }
.flex-col { flex-direction: column; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }

/* Decorative */
.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--s-6) 0;
}
.divider-strong { border-top-color: var(--ink); }
.divider-accent {
  border: none;
  height: 3px;
  width: 48px;
  background: var(--accent);
  margin: var(--s-4) 0;
}

/* Callout */
.callout {
  border-left: 3px solid var(--accent);
  padding: var(--s-3) var(--s-5);
  background: var(--accent-soft);
  margin: var(--s-5) 0;
  font-size: 0.95rem;
}
.callout-info {
  border-left-color: var(--info);
  background: #e3eef6;
}
.callout-warn {
  border-left-color: var(--warning);
  background: #f5e9d0;
}
.callout-success {
  border-left-color: var(--success);
  background: #e0ecdf;
}
.callout strong { color: var(--ink); }

/* Footnote / source */
.source {
  font-size: 0.75rem;
  color: var(--ink-light);
  font-style: italic;
  margin-top: var(--s-2);
}

/* Code / mono */
code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-subtle); padding: 1px 5px; border-radius: 3px; }
pre { font-family: var(--font-mono); background: var(--bg-subtle); padding: var(--s-4); border-radius: 4px; overflow-x: auto; line-height: 1.5; font-size: 0.85rem; border: 1px solid var(--line); }

/* Topic card (used on index) */
.topic-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: var(--s-5);
  transition: border-color 0.15s, transform 0.15s;
}
.topic-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}
.topic-card .topic-num {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--accent);
  font-weight: 600;
}
.topic-card h3 {
  margin: var(--s-2) 0 var(--s-2);
  font-size: 1.1rem;
}
.topic-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.5;
}
.topic-card .topic-meta {
  margin-top: var(--s-3);
  font-size: 0.78rem;
  color: var(--ink-light);
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* Big number display */
.big-num {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.big-num-accent { color: var(--accent); }

/* Subtle annotation */
.note {
  font-size: 0.8rem;
  color: var(--ink-light);
  font-style: italic;
}

/* Strength bar (for 5 forces, etc.) */
.strength-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.strength-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 100px;
  overflow: hidden;
}
.strength-bar-fill {
  height: 100%;
  background: var(--ink);
  transition: width 0.4s;
}
.strength-bar-fill.strong { background: var(--accent); }
.strength-bar-fill.medium { background: var(--warning); }
.strength-bar-fill.weak { background: var(--ink-light); }
.strength-label {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  min-width: 60px;
}

/* Print-friendly nav backlink */
.backlink {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: none;
  margin-bottom: var(--s-5);
}
.backlink:hover { color: var(--accent); text-decoration: none; }
.backlink::before { content: "←"; }

/* Section header pattern */
.section-header {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-3);
  border-bottom: 2px solid var(--ink);
}
.section-header h2 { margin: 0; }
.section-header .section-num {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--accent);
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* SVG containers */
.viz {
  width: 100%;
  margin: var(--s-5) 0;
}
.viz svg { width: 100%; height: auto; display: block; }

/* Responsive */
@media (max-width: 768px) {
  .hero { padding: var(--s-7) 0 var(--s-5); }
  table { font-size: 0.85rem; }
  table th, table td { padding: var(--s-2) var(--s-3); }
  .big-num { font-size: 2.8rem; }
  .stat-value-large { font-size: 2rem; }
}

/* Print styles */
@media print {
  .topbar, .site-footer { display: none; }
  body { background: white; color: black; }
  a { color: black; text-decoration: underline; }
  .card { border: 1px solid #ccc; }
}
