@import url("https://cdn.cake20.com/fonts/v1/noto-sans-kr.css");
@import url("https://cdn.cake20.com/fonts/v1/lilex.css");

:root {
  color-scheme: light;
  --bg: #f6f3ea;
  --paper: #fffdf7;
  --ink: #17160f;
  --muted: #68665b;
  --line: #d8d2c1;
  --orange: #f59e0b;
  --orange-dark: #b95f02;
  --orange-soft: #ffecbd;
  --night: #171914;
  --green: #b8f36c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

html.lang-pending body {
  visibility: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(23, 22, 15, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 22, 15, 0.035) 1px, transparent 1px), var(--bg);
  background-size: 48px 48px;
  color: var(--ink);
  font-family: "Noto Sans KR Variable", system-ui, sans-serif;
}

.full-page {
  display: flex;
  height: 100dvh;
  overflow: hidden;
  flex-direction: column;
}

.full-page .site-head {
  flex: none;
}

.full-page main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

a {
  color: inherit;
}

.page-glow {
  position: absolute;
  top: -26rem;
  right: -20rem;
  width: 56rem;
  height: 56rem;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.22);
  filter: blur(80px);
  pointer-events: none;
}

main,
footer {
  width: min(1600px, calc(100% - 48px));
  margin-inline: auto;
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 78px;
  padding-inline: max(24px, calc((100% - 1600px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(246, 243, 234, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  background: var(--orange);
  color: white;
  font-family: Lilex, monospace;
  font-size: 13px;
  font-weight: 800;
}

.site-head nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
}

.site-head nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-head nav a:hover {
  color: var(--ink);
}

.lang {
  position: relative;
  margin-left: 24px;
}

.lang-toggle,
.lang-menu button {
  font: inherit;
  cursor: pointer;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.75);
  color: var(--ink);
}

.lang-toggle b {
  font-size: 12px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 148px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 20px 55px rgba(32, 27, 12, 0.14);
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.lang-menu button:hover,
.lang-menu button[aria-checked="true"] {
  background: var(--orange-soft);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(500px, 1.1fr);
  gap: 72px;
  align-items: center;
  min-height: 720px;
  padding: 88px 0 96px;
}

.eyebrow,
.section-label {
  margin: 0 0 14px;
  color: var(--orange-dark);
  font-family: Lilex, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(54px, 7.2vw, 104px);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.lead {
  max-width: 640px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.75;
}

.hero-actions,
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.primary {
  background: var(--ink);
  color: white;
  box-shadow: 5px 5px 0 var(--orange);
}

.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.65);
}

.primary:hover,
.secondary:hover {
  transform: translateY(-2px);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 28px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  list-style: none;
}

.hero-points li::before {
  content: "●";
  margin-right: 8px;
  color: var(--orange);
}

.hero-code {
  overflow: hidden;
  border: 1px solid #34362f;
  border-radius: 22px;
  background: var(--night);
  color: #f4f4e9;
  box-shadow: 22px 22px 0 rgba(245, 158, 11, 0.2);
  transform: rotate(1.4deg);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid #34362f;
}

.window-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #66695d;
}

.window-bar span:first-child {
  background: var(--orange);
}

.window-bar b {
  margin-left: 7px;
  color: #9da18f;
  font-family: Lilex, monospace;
  font-size: 11px;
  font-weight: 500;
}

pre {
  margin: 0;
  overflow: auto;
  font-family: Lilex, monospace;
  line-height: 1.65;
  tab-size: 2;
}

.tok-comment {
  color: #8b9181;
  font-style: italic;
}

.tok-keyword {
  color: #ffb84e;
}

.tok-string {
  color: #b8f36c;
}

.tok-tag {
  color: #ff8e32;
}

.tok-attr {
  color: #8dd8ff;
}

.tok-literal {
  color: #ff8fb3;
}

.tok-number {
  color: #c9adff;
}

.tok-call {
  color: #f6df8e;
}

.tok-variable {
  color: #73daca;
}

.tok-brace {
  color: #ff8fb3;
  font-weight: 700;
}

.hero-code pre {
  min-height: 390px;
  padding: 30px;
  color: #f7e6bd;
  font-size: 13px;
}

.code-result {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 18px 18px;
  padding: 18px;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
}

.code-result div {
  display: grid;
  gap: 3px;
}

.code-result span:not(.candle) {
  color: var(--muted);
  font-size: 12px;
}

.candle {
  position: relative;
  width: 12px;
  height: 34px;
  border-radius: 4px;
  background: repeating-linear-gradient(45deg, #ffca54 0 5px, #fff 5px 10px);
}

.candle::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 5px);
  left: 2px;
  width: 8px;
  height: 13px;
  border-radius: 80% 20% 55% 45%;
  background: var(--orange);
  transform: rotate(12deg);
}

.definition,
.principles,
.examples,
.workflow,
.cta {
  margin-bottom: 120px;
}

.definition {
  padding: 70px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
}

.definition h2,
.section-head h2,
.workflow h2,
.cta h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.definition > p:not(.section-label) {
  max-width: 780px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.formula {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
  margin-top: 44px;
}

.formula div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 125px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.formula b {
  font-family: Lilex, monospace;
  font-size: 15px;
}

.formula span {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.formula i {
  align-self: center;
  font-size: 24px;
  font-style: normal;
}

.formula .formula-result {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.formula .formula-result span {
  color: #b8bcaa;
}

.engine-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 120px;
}

.engine {
  position: relative;
  min-height: 460px;
  padding: 48px;
  border-radius: 24px;
  background: var(--night);
  color: white;
}

.engine:last-child {
  background: var(--orange);
  color: var(--ink);
}

.engine h2 {
  margin: 0;
  font-size: 44px;
  letter-spacing: -0.05em;
}

.engine > p:not(.section-label) {
  color: #b9bcae;
  line-height: 1.7;
}

.engine:last-child > p:not(.section-label) {
  color: #5c3904;
}

.engine ul {
  display: grid;
  gap: 13px;
  margin: 34px 0 70px;
  padding: 0;
  list-style: none;
}

.engine li {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 14px;
}

.engine:last-child li {
  border-color: rgba(23, 22, 15, 0.18);
}

.engine > code {
  position: absolute;
  bottom: 40px;
  font-family: Lilex, monospace;
  font-size: 13px;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 50px;
  align-items: end;
  margin-bottom: 40px;
}

.section-head > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--line);
}

.principle-grid article {
  min-height: 260px;
  padding: 34px;
  background: var(--paper);
}

.principle-grid article > b {
  color: var(--orange-dark);
  font-family: Lilex, monospace;
  font-size: 12px;
}

.principle-grid h3 {
  margin: 42px 0 12px;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.principle-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.example-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.examples-all {
  margin-bottom: 18px;
}

.full-hero {
  padding: 92px 0 70px;
}

.full-hero h1 {
  max-width: 920px;
  font-size: clamp(54px, 8vw, 94px);
}

.full-stats {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 13px;
}

.full-stats b {
  color: var(--ink);
  font-family: Lilex, monospace;
  font-size: 28px;
}

.full-stats i {
  width: 1px;
  height: 24px;
  margin: 0 12px;
  background: var(--line);
}

.example-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  margin-bottom: 120px;
}

.full-page .example-layout {
  height: 100%;
  margin: 0;
  padding-top: 8px;
}

.full-page main {
  width: 100%;
  padding-inline: 8px;
}

.example-side {
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.88);
  backdrop-filter: blur(16px);
}

.example-side > label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
}

.example-side input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.example-side input:focus {
  border-color: var(--orange-dark);
}

.example-side > p {
  margin: 10px 2px 22px;
  color: var(--muted);
  font-size: 11px;
}

.example-side nav,
.example-side nav section {
  display: grid;
}

.example-side nav {
  gap: 6px;
}

.example-side nav section {
  gap: 0;
}

.source-group-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--orange-dark);
  font-family: Lilex, monospace;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  cursor: pointer;
}

.source-group-toggle:hover {
  background: var(--orange-soft);
}

.source-group-toggle b {
  font-size: 11px;
}

.source-group-toggle i {
  transition: transform 120ms ease;
}

.source-group-toggle[aria-expanded="false"] i {
  transform: rotate(-90deg);
}

.source-links {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition:
    grid-template-rows 180ms ease,
    opacity 140ms ease;
}

.source-links-inner {
  display: grid;
  gap: 3px;
  min-height: 0;
  overflow: hidden;
}

[data-source-nav-group][data-open="false"] .source-links {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}

.example-side nav a {
  overflow: hidden;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--muted);
  font-family: Lilex, monospace;
  font-size: 14px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.example-side nav a:hover {
  background: var(--orange-soft);
  color: var(--ink);
}

.example-side nav a[aria-current="page"] {
  background: #ece1ca;
  color: #6f430f;
}

.example-list,
.source-group {
  display: grid;
}

.example-list {
  align-content: start;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding-bottom: 32px;
  gap: 74px;
}

.source-group {
  align-content: start;
  gap: 18px;
}

.source-group-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  height: 24px;
}

.source-group-head span,
.source-group-head b {
  font-family: Lilex, monospace;
  font-size: 11px;
}

.source-group-head span {
  color: var(--orange-dark);
}

.source-group-head b {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--orange-soft);
}

.source-group-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.source-card {
  scroll-margin-top: 96px;
  overflow: hidden;
  border: 1px solid #32342d;
  border-radius: 18px;
  background: var(--night);
  color: white;
}

.source-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 24px 16px;
}

.source-head h3 {
  margin: 8px 0 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.source-path {
  margin: 0;
  color: #9da18f;
  font-family: Lilex, monospace;
  font-size: 10px;
}

.source-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.source-kind {
  padding: 6px 9px;
  border-radius: 999px;
  background: #2e3129;
  color: #b8bcaa;
  font-size: 10px;
  white-space: nowrap;
}

.source-card .copy {
  border-color: #494c42;
  background: #252720;
  color: white;
}

.source-note {
  margin: 0;
  padding: 0 24px 20px;
  color: #b8bcaa;
  font-size: 13px;
  line-height: 1.65;
}

.source-tabs {
  display: flex;
  gap: 5px;
  padding: 0 24px 14px;
}

.source-tabs button {
  min-width: 76px;
  padding: 9px 14px;
  border: 1px solid #494c42;
  border-radius: 9px;
  background: #252720;
  color: #b8bcaa;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.source-tabs button[aria-selected="true"] {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--ink);
}

.source-panel {
  border-top: 1px solid #32342d;
}

.source-card pre {
  max-height: 620px;
  padding: 24px;
  background: #11130f;
  color: #f7e6bd;
  font-size: 12px;
}

.source-run {
  min-height: 420px;
  padding: 12px;
  background: #11130f;
}

.source-run iframe {
  display: block;
  width: 100%;
  min-height: 394px;
  border: 0;
  border-radius: 12px;
  background: white;
}

[hidden] {
  display: none !important;
}

.example-tabs button,
.copy {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.example-tabs button {
  flex: 1;
  min-width: 110px;
  padding: 12px 16px;
  border-radius: 11px;
  white-space: nowrap;
}

.example-tabs button[aria-selected="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.example-panel {
  overflow: hidden;
  border: 1px solid #32342d;
  border-radius: 20px;
  background: var(--night);
  color: white;
}

.example-panel[hidden] {
  display: none;
}

.example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid #32342d;
}

.example-head h3 {
  margin: 4px 0 0;
  font-size: 17px;
}

.file {
  color: var(--green);
  font-family: Lilex, monospace;
  font-size: 11px;
}

.copy {
  flex: none;
  padding: 8px 12px;
  border-color: #44473e;
  border-radius: 9px;
  background: #25271f;
  color: white;
}

.example-panel pre {
  min-height: 360px;
  padding: 30px;
  color: #f8e7bc;
  font-size: 13px;
}

.example-panel > p {
  margin: 0;
  padding: 17px 24px;
  border-top: 1px solid #32342d;
  color: #aeb1a2;
  font-size: 13px;
}

.workflow {
  padding: 64px;
  border-radius: 26px;
  background: var(--orange-soft);
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 40px;
}

.workflow-grid div {
  display: grid;
  gap: 24px;
  min-height: 145px;
  padding: 22px;
  border: 1px solid rgba(86, 55, 7, 0.18);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.48);
}

.workflow-grid b {
  font-family: Lilex, monospace;
  font-size: 12px;
}

.workflow-grid span {
  align-self: end;
  font-size: 14px;
  font-weight: 700;
}

.cta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 60px;
  padding: 64px;
  border-radius: 26px;
  background: var(--night);
  color: white;
}

.cta > div:first-child {
  max-width: 700px;
}

.cta p:not(.section-label) {
  margin: 20px 0 0;
  color: #b7baac;
  line-height: 1.7;
}

.cta .primary {
  background: var(--orange);
  color: var(--ink);
  box-shadow: 5px 5px 0 #54400e;
}

.cta .secondary {
  border-color: #4d5046;
  background: #24261f;
}

footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding-block: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

footer > div b {
  color: var(--ink);
  font-size: 14px;
}

footer nav {
  display: flex;
  overflow-x: auto;
  flex-wrap: nowrap;
  gap: 16px;
  white-space: nowrap;
}

footer nav a {
  text-decoration: none;
}

footer small {
  white-space: nowrap;
}

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

  .hero-copy {
    max-width: 760px;
  }

  .hero-code {
    width: min(720px, 95%);
    margin-inline: auto;
  }

  .formula {
    grid-template-columns: 1fr;
  }

  .formula i {
    line-height: 0.6;
  }

  .principle-grid,
  .workflow-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .example-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 8px;
  }
}

@media (max-width: 720px) {
  main,
  footer {
    width: calc(100% - 28px);
  }

  .site-head {
    min-height: 68px;
    padding-inline: 14px;
  }

  .full-page main {
    padding-inline: 8px;
  }

  .site-head nav {
    display: none;
  }

  .lang {
    margin-left: auto;
  }

  .hero {
    min-height: auto;
    padding: 72px 0 84px;
  }

  h1 {
    font-size: clamp(50px, 17vw, 78px);
  }

  .lead {
    font-size: 17px;
  }

  .hero-code {
    width: 100%;
    transform: none;
  }

  .hero-code pre {
    min-height: 340px;
    padding: 22px;
    font-size: 11px;
  }

  .definition,
  .workflow,
  .cta {
    padding: 34px 24px;
  }

  .definition,
  .principles,
  .examples,
  .workflow,
  .cta,
  .engine-grid {
    margin-bottom: 82px;
  }

  .engine-grid,
  .section-head,
  .principle-grid,
  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .engine {
    min-height: 430px;
    padding: 34px 26px;
  }

  .section-head {
    gap: 20px;
  }

  .example-tabs button {
    flex: none;
  }

  .example-panel pre {
    min-height: 400px;
    padding: 22px;
    font-size: 11px;
  }

  .full-hero {
    padding: 68px 0 52px;
  }

  .example-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(150px, 34dvh) minmax(0, 1fr);
    margin-bottom: 0;
  }

  .example-side {
    height: 100%;
  }

  .example-side nav {
    display: grid;
  }

  .source-head {
    align-items: stretch;
    flex-direction: column;
  }

  .source-actions {
    justify-content: space-between;
  }

  .source-card pre {
    max-height: 500px;
    padding: 20px;
    font-size: 10px;
  }

  footer {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    font-size: 10px;
  }
}

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

  .primary,
  .secondary {
    transition: none;
  }
}
