:root {
  --bg: #f3f6f1;
  --bg-tint: #e9efe6;
  --card: #ffffff;
  --text: #1d2a1f;
  --muted: #5d6e60;
  --primary: #2f7d4f;
  --primary-hover: #23613d;
  --accent: #d9a441;
  --danger: #9f2b2b;
  --border: #d7e0d4;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .08);
  --font-head: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--text);
}
h1 { font-size: 40px; }
h2 { font-size: 28px; margin-bottom: 16px; }
h3 { font-size: 20px; margin-bottom: 8px; }
p { margin: 0 0 16px; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.prose-narrow { max-width: 760px; margin: 0 auto; }
.prose p, .prose li { max-width: 70ch; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.gf-site-icon { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.brand-name {
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: 0.01em;
}
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a { color: var(--muted); font-size: 14px; font-weight: 600; }
.site-nav a:hover { color: var(--primary); text-decoration: none; }

/* Hero & Direct Expanded Tree Studio */
.hero-section { padding: 20px 0 48px; }
.hero-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-bottom: 14px;
}
.hero-sub { color: var(--muted); font-size: 16px; margin: 0; }

.stage-shell {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 12px;
}
.stage-shell:fullscreen {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--bg);
}
.stage-shell:fullscreen .dyt-app {
  flex: 1;
  min-height: 0;
}

.dyt-app {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  min-height: 580px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.dyt-app.dyt-app-loading {
  grid-template-columns: 1fr;
  min-height: 0;
}
.dyt-canvas-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 16px 38px;
  background: radial-gradient(circle at 50% 42%, var(--primary-hover) 0%, var(--text) 74%);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.dyt-canvas-pane.lit-gold {
  background: radial-gradient(circle at 50% 42%, var(--accent) 0%, var(--text) 74%);
}
.dyt-top-bar {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dyt-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(29, 42, 31, 0.8);
  border: 1px solid rgba(217, 164, 65, 0.5);
  font-size: 12px;
  font-weight: 600;
  color: var(--bg);
}
.dyt-tree-wrap {
  position: relative;
  width: min(100%, 400px);
  aspect-ratio: 360 / 440;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
}
.dyt-tree-wrap.remove-mode { cursor: pointer; }
.dyt-tree-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.dyt-light { animation: dyt-blink 2s ease-in-out infinite; }
.dyt-light:nth-child(2n) { animation-delay: .55s; }
.dyt-light:nth-child(3n) { animation-delay: 1.15s; }
@keyframes dyt-blink {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.dyt-placed {
  cursor: pointer;
  transition: transform .12s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.dyt-placed:hover { transform: scale(1.16); }
.dyt-canvas-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(29, 42, 31, 0.84);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--bg);
  white-space: nowrap;
  pointer-events: none;
}

.dyt-panel {
  background: var(--card);
  color: var(--text);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}
.dyt-panel-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dyt-panel-title {
  font-family: var(--font-head);
  font-size: 22px;
  margin: 0;
  color: var(--text);
}
.dyt-count-badge {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg);
}
.dyt-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dyt-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.dyt-tab {
  flex: 1;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.dyt-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--card);
}
.dyt-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dyt-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dyt-muted-copy { margin: 0; font-size: 14px; color: var(--muted); }

.dyt-swatch-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.dyt-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 4px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
}
.dyt-swatch.active { border-color: var(--primary); background: var(--bg); }
.dyt-dot { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(0,0,0,.14); }

.dyt-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 600;
}
.dyt-switch {
  min-height: 32px;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--card);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.dyt-switch.off { background: var(--card); color: var(--muted); border-color: var(--border); }

.dyt-orn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dyt-orn-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  min-height: 64px;
}
.dyt-orn-btn.active { border-color: var(--primary); background: var(--bg); }
.dyt-orn-btn.locked { opacity: .55; cursor: not-allowed; background: var(--bg-tint); }
.dyt-orn-svg { width: 26px; height: 26px; display: block; }

.dyt-tools-row { display: flex; gap: 8px; margin-top: 12px; }
.dyt-btn-sec {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
}
.dyt-btn-sec:hover { border-color: var(--primary); background: var(--bg); }
.dyt-btn-sec.active { background: var(--danger); border-color: var(--danger); color: var(--card); }

.dyt-btn-pri, .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: var(--card);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .15s ease;
  text-decoration: none;
}
.dyt-btn-pri { width: 100%; }
.dyt-btn-pri:hover, .btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.dyt-flex-grow { flex: 1.2; width: auto; }
.dyt-panel-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dyt-field { display: flex; flex-direction: column; gap: 6px; }
.dyt-field label { font-size: 14px; font-weight: 600; color: var(--text); }
.dyt-field input, .dyt-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--card);
}
.dyt-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.dyt-progress-box { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.dyt-progress-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.dyt-progress-sub { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.dyt-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: 6px; }
.dyt-bar-fill { height: 100%; background: var(--accent); width: 0%; transition: width .25s ease; }
.dyt-link-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  word-break: break-all;
  color: var(--text);
}
.dyt-notes-stack { display: flex; flex-direction: column; gap: 8px; }
.dyt-note-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 14px; }
.dyt-note-body { margin-top: 4px; color: var(--muted); font-size: 13px; }
.dyt-status { font-size: 13px; color: var(--primary); font-weight: 600; min-height: 18px; }
.dyt-hidden { display: none !important; }

/* Action Bar */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
}
.action-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.act-btn:hover { border-color: var(--primary); background: var(--bg); }
.act-like[aria-pressed="true"], .act-like[data-gf-liked] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--card);
}
.act-count {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
}
.act-like[aria-pressed="true"] .act-count,
.act-like[data-gf-liked] .act-count {
  background: rgba(255, 255, 255, .2);
  color: var(--card);
}
.share-msg { font-size: 14px; color: var(--primary); font-weight: 600; }

/* Sections */
.content-section { padding: 56px 0; }
.section-tint { background: var(--bg-tint); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-lead { color: var(--muted); max-width: 65ch; margin-bottom: 24px; }

/* Split Asymmetric */
.split-asymmetric {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.spec-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.spec-title { font-size: 22px; margin-bottom: 16px; }
.spec-list { margin: 0; }
.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.spec-row:last-child { border-bottom: 0; }
.spec-row dt { color: var(--muted); }
.spec-row dd { margin: 0; font-weight: 600; text-align: right; }

/* Numbered Steps */
.step-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.step-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.step-num {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 8px;
}
.step-item p { margin: 0; font-size: 14px; color: var(--muted); }

/* 2x2 Feature Grid & Unlock Table */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.feature-card p { margin: 0; color: var(--muted); }

.unlock-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.unlock-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.unlock-table th, .unlock-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}
.unlock-table th { color: var(--muted); font-weight: 600; }
.unlock-table tr:last-child td { border-bottom: 0; }

/* Tips List */
.tips-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tips-list li { color: var(--text); }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::after { content: '+'; font-size: 20px; color: var(--primary); }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { margin: 12px 0 0; color: var(--muted); }

/* Comments */
.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.comment-total { font-size: 14px; color: var(--muted); font-weight: 600; }
.comment-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.reply-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}
.comment-form[data-gf-replying] .reply-banner { display: flex; }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row label { font-size: 14px; font-weight: 600; }
.form-row input, .form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--card);
}
.form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-msg { font-size: 14px; color: var(--primary); }

.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comments-empty { display: none; color: var(--muted); font-size: 14px; }
.comment-list[data-gf-empty] .comments-empty { display: block; }
.comment-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.comment-card[data-gf-owner] { border-left: 4px solid var(--primary); }
.comment-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 14px; }
.owner-badge {
  display: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--card);
  font-size: 12px;
  font-weight: 600;
}
.comment-card[data-gf-owner] .owner-badge { display: inline-block; }
.reply-to-tag { color: var(--primary); font-size: 12px; font-weight: 600; }
.comment-time { color: var(--muted); font-size: 12px; margin-left: auto; }
.comment-body { margin: 0 0 8px; }
.link-btn {
  border: 0;
  background: none;
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.comment-replies { margin-top: 12px; padding-left: 16px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 8px; }

/* Inner & Legal Pages */
.inner-main { padding: 40px 0 64px; }
.inner-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.breadcrumb { display: flex; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.page-meta { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.back-cta { margin-top: 32px; }
.not-found-card { text-align: center; padding: 48px 24px; }

/* Footer */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 36px 0 24px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.footer-note { font-size: 14px; color: var(--muted); margin: 8px 0 0; max-width: 40ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { font-size: 14px; color: var(--muted); font-weight: 600; }
.footer-links a:hover { color: var(--primary); }
.footer-copy { padding-top: 16px; font-size: 12px; color: var(--muted); }
.footer-copy p { margin: 0; }

/* Mobile */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 13px; }
  .hero-section { padding: 14px 0 36px; }
  .stage-shell { padding: 8px; }
  .dyt-app { grid-template-columns: 1fr; min-height: auto; }
  .dyt-canvas-pane { padding: 44px 12px 36px; }
  .dyt-tree-wrap { width: min(100%, 300px); }
  .dyt-panel { border-left: 0; border-top: 1px solid var(--border); }
  .btn-primary { width: 100%; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .action-group { width: 100%; }
  .act-fs { width: 100%; justify-content: center; }
  .split-asymmetric, .step-track, .feature-grid { grid-template-columns: 1fr; }
  .content-section { padding: 40px 0; }
  .inner-card { padding: 20px; }
}