:root {
  --bg: #050505;
  --panel: #10100f;
  --panel-soft: #171614;
  --text: #f4efe5;
  --muted: #aaa298;
  --line: rgba(226, 190, 122, 0.18);
  --gold: #d6aa61;
  --gold-strong: #f0c978;
  --ink: #070707;
  --white: #fbf7ef;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans KR", "Inter", sans-serif;
  letter-spacing: 0;
  overflow-wrap: break-word;
  word-break: keep-all;
}

body.light-mode {
  --bg: #f5f1e8;
  --panel: #fffaf0;
  --panel-soft: #eee6d8;
  --text: #15120e;
  --muted: #6e665d;
  --line: rgba(80, 64, 38, 0.18);
  --ink: #f8f1e5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 20;
  display: flex;
  width: min(1120px, calc(100% - 48px));
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.72);
  padding: 8px 10px 8px 18px;
  backdrop-filter: blur(18px);
}

body.light-mode .site-header {
  background: rgba(255, 250, 240, 0.74);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-strong);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.brand strong,
.site-footer strong {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 30px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--gold-strong);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.download-button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--gold-strong);
  color: #14100a;
  padding: 0 16px;
  font-weight: 800;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  align-items: center;
  overflow: hidden;
  padding: 118px max(32px, calc((100vw - 1120px) / 2)) 72px;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 72% 30%, rgba(214, 170, 97, 0.2), transparent 28%),
    linear-gradient(115deg, rgba(0, 0, 0, 0.82) 0 42%, rgba(0, 0, 0, 0.3) 72%, rgba(0, 0, 0, 0.86)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 88px);
  pointer-events: none;
}

body.light-mode .hero::before {
  background:
    radial-gradient(circle at 72% 30%, rgba(214, 170, 97, 0.28), transparent 28%),
    linear-gradient(115deg, rgba(245, 241, 232, 0.92) 0 43%, rgba(245, 241, 232, 0.45) 74%, rgba(245, 241, 232, 0.9)),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.04) 0 1px, transparent 1px 88px);
}

.hero-copy,
.machine-visual,
.feature-strip,
.studio,
.templates,
.market,
.site-footer {
  position: relative;
}

.hero-copy {
  max-width: 560px;
  animation: rise 700ms ease-out both;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold-strong);
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(42px, 6vw, 82px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-text {
  max-width: 470px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.primary-action,
.secondary-action,
.generate-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 800;
}

.primary-action,
.generate-button {
  border: 0;
  background: var(--gold-strong);
  color: #14100a;
}

.secondary-action {
  border: 1px solid var(--line);
  color: var(--text);
}

.machine-visual {
  min-height: 560px;
  perspective: 1200px;
}

.book-rig {
  position: absolute;
  right: 0;
  top: 50%;
  width: min(640px, 100%);
  height: 390px;
  transform: translateY(-46%) rotateX(58deg) rotateZ(-20deg);
  transform-style: preserve-3d;
  animation: floatRig 5s ease-in-out infinite;
}

.book-cover {
  position: absolute;
  inset: 46px 80px 72px 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(240, 201, 120, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 20%),
    linear-gradient(135deg, #111, #020202 55%, #27231c);
  box-shadow: 0 50px 80px rgba(0, 0, 0, 0.55);
  padding: 34px;
  transform: translateZ(48px);
}

.book-cover span,
.book-cover small {
  color: var(--gold);
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.book-cover strong {
  max-width: 380px;
  color: #f8f1e5;
  font-size: 34px;
  line-height: 1.18;
}

.page-stack {
  position: absolute;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8f1e5, #cfc3b1);
  transform-style: preserve-3d;
}

.page-one {
  inset: 64px 64px 58px 58px;
  transform: translateZ(22px);
}

.page-two {
  inset: 84px 42px 42px 86px;
  background: linear-gradient(135deg, #837c70, #211f1b);
  transform: translateZ(8px);
}

.gold-line {
  position: absolute;
  right: 88px;
  bottom: 62px;
  width: 220px;
  height: 3px;
  background: var(--gold-strong);
  transform: translateZ(62px);
}

.spec {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.46);
  padding: 10px 14px;
  color: var(--gold-strong);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

body.light-mode .spec {
  background: rgba(255, 250, 240, 0.64);
}

.spec-a {
  top: 30%;
  right: 2%;
}

.spec-b {
  top: 57%;
  left: 4%;
}

.spec-c {
  right: 18%;
  bottom: 18%;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.feature-strip article {
  min-height: 190px;
  background: var(--panel);
  padding: 34px;
}

.feature-strip span {
  display: block;
  margin-bottom: 24px;
  color: var(--gold);
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.feature-strip strong {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
}

.feature-strip p,
.section-heading p,
.market span,
.market-intro {
  color: var(--muted);
  line-height: 1.7;
}

.studio,
.templates,
.market {
  padding: 96px max(24px, calc((100vw - 1120px) / 2));
}

.section-heading {
  max-width: 660px;
  margin-bottom: 34px;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.12;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 26px;
  align-items: stretch;
}

.builder-panel,
.preview-panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.builder-panel {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 24px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.fixed-package {
  display: grid;
  min-height: 74px;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(240, 201, 120, 0.08);
  padding: 10px 13px;
}

.fixed-package span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.fixed-package strong {
  color: var(--text);
  font-size: 15px;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0 13px;
}

select option {
  background: #111;
  color: #fff;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.template-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.template-chip {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.template-chip.is-active {
  background: rgba(240, 201, 120, 0.14);
  color: var(--gold-strong);
}

.status-line {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.connection-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px 13px;
}

.connection-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8a8174;
  box-shadow: 0 0 0 4px rgba(138, 129, 116, 0.12);
}

.connection-dot[data-state="online"] {
  background: #63d486;
  box-shadow: 0 0 0 4px rgba(99, 212, 134, 0.14);
}

.connection-dot[data-state="warn"] {
  background: var(--gold-strong);
  box-shadow: 0 0 0 4px rgba(240, 201, 120, 0.14);
}

.connection-dot[data-state="offline"] {
  background: #ff6b6b;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.14);
}

.preview-panel {
  min-height: 600px;
  padding: 18px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--muted);
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.download-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.download-controls select {
  width: 138px;
  min-height: 42px;
  border-radius: 999px;
}

.ebook-preview {
  min-height: 520px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(240, 201, 120, 0.12), transparent 26%),
    linear-gradient(145deg, #0b0b0a, #171511);
  padding: clamp(28px, 5vw, 56px);
  transition: background 240ms ease, color 240ms ease, transform 240ms ease;
}

.preview-cover-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 28px;
  border: 1px solid rgba(240, 201, 120, 0.24);
}

.ebook-preview.ivory {
  background: linear-gradient(135deg, #fffaf0, #e9dec9);
  color: #17130e;
}

.ebook-preview.graphite {
  background: linear-gradient(135deg, #202225, #090a0c);
}

.preview-kicker {
  color: var(--gold);
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.ebook-preview h3 {
  max-width: 650px;
  margin-bottom: 16px;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.05;
}

.preview-subtitle {
  max-width: 560px;
  color: currentColor;
  opacity: 0.68;
  line-height: 1.7;
}

.ebook-preview ol {
  display: grid;
  gap: 14px;
  margin: 42px 0;
  padding-left: 22px;
  font-weight: 800;
}

.ebook-preview li span {
  display: block;
  margin-top: 5px;
  color: currentColor;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.64;
}

.sales-box {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(240, 201, 120, 0.34);
  padding-top: 22px;
}

.sales-box span {
  color: currentColor;
  opacity: 0.64;
}

.revenue-preview {
  margin-top: 28px;
  border-top: 1px solid rgba(240, 201, 120, 0.34);
  padding-top: 26px;
}

.revenue-preview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.revenue-preview-head span {
  color: var(--gold);
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.revenue-preview-head strong {
  max-width: 360px;
  text-align: right;
  font-size: 22px;
  line-height: 1.25;
}

.revenue-case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.revenue-case-card {
  position: relative;
  display: grid;
  min-height: 210px;
  align-content: start;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(240, 201, 120, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(240, 201, 120, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.045);
  padding: 18px;
}

.ebook-preview.ivory .revenue-case-card {
  background:
    linear-gradient(145deg, rgba(214, 170, 97, 0.18), transparent 46%),
    rgba(255, 255, 255, 0.52);
  border-color: rgba(138, 103, 50, 0.22);
}

.case-number {
  width: fit-content;
  border: 1px solid rgba(240, 201, 120, 0.38);
  border-radius: 999px;
  color: var(--gold-strong);
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 9px;
}

.revenue-case-card h4 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.revenue-case-card p,
.revenue-case-card small {
  margin: 0;
  color: currentColor;
  line-height: 1.55;
  opacity: 0.72;
}

.revenue-case-card p {
  font-size: 13px;
}

.revenue-case-card small {
  display: block;
  font-size: 12px;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-tags span {
  border-radius: 999px;
  background: rgba(240, 201, 120, 0.14);
  color: var(--gold-strong);
  font-size: 11px;
  font-weight: 800;
  opacity: 1;
  padding: 5px 8px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.template-card {
  display: grid;
  min-height: 290px;
  grid-template-rows: 1fr auto auto;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 18px;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease;
}

.template-card:hover {
  border-color: rgba(240, 201, 120, 0.54);
  transform: translateY(-4px);
}

.cover-swatch {
  display: block;
  min-height: 160px;
  border-radius: 6px;
}

.swatch-dark {
  background: linear-gradient(135deg, #050505, #292017);
}

.swatch-light {
  background: linear-gradient(135deg, #fffaf0, #d7c7ab);
}

.swatch-steel {
  background: linear-gradient(135deg, #25282b, #08090b);
}

.template-card strong {
  font-size: 21px;
}

.template-card small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.market {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) 1.2fr;
  gap: 60px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.market-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.market-list article {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px 24px;
  margin: 0;
  background: var(--panel);
  padding: 24px 0;
}

.market-list article strong {
  font-size: 16px;
}

.market-list article ol {
  grid-column: 2;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.75;
}

.market-list article li {
  margin-bottom: 8px;
}

.site-footer {
  display: flex;
  min-height: 110px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  color: var(--muted);
}

.site-footer span,
.site-footer a {
  color: var(--muted);
}

.footer-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
  font-size: 13px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatRig {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -14px;
  }
}

.loading-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.68);
  padding: 22px;
  backdrop-filter: blur(14px);
}

.loading-panel {
  width: min(520px, 100%);
  border: 1px solid rgba(240, 201, 120, 0.28);
  border-radius: 12px;
  background: linear-gradient(145deg, #11100e, #050505);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  padding: 32px;
  text-align: center;
}

.loader-ring {
  width: 54px;
  height: 54px;
  margin: 0 auto 20px;
  border: 3px solid rgba(240, 201, 120, 0.16);
  border-top-color: var(--gold-strong);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.loading-panel h2 {
  margin-bottom: 10px;
  font-size: 28px;
}

.loading-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin: 22px 0;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold-strong);
  transition: width 360ms ease;
}

.loading-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.loading-steps li {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 6px;
}

.loading-steps li.is-active {
  border-color: rgba(240, 201, 120, 0.6);
  color: var(--gold-strong);
  background: rgba(240, 201, 120, 0.1);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .site-header {
    top: 12px;
    width: calc(100% - 24px);
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 108px;
  }

  .machine-visual {
    min-height: 390px;
  }

  .book-rig {
    right: -80px;
    width: 560px;
    scale: 0.82;
  }

  .feature-strip,
  .workspace,
  .template-grid,
  .market {
    grid-template-columns: 1fr;
  }

  .market {
    gap: 28px;
  }
}

@media (max-width: 560px) {
  .brand small {
    display: none;
  }

  h1 {
    font-size: 40px;
  }

  .field-row,
  .market-list article {
    grid-template-columns: 1fr;
  }

  .market-list article ol {
    grid-column: auto;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .footer-info {
    justify-content: flex-start;
  }

  .preview-toolbar,
  .download-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .revenue-preview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .revenue-preview-head strong {
    text-align: left;
  }

  .revenue-case-grid {
    grid-template-columns: 1fr;
  }

  .download-controls select,
  .download-button {
    width: 100%;
  }

  .loading-steps {
    grid-template-columns: 1fr 1fr;
  }

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

  .feature-strip article,
  .studio,
  .templates,
  .market {
    padding: 42px 20px;
  }

  .preview-panel {
    padding: 10px;
  }
}
