:root {
  --tend-bg: #f7f4ef;
  --tend-surface: #fffdf9;
  --tend-panel: #f2ece3;
  --tend-line: #d6d3d1;
  --tend-text: #1e1e1e;
  --tend-muted: #6b7280;
  --tend-accent: #b57a3a;
  --tend-accent-strong: #94612b;
  --tend-shadow: 0 20px 40px rgba(30, 30, 30, 0.08);
  --tend-radius: 24px;
  --tend-max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--tend-text);
  background:
    radial-gradient(circle at top left, rgba(181, 122, 58, 0.12), transparent 24rem),
    linear-gradient(180deg, #fcfaf6 0%, var(--tend-bg) 100%);
  font-family: "Trebuchet MS", "Segoe UI", "Noto Sans TC", sans-serif;
  line-height: 1.65;
}

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

img {
  max-width: 100%;
  display: block;
}

.tend-shell {
  width: min(calc(100% - 2rem), var(--tend-max));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(247, 244, 239, 0.9);
  border-bottom: 1px solid rgba(214, 211, 209, 0.85);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
}

.brand-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  margin: 0;
  font-family: "Avenir Next", "Futura", "Trebuchet MS", sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.brand-tagline {
  margin: 0.2rem 0 0;
  color: var(--tend-muted);
  font-size: 0.85rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.site-nav a {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  color: var(--tend-muted);
  font-size: 0.92rem;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.site-nav a.primary-nav {
  color: var(--tend-text);
  font-weight: 700;
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--tend-text);
  background: rgba(181, 122, 58, 0.12);
  transform: translateY(-1px);
}

.hero {
  padding: 4rem 0 2.25rem;
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 1.75rem;
  border: 1px solid rgba(214, 211, 209, 0.9);
  border-radius: 32px;
  background: rgba(255, 253, 249, 0.9);
  box-shadow: var(--tend-shadow);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: auto -3rem -3rem auto;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(181, 122, 58, 0.18), transparent 68%);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(181, 122, 58, 0.14);
  color: var(--tend-accent-strong);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hero-title,
.section-title,
.page-title,
.story-title,
.card-title,
.legacy-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  line-height: 1.05;
}

.hero-title {
  max-width: 10ch;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
}

.hero-copy {
  max-width: 42rem;
  margin: 1.15rem 0 0;
  color: #303030;
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.65rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--tend-accent);
  color: #fffdf8;
  font-weight: 700;
  box-shadow: 0 16px 30px rgba(181, 122, 58, 0.22);
}

.button-link.secondary {
  border-color: rgba(181, 122, 58, 0.25);
  background: transparent;
  color: var(--tend-accent-strong);
  box-shadow: none;
}

.hero-side {
  display: grid;
  gap: 1rem;
}

.signal-card,
.section-card,
.legacy-card,
.story-card,
.feature-card {
  padding: 1.3rem;
  border: 1px solid rgba(214, 211, 209, 0.92);
  border-radius: var(--tend-radius);
  background: rgba(255, 253, 249, 0.88);
}

.signal-card strong,
.stat-value {
  display: block;
  color: var(--tend-accent-strong);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signal-card p,
.section-card p,
.story-card p,
.legacy-card p,
.feature-card p,
.page-intro,
.section-lead,
.note-copy,
.about-grid p {
  margin: 0.55rem 0 0;
  color: var(--tend-muted);
}

.section-block {
  padding: 1.8rem 0;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.section-kicker {
  color: var(--tend-accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-lead {
  max-width: 46rem;
  margin-top: 0.8rem;
  font-size: 1.02rem;
}

.section-grid,
.legacy-grid,
.story-grid,
.link-grid,
.about-grid,
.check-grid,
.focus-grid,
.plan-grid,
.metric-strip {
  display: grid;
  gap: 1rem;
}

.section-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.section-card.primary {
  background: linear-gradient(180deg, rgba(181, 122, 58, 0.1), rgba(255, 253, 249, 0.95));
}

.card-title {
  font-size: 1.45rem;
}

.card-meta {
  display: inline-block;
  margin-top: 0.95rem;
  color: var(--tend-accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.story-grid,
.about-grid,
.check-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.plan-grid,
.metric-strip {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.story-card {
  position: relative;
  overflow: hidden;
}

.story-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--tend-accent), transparent 85%);
}

.story-title {
  font-size: 1.4rem;
}

.legacy-grid,
.link-grid,
.focus-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.legacy-card ul,
.feature-card ul,
.page-shell ul,
.about-grid ul {
  margin: 0.85rem 0 0;
  padding-left: 1.1rem;
  color: var(--tend-muted);
}

.legacy-card li,
.feature-card li,
.page-shell li,
.about-grid li {
  margin-top: 0.35rem;
}

.legacy-link,
.inline-link {
  color: var(--tend-accent-strong);
  font-weight: 700;
}

.cta-strip {
  margin: 2rem 0;
  padding: 1.25rem;
  border-radius: 28px;
  background: #1e1e1e;
  color: #f7f4ef;
  box-shadow: var(--tend-shadow);
}

.cta-strip p {
  margin: 0;
  color: rgba(247, 244, 239, 0.84);
}

.cta-strip .button-link {
  margin-top: 1rem;
}

.hero-layout .hero-title {
  max-width: 12ch;
}

.metric-card {
  background: linear-gradient(180deg, rgba(181, 122, 58, 0.08), rgba(255, 253, 249, 0.92));
}

.metric-card .card-title {
  margin-top: 0.4rem;
}

.page-shell {
  padding: 3rem 0 2rem;
}

.article-shell {
  padding: 2.4rem 0 2.8rem;
}

.page-hero {
  display: grid;
  gap: 1.4rem;
  padding: 1.75rem;
  border: 1px solid rgba(214, 211, 209, 0.9);
  border-radius: 32px;
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--tend-shadow);
}

.page-title {
  font-size: clamp(2.3rem, 6vw, 4rem);
}

.page-label {
  color: var(--tend-accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: var(--tend-muted);
  font-size: 0.92rem;
}

.breadcrumb a {
  color: var(--tend-accent-strong);
  font-weight: 700;
}

.article-layout {
  display: grid;
  gap: 1.2rem;
  margin-top: 1.4rem;
}

.article-main,
.article-side {
  display: grid;
  gap: 1rem;
}

.article-panel {
  padding: 1.4rem;
  border: 1px solid rgba(214, 211, 209, 0.92);
  border-radius: var(--tend-radius);
  background: rgba(255, 253, 249, 0.9);
  box-shadow: var(--tend-shadow);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.meta-chip {
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  background: rgba(181, 122, 58, 0.12);
  color: var(--tend-accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

.prose {
  display: grid;
  gap: 1.2rem;
}

.prose section {
  display: grid;
  gap: 0.7rem;
}

.prose h2,
.prose h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  line-height: 1.15;
}

.prose h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.prose h3 {
  font-size: 1.2rem;
}

.prose p,
.prose li {
  color: #3f434c;
}

.prose ul,
.prose ol {
  margin: 0;
  padding-left: 1.2rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(214, 211, 209, 0.92);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: rgba(181, 122, 58, 0.1);
  color: var(--tend-accent-strong);
  font-weight: 800;
}

.prose li + li {
  margin-top: 0.45rem;
}

.callout-card {
  padding: 1.15rem 1.2rem;
  border-left: 4px solid var(--tend-accent);
  border-radius: 18px;
  background: rgba(181, 122, 58, 0.08);
}

.callout-card p {
  margin: 0;
  color: #3f434c;
}

.article-links {
  display: grid;
  gap: 0.8rem;
}

.article-links a {
  color: var(--tend-accent-strong);
  font-weight: 700;
}

.note-copy {
  font-size: 0.96rem;
}

.feature-card h3,
.legacy-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.pill {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(181, 122, 58, 0.12);
  color: var(--tend-accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
}

.footer {
  padding: 2rem 0 3rem;
}

.footer-card {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(214, 211, 209, 0.9);
  border-radius: 28px;
  background: rgba(255, 253, 249, 0.92);
}

.footer-copy {
  color: var(--tend-muted);
  font-size: 0.95rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
}

.footer-nav a {
  color: var(--tend-accent-strong);
  font-weight: 700;
}

.footer-small {
  color: var(--tend-muted);
  font-size: 0.9rem;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.45fr 0.95fr;
  }

  .page-hero {
    grid-template-columns: 1.3fr 0.9fr;
    align-items: start;
  }

  .article-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
    align-items: start;
  }

  .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-card {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: end;
  }
}

@media (max-width: 760px) {
  .site-header {
    position: static;
  }

  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 2.5rem;
  }

  .hero-panel,
  .page-hero,
  .cta-strip,
  .footer-card {
    border-radius: 24px;
  }
}

/* hero-center: 首頁精簡版 hero，置中單欄 */
.hero-center {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.hero-center .hero-actions {
  justify-content: center;
}

/* tend-about: About TEND 段落 */
.tend-about {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tend-about p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--tend-text-muted, #666);
  line-height: 1.75;
}

/* inline-link: 段落內行內連結 */
.inline-link {
  color: var(--tend-accent-strong);
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.5rem;
}

.inline-link:hover {
  text-decoration: underline;
}
