/* StoryMaker Home — tweakcn 실측 기반 라이트 모노크롬 테마 */
:root {
  --bg: hsl(0 0% 100%);
  --fg: hsl(0 0% 3.9%);
  --muted: hsl(0 0% 96.1%);
  --muted-fg: hsl(0 0% 45.1%);
  --card: hsl(0 0% 100% / 0.5);
  --border: hsl(0 0% 89.8%);
  --primary: hsl(0 0% 9%);
  --primary-fg: hsl(0 0% 98%);
  --radius: 0.625rem;
  --radius-card: 16px;
  --font: "Pretendard Variable", Pretendard, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  --serif: "Apple SD Gothic Neo", Georgia, "Times New Roman", "Noto Serif KR", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font); line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 300; }

.container { width: min(1120px, 100% - 3rem); margin-inline: auto; }

/* ---------- 헤더 ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.header.scrolled {
  background: hsl(0 0% 100% / 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-mark {
  width: 27px; height: 27px; border-radius: 7px; display: inline-grid; place-items: center;
  background: hsl(240 7% 8%);
}
.brand-mark svg { width: 17px; height: 17px; }
.nav-links { display: flex; gap: 1.7rem; }
.nav-links a { color: var(--muted-fg); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--fg); }
.header-actions { display: flex; align-items: center; gap: 0.6rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 8px; color: var(--fg); transition: background 0.2s;
}
.icon-btn:hover { background: var(--muted); }

/* ---------- 버튼 (pill) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border-radius: 999px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 0.45rem 1.15rem; font-size: 0.85rem; }
.btn-lg { padding: 0.75rem 1.7rem; font-size: 0.97rem; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { box-shadow: 0 6px 20px hsl(0 0% 0% / 0.18); }
.btn-outline { border-color: var(--border); color: var(--fg); background: var(--bg); }
.btn-outline:hover { background: var(--muted); }
.btn-invert { background: var(--bg); color: var(--fg); }
.btn-invert:hover { box-shadow: 0 8px 26px hsl(0 0% 0% / 0.35); }
.btn-ghost-light { border-color: hsl(0 0% 100% / 0.35); color: var(--primary-fg); }
.btn-ghost-light:hover { background: hsl(0 0% 100% / 0.12); }

/* ---------- 공통 섹션 ---------- */
.section { position: relative; isolation: isolate; padding: clamp(5rem, 9vw, 8rem) 0; }
.section-muted { background: hsl(0 0% 96.9% / 0.55); border-block: 1px solid var(--border); }
.section-head-center { max-width: 680px; margin: 0 auto clamp(2.6rem, 5vw, 4rem); text-align: center; }
.section-head-center h2, .engine-copy h2, .faq-head h2, .cta h2 {
  font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -0.025em;
}
.section-head-center p { color: var(--muted-fg); margin-top: 0.9rem; font-size: 1.03rem; }

/* ---------- 스크롤 리빌 ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- HERO ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 9.5rem 0 4rem; background: var(--bg); }
.hero-grid-bg {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(to right, hsl(0 0% 50% / 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, hsl(0 0% 50% / 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(60% 50% at 50% 0%, #000 70%, transparent 100%);
  mask-image: radial-gradient(60% 50% at 50% 0%, #000 70%, transparent 100%);
}
.hero-copy { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.4rem; }
.hero-title {
  font-size: clamp(2.7rem, 7.2vw, 6rem);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.02;
}
.hero-title em { font-weight: 300; }
.hero-sub { max-width: 620px; color: var(--muted-fg); font-size: clamp(1rem, 1.6vw, 1.16rem); }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: center; margin-top: 0.4rem; }
.hero-perks { display: flex; gap: 1.6rem; flex-wrap: wrap; justify-content: center; list-style: none; margin: 0.6rem 0 0; padding: 0; }
.hero-perks li { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; color: var(--muted-fg); }
.hero-perks svg { color: var(--fg); }

/* ---------- 히어로 3줄 마퀴 ---------- */
.hero-marquee { position: relative; margin-top: 4rem; display: flex; flex-direction: column; gap: 1rem; overflow: hidden; }
.marquee-row { overflow: hidden; }
.marquee-track { display: flex; gap: 1rem; width: max-content; animation: marquee 60s linear infinite; }
.marquee-track.marquee-reverse { animation: marquee-rev 70s linear infinite; }
.marquee-row:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes marquee-rev { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.m-card {
  flex: none; display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 1.1rem 0.55rem 0.55rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 1px 3px hsl(0 0% 0% / 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.m-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px hsl(0 0% 0% / 0.12); border-color: hsl(0 0% 70%); }
.m-card img { width: 46px; height: 62px; object-fit: cover; border-radius: 9px; }
.m-card b { display: block; font-size: 0.86rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.m-card span { font-size: 0.73rem; color: var(--muted-fg); }
.marquee-fade {
  position: absolute; top: 0; bottom: 0; width: clamp(50px, 10vw, 160px); z-index: 2; pointer-events: none;
}
.marquee-fade-l { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.marquee-fade-r { right: 0; background: linear-gradient(to left, var(--bg), transparent); }

/* MID-CSS */
/* ---------- 기능 6카드 ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 1.5rem; transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px hsl(0 0% 0% / 0.08); border-color: hsl(0 0% 75%); }
.card-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: hsl(0 0% 9% / 0.06); color: var(--primary); margin-bottom: 1.05rem;
}
.card h3 { font-size: 1.08rem; margin-bottom: 0.5rem; }
.card p { color: var(--muted-fg); font-size: 0.9rem; }

/* ---------- 엔진 채팅 섹션 ---------- */
.engine-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
.engine-lead { color: var(--muted-fg); margin: 1.1rem 0 1.5rem; font-size: 1.03rem; }
.engine-copy .hero-actions { justify-content: flex-start; margin-bottom: 1.8rem; }
.engine-perks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.4rem; }
.engine-perks li { display: flex; flex-direction: column; gap: 0.15rem; padding-left: 0.9rem; border-left: 2px solid var(--fg); }
.engine-perks strong { font-size: 0.92rem; letter-spacing: -0.01em; }
.engine-perks span { font-size: 0.8rem; color: var(--muted-fg); }
.console-mock {
  border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg);
  box-shadow: 0 22px 55px hsl(0 0% 0% / 0.1); overflow: hidden;
}
.console-bar {
  display: flex; align-items: center; gap: 6px; padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border); background: hsl(0 0% 98%);
}
.console-bar span { width: 10px; height: 10px; border-radius: 50%; background: hsl(0 0% 85%); }
.console-bar em { margin-left: 0.5rem; font-family: var(--font); font-style: normal; font-size: 0.76rem; color: var(--muted-fg); }
.console-body { padding: 1.2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.chat-user {
  align-self: flex-end; max-width: 78%;
  background: var(--primary); color: var(--primary-fg);
  padding: 0.6rem 0.95rem; border-radius: 14px 14px 4px 14px; font-size: 0.87rem;
}
.chat-ai {
  align-self: flex-start; max-width: 85%;
  background: var(--muted); padding: 0.6rem 0.95rem;
  border-radius: 14px 14px 14px 4px; font-size: 0.87rem; color: hsl(0 0% 20%);
}
.chat-progress { margin-top: 0.3rem; }
.chat-progress i {
  display: block; height: 6px; border-radius: 999px; background: hsl(0 0% 90%);
  position: relative; overflow: hidden;
}
.chat-progress i::after {
  content: ""; position: absolute; inset: 0; width: var(--p, 0%);
  background: var(--primary); border-radius: inherit;
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-progress span { display: block; margin-top: 0.45rem; font-size: 0.76rem; color: var(--muted-fg); }

/* ---------- 엔진 성능 증명 ---------- */
.proof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.proof-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 1.7rem;
}
.proof-card h3 { font-size: 1.05rem; margin-bottom: 1.2rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.proof-tag {
  font-size: 0.68rem; font-weight: 600; color: var(--muted-fg);
  border: 1px solid var(--border); border-radius: 999px; padding: 0.12rem 0.6rem;
}
.score { display: grid; grid-template-columns: 168px 1fr 30px; align-items: center; gap: 0.8rem; margin-bottom: 0.85rem; }
.score span { font-size: 0.83rem; color: var(--muted-fg); }
.score b { font-size: 0.85rem; text-align: right; }
.score-bar { height: 7px; border-radius: 999px; background: hsl(0 0% 92%); overflow: hidden; }
.score-bar i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: inherit; transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1); }
.proof-note { margin-top: 1rem; font-size: 0.8rem; color: var(--muted-fg); border-top: 1px dashed var(--border); padding-top: 0.9rem; }
.ledger { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.ledger li { display: flex; gap: 0.8rem; align-items: flex-start; }
.ledger i {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: hsl(0 0% 9% / 0.08); font-style: normal; font-size: 0.72rem; margin-top: 0.15rem;
}
.ledger b { display: block; font-size: 0.92rem; }
.ledger span { font-size: 0.8rem; color: var(--muted-fg); }
.pipeline {
  display: flex; align-items: stretch; gap: 0.6rem; margin-top: 2.6rem;
}
.pipe-step {
  flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 1.2rem 1.25rem; transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.pipe-step:hover { transform: translateY(-4px); box-shadow: 0 12px 30px hsl(0 0% 0% / 0.08); }
.pipe-step span { font-size: 0.75rem; font-weight: 700; color: var(--muted-fg); letter-spacing: 0.08em; }
.pipe-step h4 { font-size: 1rem; margin: 0.35rem 0 0.3rem; }
.pipe-step p { font-size: 0.8rem; color: var(--muted-fg); }
.pipe-arrow { align-self: center; color: var(--muted-fg); font-size: 1.1rem; }
.stats-row { display: flex; justify-content: center; gap: clamp(2rem, 6vw, 5rem); flex-wrap: wrap; margin: 3.2rem 0 0; padding: 0; }
.stat { text-align: center; }
.stat dd { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -0.02em; }
.stat dt { font-size: 0.82rem; color: var(--muted-fg); margin-top: 0.15rem; }

/* ---------- 웹소설 생성 6단계 ---------- */
.stage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.stage-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 1.7rem 1.6rem; display: flex; flex-direction: column; align-items: flex-start;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stage-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px hsl(0 0% 0% / 0.08); }
.stage-num { font-size: 0.8rem; font-weight: 700; color: var(--muted-fg); letter-spacing: 0.1em; }
.stage-card h3 { font-size: 1.08rem; margin: 0.5rem 0 0.5rem; }
.stage-card p { color: var(--muted-fg); font-size: 0.88rem; flex: 1; }
.stage-tag {
  margin-top: 1rem; font-size: 0.7rem; font-weight: 600; color: var(--fg);
  border: 1px solid var(--border); background: var(--muted); border-radius: 999px; padding: 0.2rem 0.7rem;
}

/* ---------- 연구 인용 ---------- */
.cite-head { text-align: center; margin: 3rem 0 1.4rem; }
.cite-head h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: -0.02em; }
.cite-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
.cite {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.cite b { display: block; font-size: 0.9rem; letter-spacing: -0.01em; }
.cite span { display: block; font-size: 0.74rem; color: var(--muted-fg); font-style: italic; margin: 0.15rem 0 0.5rem; }
.cite p { font-size: 0.8rem; color: var(--muted-fg); }

/* ---------- 웹툰 변환 노트 ---------- */
.webtoon-note { text-align: center; margin-top: 2rem; font-size: 0.86rem; color: var(--muted-fg); }

/* ---------- 완성작 갤러리 ---------- */
.works-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.work {
  position: relative; border-radius: var(--radius-card); overflow: hidden;
  border: 1px solid var(--border); aspect-ratio: 2 / 3;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.work:hover { transform: translateY(-6px); box-shadow: 0 20px 45px hsl(0 0% 0% / 0.18); }
.work img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.work:hover img { transform: scale(1.05); }
.work-overlay {
  position: absolute; inset: auto 0 0 0; padding: 2.4rem 0.95rem 0.95rem;
  background: linear-gradient(to top, hsl(0 0% 0% / 0.78), transparent);
  color: white;
}
.work-overlay h3 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.work-genre {
  display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.68rem; font-weight: 600;
  background: hsl(0 0% 100% / 0.18); border: 1px solid hsl(0 0% 100% / 0.25);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}

/* ---------- 3단계 ---------- */
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.how-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 1.9rem 1.6rem; text-align: left;
}
.how-num { font-size: 0.85rem; font-weight: 700; color: var(--muted-fg); letter-spacing: 0.1em; }
.how-card h3 { font-size: 1.12rem; margin: 0.55rem 0 0.55rem; }
.how-card p { color: var(--muted-fg); font-size: 0.9rem; }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.faq-head p { color: var(--muted-fg); margin-top: 0.9rem; }
.faq-contact a { text-decoration: underline; text-underline-offset: 3px; }
.faq-list { display: flex; flex-direction: column; gap: 0.7rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); transition: border-color 0.25s ease; }
.faq-item[open] { border-color: hsl(0 0% 60%); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 1rem 1.25rem; font-weight: 600; font-size: 0.95rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.25rem; font-weight: 300; color: var(--muted-fg); transition: transform 0.3s ease; flex: none; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 1.25rem 1.1rem; color: var(--muted-fg); font-size: 0.9rem; }

/* ---------- 최종 CTA (다크 그라디언트) ---------- */
.cta {
  padding: clamp(5rem, 9vw, 8rem) 0; text-align: center;
  background: linear-gradient(to bottom right, hsl(0 0% 9%), hsl(0 0% 9% / 0.85));
  color: var(--primary-fg);
}
.cta-inner { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.cta p { max-width: 540px; opacity: 0.85; font-size: 1.04rem; }
.cta .hero-actions { margin-top: 0.6rem; }
.cta-trust { font-size: 0.82rem; opacity: 0.6; margin-top: 0.4rem; }

/* ---------- 푸터 ---------- */
.footer { border-top: 1px solid var(--border); padding: 3.5rem 0 2rem; }
.footer-cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; }
.footer-brand p { color: var(--muted-fg); font-size: 0.88rem; margin-top: 1rem; max-width: 360px; }
.footer-col h4 { font-size: 0.9rem; margin-bottom: 0.9rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.footer-col a { color: var(--muted-fg); font-size: 0.87rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--fg); }
.footer-legal {
  display: flex; flex-direction: column; gap: 0.3rem;
  border-top: 1px solid var(--border); margin-top: 2.8rem; padding-top: 1.6rem;
  font-size: 0.8rem; color: var(--muted-fg); line-height: 1.7;
}
.footer-legal a { color: var(--muted-fg); text-decoration: underline; text-underline-offset: 2px; transition: color 0.2s; }
.footer-legal a:hover { color: var(--fg); }
.footer-legal-links { display: flex; gap: 1rem; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 1.2rem; padding-top: 0.4rem;
  font-size: 0.8rem; color: var(--muted-fg);
}

/* ---------- 반응형 ---------- */
@media (max-width: 1024px) {
  .feature-grid, .stage-grid { grid-template-columns: repeat(2, 1fr); }
  .works-grid { grid-template-columns: repeat(3, 1fr); }
  .cite-grid { grid-template-columns: repeat(2, 1fr); }
  .engine-grid, .proof-grid { grid-template-columns: 1fr; }
  .pipeline { flex-wrap: wrap; }
  .pipe-arrow { display: none; }
  .pipe-step { flex: 1 1 42%; }
  .faq-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .hero { padding-top: 7.5rem; }
  .feature-grid, .how-grid, .stage-grid, .cite-grid { grid-template-columns: 1fr; }
  .score { grid-template-columns: 120px 1fr 30px; }
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .engine-perks { grid-template-columns: 1fr; }
  .pipe-step { flex: 1 1 100%; }
  .footer-cols { grid-template-columns: 1fr; gap: 1.8rem; }
}

/* ---------- 접근성: 모션 최소화 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .work, .work img, .m-card, .pipe-step, .stage-card, .score-bar i, .chat-progress i::after { transition: none; }
}
