/* ============================================
   WARMPAGE DESIGN SYSTEM
   A warm, minimal, typographic design system.
   Background: off-white / Accent: semantic colors / Motion: restrained
   ============================================ */

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  /* Background palette */
  --bg:          #FAF9F7;   /* page background — warm white */
  --bg-warm:     #F5F3F0;   /* slightly darker warm, for inset areas */
  --bg-card:     #FFFFFF;   /* card surfaces */
  --bg-subtle:   #EEECEA;   /* subtle highlight, chips */

  /* Semantic accent colors */
  --coral:        #E85D4A;
  --coral-bg:     rgba(232, 93, 74, 0.06);
  --coral-border: rgba(232, 93, 74, 0.15);

  --blue:         #2563EB;
  --blue-bg:      rgba(37, 99, 235, 0.06);
  --blue-border:  rgba(37, 99, 235, 0.15);

  --green:        #059669;
  --green-bg:     rgba(5, 150, 105, 0.06);
  --green-border: rgba(5, 150, 105, 0.15);

  --amber:        #D97706;
  --amber-bg:     rgba(217, 119, 6, 0.06);
  --amber-border: rgba(217, 119, 6, 0.15);

  --violet:       #7C3AED;
  --violet-bg:    rgba(124, 58, 237, 0.06);
  --violet-border:rgba(124, 58, 237, 0.15);

  /* Typography */
  --text:           #1A1A1A;
  --text-secondary: #555555;
  --text-muted:     #999999;

  /* Borders */
  --border:       #E8E6E3;
  --border-light: #F0EEEB;

  /* Font stacks */
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Spacing & shape */
  --container: 1000px;
  --gutter:    24px;
  --radius:    10px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: rgba(232, 93, 74, 0.12);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section {
  padding: 88px 0;
}

/* Two-column layout — text + sidebar */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 40px;
}

/* Three-column grid */
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

/* ============================================
   NAVIGATION
   ============================================ */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.nav-brand {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

/* ============================================
   DIVIDER
   ============================================ */
.divider {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.divider-inner {
  height: 1px;
  background: var(--border);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 {
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text);
}

h2 {
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 8px;
}

p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

p:last-child {
  margin-bottom: 0;
}

/* Section label — small all-caps tag above headings */
.section-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* Lead — large intro paragraph */
.lead {
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  line-height: 1.9;
  color: var(--text-secondary);
}

/* Inline emphasis — dark + bold */
.highlight {
  color: var(--text);
  font-weight: 600;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 140px 0 80px;
}

/* Small mono badge above h1 */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--coral);
  margin-bottom: 28px;
}

.hero-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  opacity: 0.6;
}

.hero h1 {
  margin-bottom: 28px;
  max-width: 780px;
}

.hero-desc {
  max-width: 660px;
  font-size: clamp(1rem, 1.8vw, 1.0625rem);
  line-height: 1.9;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Stat row below hero copy */
.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   BLOCKQUOTE / MISSION QUOTE
   ============================================ */
.quote-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  border-left: 3px solid var(--coral);
}

.quote-card blockquote {
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 16px;
  font-style: italic;
}

.quote-card .quote-source {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Color variants for left border */
.quote-card.coral  { border-left-color: var(--coral); }
.quote-card.blue   { border-left-color: var(--blue); }
.quote-card.green  { border-left-color: var(--green); }
.quote-card.amber  { border-left-color: var(--amber); }
.quote-card.violet { border-left-color: var(--violet); }

/* ============================================
   DESC ITEM (text block with h3 + p)
   ============================================ */
.desc-item {
  margin-bottom: 28px;
}

.desc-item:last-child {
  margin-bottom: 0;
}

.desc-item h3 {
  font-size: 0.9375rem;
}

.desc-item p {
  font-size: 0.9375rem;
  line-height: 1.8;
}

/* ============================================
   PROJECT CARDS (alternating left/right layout)
   ============================================ */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 64px;
  margin-top: 48px;
}

.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* Even cards flip to right-side narrative */
.project-card:nth-child(even) {
  direction: rtl;
}

.project-card:nth-child(even) > * {
  direction: ltr;
}

.project-narrative {
  padding-top: 8px;
}

/* Small mono tag above project name */
.project-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 4px;
  padding: 3px 10px;
  margin-bottom: 16px;
}

.project-tag.coral  { color: var(--coral);  background: var(--coral-bg); }
.project-tag.blue   { color: var(--blue);   background: var(--blue-bg); }
.project-tag.green  { color: var(--green);  background: var(--green-bg); }
.project-tag.amber  { color: var(--amber);  background: var(--amber-bg); }
.project-tag.violet { color: var(--violet); background: var(--violet-bg); }

.project-name {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.project-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-style: italic;
}

.project-narrative p {
  font-size: 0.9375rem;
  line-height: 1.85;
}

/* ============================================
   DETAIL BOX (stats + features + footer quote)
   ============================================ */
.detail-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-header {
  padding: 24px 28px 0;
}

.detail-header h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* 2×2 stat grid inside detail box */
.detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 28px 24px;
}

.detail-stat {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid;
}

.detail-stat.coral  { background: var(--coral-bg);  border-color: var(--coral-border); }
.detail-stat.blue   { background: var(--blue-bg);   border-color: var(--blue-border); }
.detail-stat.green  { background: var(--green-bg);  border-color: var(--green-border); }
.detail-stat.amber  { background: var(--amber-bg);  border-color: var(--amber-border); }
.detail-stat.violet { background: var(--violet-bg); border-color: var(--violet-border); }

.detail-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 2px;
}

.detail-stat.coral  .detail-stat-value { color: var(--coral); }
.detail-stat.blue   .detail-stat-value { color: var(--blue); }
.detail-stat.green  .detail-stat-value { color: var(--green); }
.detail-stat.amber  .detail-stat-value { color: var(--amber); }
.detail-stat.violet .detail-stat-value { color: var(--violet); }

.detail-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Feature list inside detail box */
.detail-features {
  border-top: 1px solid var(--border);
  padding: 20px 28px;
}

.detail-features ul {
  list-style: none;
}

.detail-features li {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 6px 0;
  padding-left: 16px;
  position: relative;
  line-height: 1.6;
}

.detail-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

/* Dot color variants */
.detail-features.coral  li::before { background: var(--coral); }
.detail-features.blue   li::before { background: var(--blue); }
.detail-features.green  li::before { background: var(--green); }
.detail-features.amber  li::before { background: var(--amber); }
.detail-features.violet li::before { background: var(--violet); }

/* Footer quote inside detail box */
.detail-quote {
  border-top: 1px solid var(--border);
  padding: 20px 28px;
  background: var(--bg-warm);
}

.detail-quote p {
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.detail-quote .quote-attr {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: normal;
  margin-top: 8px;
  display: block;
}

/* ============================================
   STORY CARDS (3-col grid, top color bar)
   ============================================ */
.story-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  border-top: 3px solid transparent;
}

.story-card.coral  { border-top-color: var(--coral); }
.story-card.blue   { border-top-color: var(--blue); }
.story-card.green  { border-top-color: var(--green); }
.story-card.amber  { border-top-color: var(--amber); }
.story-card.violet { border-top-color: var(--violet); }

/* Auto-color first three children if no explicit class */
.three-col .story-card:nth-child(1):not([class*="coral"]):not([class*="blue"]):not([class*="green"]) { border-top-color: var(--violet); }
.three-col .story-card:nth-child(2):not([class*="coral"]):not([class*="blue"]):not([class*="green"]) { border-top-color: var(--blue); }
.three-col .story-card:nth-child(3):not([class*="coral"]):not([class*="blue"]):not([class*="green"]) { border-top-color: var(--green); }

.story-card h3 {
  font-size: 0.9375rem;
  margin-bottom: 12px;
}

.story-card p {
  font-size: 0.875rem;
  line-height: 1.75;
}

.story-tag {
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  display: block;
}

/* ============================================
   VALUE CARDS (left color bar)
   ============================================ */
.value-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.value-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  border-left: 3px solid transparent;
}

.value-card.coral  { border-left-color: var(--coral); }
.value-card.blue   { border-left-color: var(--blue); }
.value-card.green  { border-left-color: var(--green); }
.value-card.amber  { border-left-color: var(--amber); }
.value-card.violet { border-left-color: var(--violet); }

/* Auto-color first three if no explicit class */
.value-list .value-card:nth-child(1):not([class*="coral"]):not([class*="blue"]):not([class*="violet"]) { border-left-color: var(--coral); }
.value-list .value-card:nth-child(2):not([class*="coral"]):not([class*="blue"]):not([class*="violet"]) { border-left-color: var(--blue); }
.value-list .value-card:nth-child(3):not([class*="coral"]):not([class*="blue"]):not([class*="violet"]) { border-left-color: var(--violet); }

.value-card h3 {
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.value-card p {
  font-size: 0.8125rem;
  line-height: 1.75;
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--coral);
  width: 56px;
  flex-shrink: 0;
  padding-top: 2px;
}

.timeline-content h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.timeline-content p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--coral);
  color: #fff;
}

.btn-primary:hover {
  background: #d4503f;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
  text-align: center;
  padding: 80px 0 100px;
}

.cta-section h2 {
  margin-bottom: 12px;
}

.cta-section .lead {
  max-width: 560px;
  margin: 0 auto 36px;
}

.cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* CTA cards with QR placeholder */
.cta-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 700px;
  margin: 40px auto 0;
  text-align: left;
}

.cta-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cta-card h3 {
  font-size: 0.9375rem;
  margin-bottom: 8px;
}

.cta-card p {
  font-size: 0.8125rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.qr-placeholder {
  width: 160px;
  height: 160px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 12px;
  background: var(--bg-warm);
}

.qr-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-left {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-right {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-right a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-right a:hover {
  color: var(--text);
}

/* ============================================
   SCROLL FADE-IN ANIMATION
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (max-width: 768px) {
  :root {
    --gutter: 20px;
  }

  section {
    padding: 56px 0;
  }

  .hero {
    padding: 110px 0 56px;
  }

  .hero-stats {
    gap: 28px;
  }

  .nav-links {
    display: none;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .three-col {
    grid-template-columns: 1fr;
  }

  .project-card,
  .project-card:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 24px;
  }

  .cta-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
