:root {
  --bg: #f0e5d9;
  --surface: rgba(255, 252, 247, 0.62);
  --surface-strong: rgba(255, 252, 247, 0.78);
  --text: #485d42;
  --accent: #cf4f28;
  --line: rgba(72, 93, 66, 0.18);
  --line-strong: rgba(72, 93, 66, 0.32);
  --shadow-soft: 0 22px 56px rgba(72, 93, 66, 0.08);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --content-max: 1400px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Nanum Myeongjo", Georgia, serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      -25deg,
      rgba(72, 93, 66, 0.024) 0,
      rgba(72, 93, 66, 0.024) 1px,
      transparent 1px,
      transparent 114px
    );
  pointer-events: none;
  z-index: -4;
}

.page-noise {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.44), transparent 36%),
    radial-gradient(circle at 86% 14%, rgba(207, 79, 40, 0.09), transparent 30%),
    radial-gradient(circle at 82% 84%, rgba(72, 93, 66, 0.08), transparent 28%);
  pointer-events: none;
  z-index: -3;
}

.page-aura {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -2;
}

.aura {
  position: absolute;
  filter: blur(52px);
  opacity: 0.52;
}

.aura-rust {
  top: -10rem;
  right: -10rem;
  width: 34rem;
  height: 34rem;
  background: radial-gradient(circle, rgba(207, 79, 40, 0.24) 0, rgba(207, 79, 40, 0) 72%);
}

.aura-olive {
  bottom: -8rem;
  left: -12rem;
  width: 30rem;
  height: 30rem;
  background: radial-gradient(circle, rgba(72, 93, 66, 0.16) 0, rgba(72, 93, 66, 0) 74%);
}

.orbital {
  position: absolute;
  border: 1px solid rgba(72, 93, 66, 0.13);
  border-radius: 50%;
}

.orbital-lg {
  right: -18rem;
  bottom: -24rem;
  width: 58rem;
  height: 58rem;
}

.orbital-md {
  right: -10rem;
  bottom: -16rem;
  width: 38rem;
  height: 38rem;
}

.orbital-sm {
  right: 4rem;
  bottom: 3rem;
  width: 7rem;
  height: 7rem;
  border-color: rgba(207, 79, 40, 0.32);
}

a {
  color: inherit;
}

.site-shell,
.preview-layout {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 3vw, 3rem) 4rem;
}

.topbar,
.preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.topbar {
  margin-bottom: 2.2rem;
  justify-content: flex-start;
}

.topbar__brand,
.preview-header h1,
.hero__title,
.story-section h2,
.story-section h3,
.behavior-card h3,
.code-card__label,
.eyebrow,
.cta-panel__eyebrow {
  font-family: "EB Garamond", "Times New Roman", serif;
}

.topbar__brand {
  font-size: clamp(1.18rem, 1.85vw, 1.55rem);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.text-link,
.button-link {
  position: relative;
  text-decoration: none;
}

.text-link::after,
.button-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.08rem;
  width: 100%;
  height: 1px;
  background: currentColor;
  opacity: 0.32;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.text-link:hover::after,
.button-link:hover::after,
.text-link:focus-visible::after,
.button-link:focus-visible::after {
  opacity: 1;
  transform: translateX(0.28rem);
}

.eyebrow {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.hero {
  display: block;
  margin-bottom: 2.8rem;
}

.hero__copy {
  max-width: 60rem;
}

.hero__title {
  margin: 0;
  font-size: clamp(3.8rem, 10.6vw, 6.8rem);
  line-height: 0.86;
  letter-spacing: -0.04em;
}

.hero__lede {
  margin: 0.9rem 0 0;
  max-width: 26ch;
  font-size: clamp(1.45rem, 2.5vw, 2.15rem);
  line-height: 1.22;
}

.story-section,
.code-card,
.behavior-card,
.cta-panel,
.preview-frame-wrap {
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  border: 1px solid rgba(72, 93, 66, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.story {
  display: grid;
  gap: 1.15rem;
  min-width: 0;
}

.story-section {
  padding: 1.6rem;
  min-width: 0;
  max-width: 100%;
}

.story-section h2 {
  margin: 0 0 1.65rem;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 0.97;
  letter-spacing: -0.03em;
}

.story-section h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.55rem;
  line-height: 1.05;
}

.story-section p {
  margin: 0 0 1rem;
  max-width: min(100%, 94ch);
}

.story-section ul,
.story-section .finding-callout {
  max-width: min(100%, 94ch);
}

.story-section p:last-child,
.story-section ul:last-child {
  margin-bottom: 0;
}

.story-section sup {
  font-size: 0.72em;
  line-height: 0;
}

.section-footnote {
  margin-top: 1rem;
  font-size: 0.92rem;
  color: rgba(72, 93, 66, 0.76);
}

.results-asterisk {
  color: #b6402c;
  font-weight: 700;
}

code {
  padding: 0.06rem 0.28rem;
  border-radius: 0.35rem;
  background: rgba(72, 93, 66, 0.07);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.data-table thead th {
  padding: 0 0.95rem 0.7rem;
  border-bottom: 1px solid var(--line-strong);
  font-family: "EB Garamond", "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.1;
  text-align: left;
}

.data-table td {
  padding: 0.85rem 0.95rem;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.data-table tbody tr:first-child td {
  border-top: none;
}

.data-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.18);
}

.story-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.story-list li + li {
  margin-top: 0.6rem;
}

.finding-callout {
  margin-top: 2rem;
  padding: 1rem 1.1rem;
  border-left: 2px solid rgba(72, 93, 66, 0.18);
  background: rgba(255, 255, 255, 0.22);
  font-size: 1.03rem;
}

.finding-callout strong {
  display: inline;
  margin-top: 0;
  font-size: 1em;
  font-weight: 700;
  line-height: inherit;
  color: inherit;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}

.code-card {
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.code-card__header {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 1rem 0.9rem;
}

.code-card__label {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.05;
  color: var(--accent);
}

.proof-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.proof-meta div {
  min-width: 0;
  max-width: min(100%, 22rem);
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(72, 93, 66, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
}

.proof-meta dt {
  margin-bottom: 0.2rem;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(72, 93, 66, 0.72);
}

.proof-meta dd {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.proof-section-intro {
  margin: -0.35rem 0 1.1rem;
}

.code-block {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  background: transparent !important;
  border-top: 1px solid rgba(72, 93, 66, 0.08);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
}

.code-block code,
.code-block code.hljs {
  display: block;
  padding: 0;
  background: transparent !important;
}

.code-block .hljs {
  background: transparent !important;
  color: var(--text);
}

.code-block .hljs-comment,
.code-block .hljs-quote {
  color: rgba(72, 93, 66, 0.62);
}

.code-block .hljs-keyword,
.code-block .hljs-meta,
.code-block .hljs-name {
  color: var(--accent);
}

.code-block .hljs-string,
.code-block .hljs-symbol {
  color: #567d4d;
}

.code-block .hljs-number,
.code-block .hljs-type,
.code-block .hljs-title {
  color: #8b5f18;
}

.behavior-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
  min-width: 0;
}

.behavior-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  min-height: 100%;
  padding: 1.25rem;
  min-width: 0;
  max-width: 100%;
}

.behavior-card h3 {
  margin: 0 0 0.8rem;
  font-size: 1.65rem;
  line-height: 1.05;
}

.behavior-card p {
  max-width: none;
  margin-bottom: 0;
}

.behavior-metrics {
  margin: 0 0 1rem;
  display: grid;
  gap: 0.55rem;
}

.behavior-metrics div {
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.behavior-metrics dt {
  font-size: 0.88rem;
}

.behavior-metrics dd {
  margin: 0;
  color: var(--accent);
}

.evaluation-note {
  margin-top: 1rem;
}

.wide-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.data-table--matrix {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 0.9rem;
}

.data-table--matrix td:not(:first-child),
.data-table--matrix th:not(:first-child) {
  text-align: center;
  white-space: nowrap;
}

.data-table--matrix thead th {
  padding: 0 0.55rem 0.7rem;
  font-size: 0.96rem;
}

.data-table--matrix td {
  padding: 0.7rem 0.55rem;
}

.data-table--matrix th:first-child,
.data-table--matrix td:first-child {
  width: 34%;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.data-table--matrix th:nth-child(2),
.data-table--matrix td:nth-child(2) {
  width: 4.5%;
}

.data-table--matrix th:nth-child(3),
.data-table--matrix td:nth-child(3) {
  width: 8%;
}

.data-table--matrix th:last-child,
.data-table--matrix td:last-child {
  width: 8.5%;
}

.data-table--comparison {
  width: max-content;
  min-width: 44rem;
  margin-top: 1.1rem;
}

.data-table--comparison td:not(:first-child),
.data-table--comparison th:not(:first-child) {
  text-align: center;
  white-space: nowrap;
}

.comparison-win {
  color: #3f7a38;
  font-weight: 800;
}

.cta-panel {
  max-width: min(100%, 94ch);
  margin: 0 0 1.6rem;
  padding: 1.25rem;
}

.cta-panel__eyebrow {
  margin: 0 0 0.85rem;
  font-size: 1.35rem;
  line-height: 1.05;
  color: var(--accent);
}

.cta-panel__text,
.cta-panel__status {
  margin: 0;
  max-width: none;
}

.cta-panel__status {
  margin-top: 0.55rem;
  color: var(--accent);
}

.button-link {
  display: inline-flex;
  align-items: center;
  padding: 0.9rem 0;
}

.button-link--ghost {
  opacity: 0.88;
}

.preview-shell {
  min-height: 100vh;
}

.preview-layout {
  padding-top: 1.4rem;
  padding-bottom: 1.6rem;
  display: grid;
  gap: 1rem;
}

.preview-header {
  align-items: end;
}

.preview-header h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 0.95;
}

.preview-frame-wrap {
  height: min(82vh, 1020px);
  padding: 0.9rem;
}

.preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 20px;
  background: var(--bg);
}

@media (max-width: 980px) {
  .code-grid {
    grid-template-columns: 1fr;
  }

  .hero__lede {
    max-width: 26ch;
  }
}

@media (max-width: 900px) {
  .behavior-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-shell,
  .preview-layout {
    padding-top: 1rem;
    padding-bottom: 3.25rem;
  }

  .topbar,
  .preview-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    margin-bottom: 1.7rem;
  }

  .hero {
    margin-bottom: 2rem;
  }

  .hero__title {
    font-size: clamp(2.55rem, 11.8vw, 3.45rem);
    line-height: 0.92;
  }

  .story-section {
    padding: 1rem;
  }

  .story-section h2 {
    margin-bottom: 1.2rem;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    min-width: 32rem;
  }

  .preview-frame-wrap {
    height: 76vh;
    padding: 0.65rem;
  }

  .preview-frame {
    border-radius: 16px;
  }
}

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

  .text-link::after,
  .button-link::after {
    transition: none;
  }
}
