/* ROOTED 根境 · rooted.party */

:root {
  --ground: #EEF0E6;
  --ground-2: #E3E8D8;
  --ink: #1D3325;
  --text: #3E4E40;
  --muted: #4A5A4C;
  --line: #C5CDB8;
  --moss: #4F6B3A;
  --leaf-1: #7E9A5C;
  --leaf-2: #5E7A45;
  --placeholder: #CFD6C2;
  --trunk: #9A7430;
  --tag: #6E5320;
  --soil: #2B2118;
  --soil-text: #EDE3D2;
  --soil-muted: #BFAF95;
  --soil-line: #4A3D30;
  --root: #D9B26A;

  --font-body: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --font-cn: 'ZCOOL XiaoWei', 'Songti SC', 'STSong', 'Noto Serif SC', serif;
  --font-en: 'Young Serif', Georgia, 'Times New Roman', serif;

  --gutter: clamp(24px, 6.67vw, 96px);
  --section-y: clamp(88px, 9.7vw, 140px);
  --header-h: 88px;

  color-scheme: light dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #16211A;
    --ground-2: #1B281F;
    --ink: #E6EBDD;
    --text: #C9D2C3;
    --muted: #A9B5A3;
    --line: #34463A;
    --moss: #A9C08A;
    --placeholder: #26352B;
    --trunk: #C9A25A;
    --tag: #D6B878;
  }
}
:root[data-theme="dark"] {
  --ground: #16211A;
  --ground-2: #1B281F;
  --ink: #E6EBDD;
  --text: #C9D2C3;
  --muted: #A9B5A3;
  --line: #34463A;
  --moss: #A9C08A;
  --placeholder: #26352B;
  --trunk: #C9A25A;
  --tag: #D6B878;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--ink); text-underline-offset: 6px; }
a:hover { color: var(--moss); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--trunk);
  outline-offset: 3px;
}
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--ground); border-radius: 999px;
}
.skip-link:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

.cn { font-family: var(--font-cn); }
.en { font-family: var(--font-en); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  border-radius: 999px; border: 1.5px solid var(--ink);
  font: 500 16px/1 var(--font-body);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.btn-primary { background: var(--ink); color: var(--ground); }
.btn-primary:hover { background: var(--moss); border-color: var(--moss); color: var(--ground); }
.btn-outline { background: transparent; color: var(--ink); min-height: 44px; padding: 0 22px; font-size: 15px; }
.btn-outline:hover { background: var(--ink); color: var(--ground); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--ground);
  transition: box-shadow .2s;
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.header-inner {
  height: var(--header-h);
  padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1440px; margin: 0 auto;
}
.wordmark { display: flex; align-items: baseline; gap: 12px; text-decoration: none; color: var(--ink); }
.wordmark .en { font-size: 26px; letter-spacing: .06em; }
.wordmark .cn { font-size: 22px; }
.wordmark:hover { color: var(--ink); }

.main-nav { display: flex; align-items: center; gap: 36px; font-size: 15px; }
.main-nav a:not(.btn) { text-decoration: none; }
.main-nav a:not(.btn):hover { text-decoration: underline; }

.menu-toggle {
  display: none;
  width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink);
  align-items: center; justify-content: center; cursor: pointer;
}
.menu-toggle svg path { transition: transform .2s, opacity .2s; transform-origin: 12px 12px; }
.menu-toggle[aria-expanded="true"] .l1 { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .l2 { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero: above ground ---------- */
.hero-sky { position: relative; }
.hero-above {
  position: relative;
  max-width: 1440px; margin: 0 auto;
  padding: 72px var(--gutter) 180px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  column-gap: 64px;
  align-items: start;
}
.hero-title {
  font-family: var(--font-cn);
  font-size: clamp(38px, 5.84vw, 84px);
  line-height: 1.22; letter-spacing: .02em;
}
.hero-title .line { display: block; }
.hero-title .phrase { display: inline-block; }
.hero-lede { margin-top: 32px; max-width: 560px; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.85; color: var(--muted); }
.hero-actions { margin-top: 36px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.hero-actions .link { font-size: 16px; }

.next-up { margin-top: 24px; border-top: 2px solid var(--ink); padding-top: 20px; }
.next-up .label { font-size: 14px; font-weight: 500; color: var(--muted); }
.next-up .date { margin-top: 14px; font-family: var(--font-en); font-size: 36px; line-height: 1.1; }
.next-up .title { margin-top: 10px; font-family: var(--font-cn); font-size: 26px; line-height: 1.4; }
.next-up .meta { margin-top: 8px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.next-up a { display: inline-block; margin-top: 16px; font-size: 15px; font-weight: 500; }

.sprouts { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none; }
.sprout {
  position: absolute; bottom: 0; left: var(--x);
  width: 120px; margin-left: -60px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.sprout span { font-size: 14px; color: var(--moss); white-space: nowrap; }
.sprout svg { display: block; width: 40px; height: 64px; }
.sprout .stem { stroke: var(--ink); }
.leaf-a { fill: var(--leaf-1); }
.leaf-b { fill: var(--leaf-2); }

/* ---------- Hero: underground ---------- */
.soil {
  position: relative;
  background: var(--soil);
  color: var(--soil-text);
  height: clamp(280px, 38.9vw, 560px);
  overflow: hidden;
}
.soil .roots { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.soil .roots-mobile { display: none; }
.soil-slogan { position: absolute; left: var(--gutter); bottom: clamp(32px, 5vw, 72px); }
.soil-slogan .en { font-size: clamp(20px, 3.06vw, 44px); line-height: 1.25; color: var(--soil-text); }
.soil-slogan .cn { margin-top: 12px; font-size: clamp(18px, 1.95vw, 28px); letter-spacing: .08em; color: var(--root); }
.soil-note {
  position: absolute; right: var(--gutter); bottom: 80px; width: 300px;
  font-size: 15px; line-height: 1.8; color: var(--soil-muted);
}

/* ---------- Sections ---------- */
.section { padding: var(--section-y) var(--gutter); }
.section-inner { max-width: 1248px; margin: 0 auto; }
.bg-2 { background: var(--ground-2); }
.h2 { font-family: var(--font-cn); font-size: clamp(34px, 3.61vw, 52px); line-height: 1.32; }
.h2-sm { font-family: var(--font-cn); font-size: clamp(30px, 3.06vw, 44px); line-height: 1.35; }
.intro { font-size: 17px; line-height: 1.9; color: var(--muted); max-width: 560px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 64px; }

/* Story */
.story { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; row-gap: 40px; }
.story .h2 { grid-column: 1 / span 5; }
.story-body { grid-column: 7 / span 6; display: flex; flex-direction: column; gap: 24px; font-size: 18px; line-height: 1.95; color: var(--text); }
.story-body .closing { margin-top: 8px; font-family: var(--font-cn); font-size: 26px; line-height: 1.6; color: var(--ink); }

/* Four connections */
.four { margin-top: 64px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px; }
.four svg { width: 48px; height: 48px; display: block; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.four h3 { margin-top: 24px; font-family: var(--font-cn); font-size: 28px; line-height: 1.3; }
.four p { margin-top: 12px; font-size: 16px; line-height: 1.85; color: var(--muted); }

/* Network (root rows) */
.roots-list { margin: 72px 0 0; padding: 0; list-style: none; }
.root-row {
  position: relative;
  display: grid;
  grid-template-columns: 360px 220px minmax(0, 1fr);
  align-items: center;
  min-height: 112px;
  padding-left: 88px;
}
.root-row::before {
  content: ""; position: absolute; left: 23px; top: 0; bottom: 0; width: 2px; background: var(--trunk);
}
.root-row:last-child::before { bottom: auto; height: calc(50% - 26px); }
.root-row::after {
  content: ""; position: absolute; left: 23px; top: calc(50% - 26px);
  width: 50px; height: 26px;
  border-left: 2px solid var(--trunk); border-bottom: 1.6px solid var(--trunk);
  border-bottom-left-radius: 26px;
}
.root-row .node { position: absolute; left: 71px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--trunk); }
.root-row > div { align-self: stretch; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.root-name { align-items: baseline !important; padding-top: 34px; gap: 10px; }
.root-name .pre { font-family: var(--font-en); font-size: 16px; color: var(--muted); }
.root-name .name { font-family: var(--font-en); font-size: 40px; line-height: 1.1; }
.root-role { font-family: var(--font-cn); font-size: 24px; }
.root-desc { font-size: 16px; color: var(--muted); }

/* Hosts */
.hosts { margin-top: 64px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px 32px; }
.host .photo {
  aspect-ratio: 4 / 5; background: var(--placeholder);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--muted); font-size: 14px;
}
.host .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.host .photo svg { width: 28px; height: 44px; fill: var(--muted); }
.host .photo svg .stem { fill: none; stroke: var(--muted); stroke-width: 2; }
.host h3 { margin-top: 20px; font-family: var(--font-cn); font-size: 26px; line-height: 1.3; }
.host .role { margin-top: 6px; font-size: 16px; }
.host .where { margin-top: 4px; font-size: 15px; color: var(--muted); }
.tag { font-family: var(--font-en); color: var(--tag); }

/* Gatherings */
.events { margin: 56px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.event {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 280px 120px;
  column-gap: 32px; align-items: center;
  min-height: 136px; padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.event .date { font-family: var(--font-en); font-size: 30px; line-height: 1.2; }
.event .time { margin-top: 4px; font-size: 14px; color: var(--muted); }
.event h3 { font-family: var(--font-cn); font-size: 28px; line-height: 1.35; }
.event .desc { margin-top: 6px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.event .meta { font-size: 15px; line-height: 1.8; color: var(--muted); }
.event .btn { justify-self: end; }

/* Blog */
.posts { margin-top: 64px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.post-card a { display: block; text-decoration: none; color: var(--ink); }
.post-card .post-cover { aspect-ratio: 16 / 10; background: var(--placeholder); border-radius: 12px; overflow: hidden; }
.post-card .post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .post-date { margin-top: 18px; font-size: 14px; color: var(--muted); }
.post-card h3 { margin-top: 8px; font-family: var(--font-cn); font-size: 24px; line-height: 1.35; }
.post-card .desc { margin-top: 10px; font-size: 15px; line-height: 1.75; color: var(--muted); }
.post-card .post-author { margin-top: 14px; font-size: 14px; color: var(--tag); }
.post-card a:hover h3 { text-decoration: underline; }

/* Testimonials */
.testimonials { margin-top: 64px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.testimonial { margin: 0; padding: 0; border-top: 2px solid var(--ink); padding-top: 20px; }
.testimonial p { font-family: var(--font-cn); font-size: 20px; line-height: 1.7; }
.testimonial footer { margin-top: 16px; font-size: 14px; color: var(--muted); font-style: normal; }

/* Join */
.join { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px 96px; }
.join > div { border-top: 2px solid var(--ink); padding-top: 32px; }
.join .intro { margin-top: 20px; max-width: 520px; }
.join > div > .btn-primary { margin-top: 32px; }
.subscribe label { display: block; margin-top: 32px; font-size: 14px; font-weight: 500; }
.subscribe .field { margin-top: 10px; display: flex; gap: 12px; max-width: 520px; }
.subscribe input {
  flex: 1 1 auto; min-width: 0; height: 52px; padding: 0 22px;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: var(--ground); color: var(--ink);
  font: 16px var(--font-body);
}
.subscribe input::placeholder { color: var(--muted); opacity: .7; }
.subscribe input[aria-invalid="true"] { border-color: #B3412E; }
.form-msg { margin-top: 12px; min-height: 1.8em; font-size: 14px; color: var(--muted); }
.form-msg.is-error { color: #B3412E; }
:root[data-theme="dark"] .form-msg.is-error { color: #F08C74; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-msg.is-error { color: #F08C74; } }

/* Footer */
.site-footer { position: relative; background: var(--soil); color: var(--soil-text); padding: 120px var(--gutter) 56px; overflow: hidden; }
.site-footer .foot-roots { position: absolute; top: 0; left: 50%; width: 1440px; height: 96px; margin-left: -720px; pointer-events: none; }
.footer-grid { position: relative; max-width: 1248px; margin: 0 auto; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; row-gap: 48px; }
.footer-brand { grid-column: 1 / span 6; }
.footer-brand .mark { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.footer-brand .mark .en { font-size: clamp(48px, 5vw, 72px); letter-spacing: .04em; line-height: 1.1; }
.footer-brand .mark .cn { font-size: clamp(34px, 3.33vw, 48px); color: var(--root); }
.footer-brand .slogan-en { margin-top: 20px; font-family: var(--font-en); font-size: 20px; color: var(--soil-muted); }
.footer-brand .slogan-cn { margin-top: 6px; font-size: 16px; letter-spacing: .08em; color: var(--soil-muted); }
.footer-col { display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.footer-col.a { grid-column: 8 / span 2; }
.footer-col.b { grid-column: 10 / span 3; }
.footer-col h2 { font: 14px/1.8 var(--font-body); color: var(--soil-muted); margin-bottom: 4px; }
.footer-col a { color: var(--soil-text); text-decoration: none; }
.footer-col a:hover { color: var(--root); text-decoration: underline; }
.footer-bottom {
  position: relative; max-width: 1248px; margin: 96px auto 0; padding-top: 24px;
  border-top: 1px solid var(--soil-line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 14px; color: var(--soil-muted);
}

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .hero-above { grid-template-columns: minmax(0, 1fr); padding-bottom: 170px; }
  .next-up { margin-top: 48px; max-width: 420px; }
  .soil-note { display: none; }
  .four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .root-row { grid-template-columns: 280px 160px minmax(0, 1fr); }
  .root-name .name { font-size: 34px; }
  .hosts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .testimonials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event { grid-template-columns: 140px minmax(0, 1fr) 120px; row-gap: 12px; }
  .event .meta { grid-column: 2; grid-row: 2; }
  .event .btn { grid-column: 3; grid-row: 1 / span 2; }
  .story .h2 { grid-column: 1 / span 12; }
  .story-body { grid-column: 1 / span 12; max-width: 680px; }
  .footer-brand { grid-column: 1 / span 12; }
  .footer-col.a { grid-column: 1 / span 4; }
  .footer-col.b { grid-column: 5 / span 6; }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  :root { --header-h: 64px; }
  .header-inner { padding: 0 12px 0 24px; }
  .wordmark .en { font-size: 21px; }
  .wordmark .cn { font-size: 18px; }
  .menu-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 24px 24px;
    background: var(--ground);
    border-bottom: 1px solid var(--line);
    font-size: 17px;
    display: none;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .main-nav .btn { margin-top: 20px; min-height: 52px; }

  .hero-above { padding: 28px 24px 84px; }
  .hero-title .line { display: inline; }
  .hero-title .phrase { display: block; }
  .hero-lede { margin-top: 20px; }
  .hero-actions { margin-top: 24px; gap: 20px; }
  .hero-actions .btn { min-height: 48px; padding: 0 22px; font-size: 15px; }
  .next-up { display: none; }
  .sprouts { height: 56px; }
  .sprout { left: var(--xm, var(--x)); }
  .sprout.desktop-only { display: none; }
  .sprout span { display: none; }
  .sprout svg { width: 32px; height: 52px; }

  .soil { height: 69.2vw; min-height: 240px; }
  .soil .roots-desktop { display: none; }
  .soil .roots-mobile { display: block; }
  .soil-slogan { left: 24px; right: 24px; bottom: 32px; }
  .soil-slogan .en .br { display: block; }
  .soil-slogan .cn { margin-top: 8px; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 20px; }
  .story-body { font-size: 16px; }
  .story-body .closing { font-size: 22px; }
  .four { grid-template-columns: minmax(0, 1fr); gap: 40px; margin-top: 48px; }

  .roots-list { margin-top: 48px; }
  .root-row { grid-template-columns: minmax(0, 1fr); padding-left: 64px; min-height: 0; padding-block: 20px; border-bottom: 1px solid var(--line); }
  .root-row::before { left: 11px; }
  .root-row::after { left: 11px; width: 38px; }
  .root-row .node { left: 47px; }
  .root-row > div { border-bottom: 0; }
  .root-name { padding-top: 0; }
  .root-name .name { font-size: 30px; }
  .root-role { margin-top: 4px; font-size: 20px; }
  .root-desc { margin-top: 2px; font-size: 15px; }

  .hosts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 16px; margin-top: 48px; }
  .host h3 { margin-top: 14px; font-size: 21px; }
  .host .role { font-size: 15px; }

  .posts { grid-template-columns: minmax(0, 1fr); gap: 40px; margin-top: 48px; }
  .testimonials { grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 48px; }
  .host .where { font-size: 14px; }

  .event { grid-template-columns: minmax(0, 1fr); padding: 24px 0; }
  .event .when { display: flex; align-items: baseline; gap: 12px; }
  .event .date { font-size: 24px; }
  .event .time { margin-top: 0; }
  .event .meta, .event .btn { grid-column: auto; grid-row: auto; }
  .event .btn { justify-self: start; margin-top: 4px; }

  .join { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .subscribe .field { flex-direction: column; }
  .subscribe .btn { width: 100%; }

  .site-footer { padding: 96px 24px 40px; }
  .footer-col.a, .footer-col.b { grid-column: span 6; }
  .footer-bottom { margin-top: 64px; flex-direction: column; }
}

@media (max-width: 380px) {
  .hosts { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
