:root {
  --ink: #201d1e;
  --paper: #f4f0e4;
  --yellow: #f4dc4f;
  --pink: #de5b86;
  --green: #68a857;
  --orange: #ef6f3b;
  --forest: #113f31;
  --white: #fffdf5;
  --line: #201d1e;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "PingFang TC", "Noto Sans TC", sans-serif;
  letter-spacing: 0;
}

a { color: inherit; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--white);
  border: 2px solid var(--ink);
}

.skip-link:focus { top: 12px; }

.announcement {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 8px 20px;
  background: var(--yellow);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.site-header {
  min-height: 88px;
  padding: 0 40px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 36px;
  color: var(--white);
  background: var(--ink);
  border-bottom: 1px solid #3d383a;
}

.brand {
  text-decoration: none;
  font-family: Rockwell, "Arial Black", "PingFang TC", serif;
  font-size: 31px;
  font-weight: 900;
}

.brand span { color: var(--yellow); }

nav {
  justify-self: center;
  display: flex;
  gap: 28px;
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

nav a:hover,
nav a:focus-visible { color: var(--yellow); }

.header-cta,
.primary-action,
.secondary-action,
.copy-command {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--pink);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
}

.header-cta { box-shadow: none; }

.hero {
  position: relative;
  height: clamp(650px, calc(100svh - 170px), 860px);
  min-height: 650px;
  overflow: hidden;
  background: var(--forest);
  border-bottom: 14px solid var(--yellow);
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  transform: scale(1.55);
  transform-origin: right center;
}

.hero-copy {
  position: absolute;
  left: clamp(24px, 6vw, 92px);
  bottom: clamp(120px, 19vh, 200px);
  width: min(620px, 82vw);
  color: var(--white);
  z-index: 1;
}

.hero h1 {
  margin: 0;
  max-width: 100%;
  color: var(--yellow);
  font-family: Rockwell, "Arial Black", "PingFang TC", serif;
  font-size: clamp(64px, 10vw, 152px);
  line-height: 0.83;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-lead {
  max-width: 560px;
  margin: 24px 0 28px;
  font-family: Rockwell, "PingFang TC", serif;
  font-size: clamp(22px, 3vw, 42px);
  line-height: 1.18;
  font-weight: 800;
}

.hero blockquote {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: min(640px, 86vw);
  margin: 0;
  padding: 20px 34px;
  background: var(--ink);
  color: var(--white);
  border-left: 10px solid var(--pink);
}

.hero blockquote p {
  margin: 0 0 8px;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: clamp(16px, 1.5vw, 22px);
  line-height: 1.5;
}

.hero cite { color: var(--yellow); font-size: 12px; font-style: normal; }

.section-heading {
  max-width: 1220px;
  margin: 0 auto;
  padding: 70px 40px 36px;
}

.section-heading > p,
.address-intro > p:first-child {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-family: Rockwell, "Arial Black", "PingFang TC", serif;
  font-size: clamp(38px, 6vw, 78px);
  line-height: 1;
  font-weight: 900;
}

.case-band { background: var(--paper); }

.case-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}

.case-list article {
  min-height: 340px;
  padding: 40px;
  border-right: 3px solid var(--ink);
}

.case-list article:last-child { border-right: 0; }
.case-list article:nth-child(1) { background: var(--yellow); }
.case-list article:nth-child(2) { background: var(--orange); }
.case-list article:nth-child(3) { background: var(--green); }

.case-number {
  display: block;
  font-family: Rockwell, "Arial Black", serif;
  font-size: clamp(38px, 5vw, 70px);
  font-weight: 900;
}

.case-list h3 { margin: 22px 0 12px; font-size: 27px; }
.case-list p { max-width: 38ch; margin: 0; font-size: 17px; line-height: 1.7; }

.address-section {
  padding: 86px 40px;
  background: var(--white);
}

.address-intro {
  max-width: 1220px;
  margin: 0 auto 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: end;
}

.address-intro p {
  margin: 0;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 22px;
  line-height: 1.65;
}

.address-grid { max-width: 1220px; margin: 0 auto; }

.address-item {
  min-height: 230px;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 44px;
  align-items: start;
  padding: 30px 0;
  border-top: 4px solid var(--ink);
}

.address-item > strong {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 50%;
  font-family: Rockwell, "Arial Black", serif;
  font-size: 82px;
  line-height: 1;
}

.address-book > strong { background: var(--yellow); }
.address-index > strong { background: var(--pink); }
.address-route > strong { background: var(--green); }
.address-deep > strong { background: var(--orange); }

.address-item h3 { margin: 4px 0 12px; font-size: clamp(27px, 3vw, 45px); }
.address-item p { max-width: 55ch; margin: 0 0 20px; font-size: 18px; line-height: 1.65; }
.address-item code { display: block; max-width: 100%; overflow-wrap: anywhere; font-size: 15px; font-weight: 800; }

.fire-bird {
  padding-bottom: 80px;
  color: var(--white);
  background: var(--ink);
}

.light-heading > p { color: var(--yellow); }

.comparison {
  max-width: 1220px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  align-items: stretch;
  padding: 0 40px;
}

.comparison article { min-height: 360px; padding: 36px; color: var(--ink); }
.fire-side { background: var(--yellow); }
.bird-side { background: var(--pink); }
.method-name { font-family: Rockwell, "Arial Black", serif; font-size: clamp(60px, 8vw, 110px); line-height: 1; font-weight: 900; }
.comparison h3 { margin: 24px 0 14px; font-size: 24px; }
.comparison p { max-width: 38ch; margin: 0; font-size: 17px; line-height: 1.7; }
.handoff { display: grid; place-items: center; color: var(--yellow); font-size: 60px; font-weight: 900; }

.scaffold {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 1fr);
  background: var(--orange);
  border-bottom: 4px solid var(--ink);
}

.scaffold-copy { padding: clamp(50px, 7vw, 100px); }
.scaffold-copy h2 { max-width: 760px; }
.scaffold-copy > p { max-width: 54ch; margin: 28px 0 34px; font-size: 18px; line-height: 1.75; }

.workflow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow li {
  padding: 9px 13px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-size: 14px;
  font-weight: 900;
}

.scaffold-table {
  align-self: stretch;
  display: grid;
  align-content: center;
  padding: 50px;
  background: var(--paper);
  border-left: 4px solid var(--ink);
}

.table-row {
  display: grid;
  grid-template-columns: 0.65fr 1fr 2fr;
  min-height: 68px;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 2px solid var(--ink);
}

.table-head { font-size: 13px; font-weight: 900; text-transform: uppercase; }

.roam-export {
  scroll-margin-top: 12px;
  padding: 96px 40px;
  background: var(--yellow);
  border-bottom: 4px solid var(--ink);
}

.roam-export-inner {
  width: min(1220px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1.35fr);
  gap: 54px;
  align-items: start;
}

.section-kicker {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.roam-copy h2 { font-size: clamp(44px, 6vw, 76px); }

.roam-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.roam-facts span {
  padding: 8px 10px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.roam-safety {
  max-width: 42ch;
  margin: 30px 0 18px;
  padding-top: 18px;
  border-top: 3px solid var(--ink);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 700;
}

.roam-doc-link {
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.roam-tool {
  min-width: 0;
  border: 4px solid var(--ink);
  background: var(--paper);
}

.roam-toolbar,
.roam-output-actions {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
}

.roam-toolbar > div,
.roam-output-actions { flex-wrap: wrap; }

.roam-toolbar > div {
  display: flex;
  gap: 8px;
}

.roam-toolbar strong {
  font-family: Rockwell, "Arial Black", serif;
  font-size: 20px;
}

.tool-button {
  min-height: 42px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.tool-button.primary { background: var(--pink); }
.tool-button:disabled { cursor: not-allowed; opacity: 0.45; }
.tool-button:not(:disabled):hover,
.tool-button:not(:disabled):focus-visible { background: var(--green); }

.roam-editors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}

.editor-field {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.editor-field:first-child { border-right: 3px solid var(--ink); }

.editor-field > span {
  padding: 9px 12px;
  background: var(--orange);
  border-bottom: 2px solid var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.output-field > span { background: var(--green); }

.editor-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 410px;
  margin: 0;
  padding: 16px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  outline-offset: -4px;
  background: var(--white);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  letter-spacing: 0;
  tab-size: 2;
}

.output-field textarea {
  background: var(--ink);
  color: var(--yellow);
}

.roam-status {
  flex: 1 1 190px;
  min-width: 0;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.roam-status[data-state="success"] { color: var(--forest); }
.roam-status[data-state="error"] { color: #a3132b; }

.keyword-field {
  display: grid;
  grid-template-columns: minmax(340px, 0.8fr) minmax(540px, 1.2fr);
  gap: 70px;
  padding: 90px max(40px, calc((100vw - 1220px) / 2));
  background: var(--green);
}

.keyword-copy { align-self: center; }
.keyword-copy p { max-width: 44ch; margin: 28px 0; font-size: 18px; line-height: 1.7; }
.secondary-action { margin: 0 12px 12px 0; background: var(--yellow); }
.copy-command { margin-bottom: 12px; background: var(--pink); }
.copy-status { min-height: 1.5em; margin: 4px 0 0 !important; font-size: 13px !important; font-weight: 800; }

.mandala {
  width: min(100%, 680px);
  aspect-ratio: 1;
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  border: 4px solid var(--ink);
  background: var(--paper);
}

.mandala-cell {
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 3px;
  border-right: 1px solid rgba(32, 29, 30, 0.35);
  border-bottom: 1px solid rgba(32, 29, 30, 0.35);
  overflow: hidden;
  font-size: clamp(8px, 1vw, 13px);
  font-weight: 800;
  text-align: center;
}

.mandala-cell.core { background: var(--yellow); }
.mandala-cell.route { background: var(--pink); }
.mandala-cell.tool { background: var(--orange); }
.mandala-cell.center { background: var(--ink); color: var(--white); font-size: clamp(11px, 1.4vw, 19px); }

footer {
  min-height: 210px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 36px;
  padding: 50px 40px;
  color: var(--white);
  background: var(--ink);
}

footer strong { color: var(--yellow); font-family: Rockwell, "Arial Black", serif; font-size: 42px; }
footer p { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 19px; }
footer a { color: var(--pink); font-weight: 900; }

@media (max-width: 960px) {
  .site-header { grid-template-columns: 1fr auto; padding: 0 24px; }
  nav { display: none; }
  .hero { min-height: 720px; }
  .hero-image { object-position: 42% center; }
  .hero-copy { bottom: 190px; }
  .case-list { grid-template-columns: 1fr; }
  .case-list article { min-height: 250px; border-right: 0; border-bottom: 3px solid var(--ink); }
  .case-list article:last-child { border-bottom: 0; }
  .address-intro { grid-template-columns: 1fr; gap: 24px; }
  .comparison { grid-template-columns: 1fr; }
  .handoff { min-height: 80px; transform: rotate(90deg); }
  .scaffold { grid-template-columns: 1fr; }
  .scaffold-table { border-top: 4px solid var(--ink); border-left: 0; }
  .roam-export-inner { grid-template-columns: 1fr; }
  .keyword-field { grid-template-columns: 1fr; }
  .mandala { justify-self: center; }
  footer { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .announcement { min-height: 52px; font-size: 12px; }
  .site-header { min-height: 74px; gap: 12px; }
  .brand { font-size: 24px; }
  .header-cta { display: none; }
  .hero { min-height: 680px; }
  .hero-image { object-position: 35% center; }
  .hero-copy { left: 20px; bottom: 222px; width: calc(100% - 40px); }
  .hero-image { transform: scale(1.05); }
  .hero h1 { font-size: clamp(52px, 15vw, 60px); white-space: nowrap; }
  .hero-lead { max-width: 320px; font-size: 20px; line-height: 1.3; }
  .hero blockquote { width: 100%; padding: 18px 20px; border-left: 0; border-top: 8px solid var(--pink); }
  .section-heading, .address-section { padding-left: 20px; padding-right: 20px; }
  h2 { font-size: 40px; }
  .case-list article { padding: 30px 20px; }
  .address-item { grid-template-columns: 76px 1fr; gap: 20px; min-height: 190px; }
  .address-item > strong { font-size: 42px; }
  .address-item h3 { font-size: 25px; }
  .address-item p { font-size: 16px; }
  .comparison { padding: 0 20px; }
  .comparison article { min-height: 310px; padding: 28px 22px; }
  .scaffold-copy, .scaffold-table { padding: 50px 20px; }
  .table-row { grid-template-columns: 0.7fr 0.9fr 1.7fr; gap: 8px; font-size: 12px; }
  .roam-export { padding: 60px 20px; }
  .roam-editors { grid-template-columns: 1fr; }
  .editor-field:first-child { border-right: 0; border-bottom: 3px solid var(--ink); }
  .editor-field textarea { min-height: 340px; }
  .roam-toolbar,
  .roam-output-actions { align-items: stretch; }
  .roam-toolbar { flex-direction: column; }
  .roam-toolbar > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .roam-output-actions .tool-button { flex: 1 1 130px; }
  .keyword-field { padding: 60px 20px; gap: 44px; }
  .mandala { width: 100%; }
  footer { padding: 50px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
