:root {
  /* Utilitarian, sharp palette */
  --bg: oklch(0.99 0.005 260);
  --surface: oklch(0.96 0.01 260);
  --surface-alt: oklch(0.93 0.015 260);
  --ink: oklch(0.15 0.02 260);
  --ink-light: oklch(0.4 0.03 260);
  --line: oklch(0.88 0.02 260);
  
  --brand: oklch(0.5 0.22 260);
  --brand-hover: oklch(0.45 0.2 260);
  --brand-text: oklch(0.98 0.01 260);

  /* Fluid Spacing */
  --space-xs: clamp(0.5rem, 1vw, 0.75rem);
  --space-sm: clamp(1rem, 2vw, 1.5rem);
  --space-md: clamp(2rem, 4vw, 3rem);
  --space-lg: clamp(4rem, 8vw, 6rem);
  --space-xl: clamp(6rem, 12vw, 10rem);

  /* Grid Setup */
  --container: min(1200px, 90vw);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  margin: 0;
  font-family: "Noto Sans TC", -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Noto Serif TC", serif;
  color: var(--ink);
  margin: 0;
  font-weight: 900;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.3;
}

p { margin: 0 0 1rem 0; }
a { color: var(--brand); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--ink); }

/* Header */
.site-header {
  position: fixed;
  top: 0; width: 100%;
  background: color-mix(in oklch, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}

.header-inner {
  width: var(--container);
  margin: 0 auto;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: "Noto Serif TC", serif;
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

#main-nav {
  display: flex;
  gap: 2rem;
}

#main-nav a {
  color: var(--ink-light);
  font-size: 0.9rem;
  font-weight: 500;
}

#main-nav a:hover {
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn-primary, .btn-ghost, .btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 4px; /* Brutalist/sharp radius */
  transition: all 0.2s ease-out;
  cursor: pointer;
  padding: 0.6rem 1.2rem;
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-text);
  border: 1px solid var(--brand);
}

.btn-primary:hover {
  background: var(--brand-hover);
  color: var(--brand-text);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--ink-light);
}

.btn-link {
  background: transparent;
  color: var(--ink);
  padding: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
}

.btn-link:hover {
  color: var(--brand);
  border-color: var(--brand);
}

/* Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s;
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 4rem;
  left: 0;
  width: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 99;
}

.mobile-nav.open { display: block; }

.mobile-nav-inner {
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.mobile-nav-link {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
  display: block;
}

.mobile-nav-link:last-child { border-bottom: none; }
.mobile-nav-link.primary { color: var(--brand); font-weight: 700; }

/* Main layout */
main {
  width: var(--container);
  margin: 0 auto;
  padding-top: 6rem;
  padding-bottom: var(--space-xl);
}

section { margin-bottom: var(--space-xl); }

.section-header { margin-bottom: var(--space-md); }
.section-header p {
  color: var(--ink-light);
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 60ch;
  margin-top: 1rem;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
  min-height: 70vh;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  color: var(--ink-light);
}

.hero .intro {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--ink-light);
  margin: 2rem 0;
  max-width: 48ch;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Hero Bento */
.hero-bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(140px, auto);
  gap: 1rem;
}

.bento-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-item .step {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-light);
}

.bento-item p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.bento-1 { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.bento-1 .step { color: var(--line); }

/* Features Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 280px;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--ink-light); font-size: 0.95rem; margin: 0; }

.card.wide { grid-column: span 2; }
.card.tall { grid-row: span 2; }

.card-dark {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.card-dark h3 { color: var(--bg); }
.card-dark p { color: var(--surface-alt); }

/* Modules list */
.module-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.module-item {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}

.module-num {
  font-family: "Noto Serif TC", serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--ink-light);
}

.module-text h3 { margin-bottom: 0.5rem; font-size: 1.25rem; }
.module-text p { color: var(--ink-light); margin: 0; max-width: 60ch; }

/* Gallery */
.gallery-showcase {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-md);
}

.showcase-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.shot {
  margin: 0;
}

.shot img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}

.shot figcaption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-light);
  font-weight: 500;
}

.app-shot img { max-width: 240px; margin: 0 auto; box-shadow: 0 8px 24px rgba(0,0,0,0.08); border-radius: 24px; }

/* Scenarios */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.scenario-card {
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
}

.scenario-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.scenario-card p { font-size: 0.9rem; color: var(--ink-light); }

/* Deploy Timeline */
.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.timeline-item {
  position: relative;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.timeline-marker {
  position: absolute;
  top: -0.5rem;
  left: 0;
  width: 1rem;
  height: 1rem;
  background: var(--brand);
  color: var(--bg);
  font-size: 0.6rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.timeline-content h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.timeline-content p { font-size: 0.9rem; color: var(--ink-light); }

/* CTA */
.cta {
  background: var(--ink);
  color: var(--bg);
  padding: var(--space-lg);
  border-radius: 12px;
  text-align: center;
}

.cta h2 { color: var(--bg); margin-bottom: 1rem; }
.cta p { color: var(--surface-alt); margin-bottom: 2rem; font-size: 1.1rem; }
.cta-actions { display: flex; justify-content: center; gap: 1rem; }
.btn-large { padding: 1rem 2rem; font-size: 1.1rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0;
}

.footer-inner {
  width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-inner .brand { font-family: "Noto Serif TC", serif; font-weight: 900; margin: 0; }
.footer-inner .copyright { color: var(--ink-light); font-size: 0.85rem; margin: 0; }
.footer-link { color: var(--ink-light); font-size: 0.85rem; text-decoration: none; }
.footer-link:hover { color: var(--ink); }

/* Animation Reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .bento-grid { grid-template-columns: 1fr 1fr; }
  .card.wide { grid-column: 1 / -1; }
  .gallery-showcase { grid-template-columns: 1fr; }
  .showcase-col { flex-direction: row; overflow-x: auto; padding-bottom: 1rem; }
  .app-shot img { max-width: 200px; }
  .scenario-grid { grid-template-columns: 1fr 1fr; }
  .timeline { grid-template-columns: 1fr 1fr; gap: 2rem; }
  #main-nav, .header-actions .btn-ghost { display: none; }
  .menu-toggle { display: flex; }
}

@media (max-width: 600px) {
  .bento-grid { grid-template-columns: 1fr; }
  .scenario-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .timeline-item {
    border-top: none;
    border-left: 1px solid var(--line);
    padding-top: 0;
    padding-left: 2rem;
    padding-bottom: 2rem;
  }
  .timeline-marker { top: 0; left: -0.5rem; }
  .showcase-col { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in-view { transition: none; opacity: 1; transform: none; }
  .card { transition: none; transform: none; }
}
