:root {
  --paper: #FAF8F4;
  --ink: #17130E;
  --muted: #6F675C;
  --line: rgba(23, 19, 14, 0.1);
  --accent: #E4573D;
  --dusk: #5A54A4;
  --sky: #93B5D6;
  --peach: #F6BE96;
  --serif: "Fraunces", "Noto Serif TC", serif;
  --sans: "Inter", "Noto Sans TC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container { width: min(1160px, 92vw); margin: 0 auto; }

::selection { background: var(--accent); color: #fff; }

/* grain overlay */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 60; opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 3%); }
}

/* ===== header ===== */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 1.4rem 0;
  transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}
header.scrolled {
  background: rgba(250, 248, 244, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
  padding: 0.9rem 0;
}
.nav { display: flex; align-items: center; justify-content: space-between; }
.brand {
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem;
  letter-spacing: 0.06em; color: var(--ink); text-decoration: none;
}
.brand span { color: var(--accent); font-size: 0.7em; vertical-align: super; }
.nav-links { display: flex; align-items: center; gap: 2.2rem; }
.nav-links a {
  color: var(--ink); text-decoration: none; font-size: 0.92rem; font-weight: 500;
  opacity: 0.82; transition: opacity 0.25s;
}
.nav-links a:hover { opacity: 1; }
.nav-links .nav-cta {
  border: 1px solid var(--ink); border-radius: 999px; padding: 0.45rem 1.15rem;
  opacity: 1; transition: background 0.3s, color 0.3s;
}
.nav-links .nav-cta:hover { background: var(--ink); color: var(--paper); }
.burger { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.burger span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: 0.3s; }

/* ===== hero ===== */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 8rem 0 5rem; }
.hero-bg {
  position: absolute; inset: -12%;
  background:
    radial-gradient(58% 48% at 12% 10%, rgba(147, 181, 214, 0.5), transparent 62%),
    radial-gradient(50% 44% at 86% 14%, rgba(196, 181, 232, 0.46), transparent 64%),
    radial-gradient(66% 56% at 80% 80%, rgba(246, 190, 150, 0.5), transparent 66%),
    radial-gradient(46% 42% at 18% 84%, rgba(240, 224, 199, 0.62), transparent 62%);
  filter: blur(2px);
  animation: drift 16s ease-in-out infinite alternate;
  z-index: -1;
}
@keyframes drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(1.5%, 1.5%, 0) scale(1.06); }
}
.eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 0.6rem;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.7rem, 6.4vw, 5.1rem);
  line-height: 1.14; letter-spacing: -0.015em;
  margin: 1.6rem 0 1.8rem;
}
.hero h1 em {
  font-style: italic; font-weight: 500; color: var(--accent);
}
.hero-sub { max-width: 34em; color: var(--muted); font-size: 1.02rem; }
.hero-actions { display: flex; gap: 1rem; margin: 2.4rem 0 3.4rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; padding: 0.85rem 1.9rem;
  font-size: 0.95rem; font-weight: 600; text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s, color 0.3s;
}
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(23, 19, 14, 0.22); }
.btn.ghost { border: 1px solid var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink); }
.hero-stats { display: flex; gap: 3.2rem; flex-wrap: wrap; }
.stat h3 { font-family: var(--serif); font-size: 2rem; font-weight: 600; }
.stat p { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.08em; }
.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  font-size: 0.66rem; letter-spacing: 0.34em; color: var(--muted);
  writing-mode: vertical-rl; opacity: 0.7;
  animation: hint 2.6s ease-in-out infinite;
}
@keyframes hint { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ===== sections ===== */
section { padding: 7rem 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 2rem; margin-bottom: 3.2rem; flex-wrap: wrap;
}
h2 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.01em;
  margin-top: 0.9rem; line-height: 1.2;
}
.section-note { color: var(--muted); max-width: 24em; font-size: 0.95rem; }

/* cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 2.2rem; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.5s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px rgba(23, 19, 14, 0.12); }
.card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #EEE9E1; }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.card:hover .card-media img { transform: scale(1.045); }
.card-body { padding: 1.8rem 1.9rem 2rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.card-meta { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.card h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; }
.card-desc { color: var(--muted); font-size: 0.94rem; }
.tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.4rem; }
.tags span {
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.28rem 0.8rem;
  color: var(--muted);
}
.card-link { margin-top: auto; padding-top: 1rem; font-weight: 600; font-size: 0.92rem; color: var(--accent); text-decoration: none; }
.card-link:hover { text-decoration: underline; }

/* CSS mockup tile (card 2) */
.tile { position: relative; display: block; }
.tile-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 34px;
  background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; gap: 6px; padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.tile-bar i { width: 9px; height: 9px; border-radius: 50%; background: #E5DFD6; }
.tile-bar i:first-child { background: var(--accent); opacity: 0.7; }
.tile-bar span {
  margin-left: 10px; font-size: 0.68rem; letter-spacing: 0.08em; color: var(--muted);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px;
}
.tile-body {
  position: absolute; inset: 34px 0 0 0; padding: 9% 10%;
  background:
    radial-gradient(60% 52% at 15% 12%, rgba(147, 181, 214, 0.55), transparent 62%),
    radial-gradient(52% 46% at 85% 18%, rgba(196, 181, 232, 0.5), transparent 64%),
    radial-gradient(70% 60% at 78% 85%, rgba(246, 190, 150, 0.55), transparent 66%),
    var(--paper);
}
.t-eyebrow { font-size: 0.6rem; letter-spacing: 0.26em; color: var(--muted); margin-bottom: 6%; }
.t-line { height: 12px; border-radius: 6px; background: rgba(23, 19, 14, 0.82); margin-bottom: 4.5%; }
.t-line.w1 { width: 72%; }
.t-line.w2 { width: 56%; background: var(--accent); opacity: 0.85; }
.t-line.w3 { width: 64%; }
.t-chip { width: 26%; height: 22px; border-radius: 999px; background: var(--ink); margin-top: 7%; }

/* ===== manage ===== */
#manage { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.manage-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 4.5rem; align-items: start; }
.manage-copy p:not(.eyebrow) { color: var(--muted); margin-top: 1.4rem; max-width: 30em; }
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; }
.chips span {
  font-size: 0.8rem; font-weight: 500; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line); padding: 0.5rem 1.1rem;
  transition: border-color 0.3s, transform 0.3s;
}
.chips span:hover { border-color: var(--accent); transform: translateY(-2px); }
.log-title {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 1.6rem;
}
.log ol { list-style: none; border-left: 1px solid var(--line); padding-left: 1.8rem; }
.log li { position: relative; padding-bottom: 1.9rem; }
.log li::before {
  content: ""; position: absolute; left: calc(-1.8rem - 4.5px); top: 0.45rem;
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(228, 87, 61, 0.15);
}
.log time {
  font-size: 0.74rem; letter-spacing: 0.14em; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.log li p { font-size: 0.95rem; margin-top: 0.2rem; }

/* ===== band ===== */
.band {
  position: relative; padding: 0; min-height: 62vh;
  display: flex; align-items: center; justify-content: center;
  background: url("assets/sky.jpg") center 40% / cover no-repeat;
}
.band::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(250, 248, 244, 0.9), rgba(250, 248, 244, 0.12) 30%, rgba(250, 248, 244, 0.12) 70%, rgba(250, 248, 244, 0.92));
}
.band-inner { position: relative; text-align: center; padding: 6rem 1.5rem; }
.band-quote {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2.6rem); line-height: 1.5;
  max-width: 26em; margin: 0 auto;
}
.band-cap { margin-top: 1.4rem; font-size: 0.74rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }

/* ===== footer ===== */
footer { padding: 5rem 0 3rem; }
.foot-brand {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(3rem, 10vw, 7.5rem); letter-spacing: 0.02em; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px rgba(23, 19, 14, 0.35);
}
.foot-brand span { -webkit-text-stroke: 0; color: var(--accent); font-size: 0.35em; vertical-align: super; }
.foot-row {
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  margin-top: 2.4rem; padding-top: 1.8rem; border-top: 1px solid var(--line);
  font-size: 0.88rem; color: var(--muted);
}
.foot-links { display: flex; gap: 1.6rem; }
.foot-links a { color: var(--ink); text-decoration: none; }
.foot-links a:hover { color: var(--accent); }
.credit { margin-top: 1rem; font-size: 0.74rem; color: var(--muted); opacity: 0.8; }

/* ===== reveal ===== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: 0.12s; }
.d2 { transition-delay: 0.24s; }
.d3 { transition-delay: 0.36s; }

/* ===== responsive ===== */
@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; }
  .manage-grid { grid-template-columns: 1fr; gap: 3rem; }
  .nav-links {
    position: fixed; inset: 0; background: var(--paper);
    flex-direction: column; justify-content: center; gap: 2rem;
    transform: translateY(-100%); transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .nav-links.open { transform: none; }
  .nav-links a { font-size: 1.2rem; }
  .burger { display: block; z-index: 60; }
  .burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger.open span:nth-child(2) { opacity: 0; }
  .burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hero-stats { gap: 2rem; }
  section { padding: 5rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
