:root {
  color-scheme: light;
  --bg: #fbf8f4;
  --bg-deep: #f3ece4;
  --surface: #ffffff;
  --ink: #37302a;
  --muted: #8a7e72;
  --soft: #b0a598;
  --line: #ece2d7;
  --rose: #c05e63;
  --rose-deep: #a34a50;
  --rose-soft: #f7e9e6;
  --rose-wash: rgba(192, 94, 99, 0.08);
  --shadow-sm: 0 1px 2px rgba(55, 48, 42, 0.04), 0 4px 14px rgba(55, 48, 42, 0.05);
  --shadow-md: 0 2px 6px rgba(55, 48, 42, 0.05), 0 10px 28px rgba(55, 48, 42, 0.09);
  --radius-card: 20px;
  --radius-item: 14px;
  --font-display: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.85;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

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

::selection {
  background: var(--rose-soft);
  color: var(--rose-deep);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3,
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 248, 244, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(236, 226, 215, 0.8);
}

.nav {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

.brand-name {
  font-size: 1.08rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  white-space: nowrap;
}

.nav-links a {
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 200ms ease-out, background 200ms ease-out;
}

.nav-links a:hover {
  color: var(--rose-deep);
  background: var(--rose-wash);
}

.nav-links a:focus-visible,
.button:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
}

/* ---------- hero ---------- */

.hero-wrap {
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 96%);
}

.hero-glow::before {
  content: "";
  position: absolute;
  right: -12%;
  top: -30%;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 94, 99, 0.14), transparent 65%);
}

.hero-glow::after {
  content: "";
  position: absolute;
  left: -10%;
  bottom: -50%;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(176, 165, 152, 0.16), transparent 65%);
}

.hero {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 0 88px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 64px;
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 28px;
  justify-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--rose-deep);
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 1.5px;
  background: var(--rose);
  border-radius: 2px;
}

h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.9rem);
  line-height: 1.28;
  max-width: 640px;
}

.lead {
  color: var(--muted);
  font-size: 1.13rem;
  max-width: 600px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 4px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  padding: 0 26px;
  font-weight: 600;
  font-size: 0.98rem;
  background: var(--rose);
  color: #fff;
  box-shadow: 0 2px 8px rgba(192, 94, 99, 0.28);
  transition: background 200ms ease-out, transform 200ms ease-out, box-shadow 200ms ease-out;
}

.button:hover {
  background: var(--rose-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(192, 94, 99, 0.32);
}

.button:active {
  transform: translateY(0) scale(0.98);
}

.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.button.secondary:hover {
  background: var(--rose-soft);
  border-color: transparent;
  color: var(--rose-deep);
}

/* ---------- almanac (今日關係提醒) ---------- */

.almanac {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  padding: 30px 30px 26px;
  display: grid;
  gap: 22px;
  rotate: 0.6deg;
}

.almanac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.almanac-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
}

.almanac-stamp {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--rose);
  border: 2px solid var(--rose);
  border-radius: 8px;
  rotate: -6deg;
  opacity: 0.85;
  user-select: none;
}

.almanac-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.almanac-col {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  border-radius: var(--radius-item);
  padding: 20px 16px;
  min-height: 190px;
}

.almanac-col.yi {
  background: var(--rose-soft);
}

.almanac-col.ji {
  background: var(--bg-deep);
}

.almanac-key {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.almanac-col.yi .almanac-key {
  color: var(--rose-deep);
}

.almanac-col.ji .almanac-key {
  color: var(--muted);
}

.almanac-text {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.28rem;
  letter-spacing: 0.22em;
  line-height: 1.5;
  padding-top: 4px;
}

.almanac-col.ji .almanac-text {
  color: var(--muted);
}

.almanac-note {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.9;
  border-top: 1px dashed var(--line);
  padding-top: 18px;
}

/* ---------- sections ---------- */

.section {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: end;
  margin-bottom: 36px;
}

.section-header h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  line-height: 1.35;
  margin-top: 10px;
}

.section-header p {
  color: var(--muted);
  max-width: 460px;
  font-size: 0.98rem;
}

/* ---------- pillars ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.pillar {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 26px 22px;
  min-height: 170px;
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}

.pillar:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.pillar::after {
  content: attr(data-glyph);
  position: absolute;
  right: -8px;
  bottom: -26px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 6rem;
  line-height: 1;
  color: var(--rose);
  opacity: 0.07;
  pointer-events: none;
}

.pillar h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pillar h3::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rose);
}

.pillar p {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.8;
}

/* ---------- article cards ---------- */

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 30px 28px;
  display: grid;
  gap: 14px;
  align-content: start;
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.article-card h3 {
  font-size: 1.42rem;
  line-height: 1.45;
}

.article-card:hover h3 {
  color: var(--rose-deep);
}

.article-card p {
  color: var(--muted);
  font-size: 0.97rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font-size: 0.84rem;
  padding-top: 4px;
}

.tag {
  background: var(--rose-soft);
  color: var(--rose-deep);
  border-radius: 999px;
  padding: 3px 12px;
  font-weight: 500;
}

/* ---------- article page ---------- */

.article-page {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 88px;
}

.article-page header {
  display: grid;
  gap: 18px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

.article-page h1 {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  line-height: 1.4;
}

.article-body {
  display: grid;
  gap: 36px;
  padding-top: 40px;
}

.article-body h2 {
  font-size: 1.4rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.article-body p {
  color: #55493f;
  font-size: 1.05rem;
  line-height: 2;
}

.quote {
  position: relative;
  background: var(--rose-soft);
  border-radius: var(--radius-card);
  padding: 34px 32px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.7;
  color: var(--rose-deep) !important;
  text-align: center;
}

.quote::before {
  content: "「";
  position: absolute;
  left: 14px;
  top: 6px;
  font-size: 2rem;
  opacity: 0.4;
}

.quote::after {
  content: "」";
  position: absolute;
  right: 14px;
  bottom: 6px;
  font-size: 2rem;
  opacity: 0.4;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: auto;
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  padding: 36px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer .inner {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 56px 0 64px;
    gap: 44px;
  }

  .almanac {
    rotate: 0deg;
    max-width: 480px;
  }

  .section {
    padding: 56px 0;
  }

  .section-header {
    display: grid;
    gap: 12px;
  }

  .pillars {
    grid-template-columns: 1fr 1fr;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .container,
  .nav,
  .hero,
  .section,
  .article-page,
  .site-footer .inner {
    width: calc(100% - 32px);
  }

  .pillars {
    grid-template-columns: 1fr;
  }

  .almanac-col {
    min-height: 200px;
    padding: 18px 10px;
  }

  .almanac-text {
    font-size: 1.15rem;
  }

  .actions {
    width: 100%;
    display: grid;
  }
}
