/* ============================================================
   Minimalist Modern — Design Tokens
   ============================================================ */
:root {
  --background: #FAFAFA;
  --foreground: #0F172A;
  --muted: #F1F5F9;
  --muted-foreground: #64748B;
  --accent: #0052FF;
  --accent-secondary: #4D7CFF;
  --border: #E2E8F0;
  --card: #FFFFFF;

  --gradient: linear-gradient(to right, var(--accent), var(--accent-secondary));
  --gradient-diagonal: linear-gradient(135deg, var(--accent), var(--accent-secondary));

  --font-display: "Calistoga", "Gowun Batang", Georgia, serif;
  --font-sans: "Inter", "Pretendard", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Noto Sans KR", monospace;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
  --shadow-accent: 0 4px 14px rgba(0,82,255,0.25);
  --shadow-accent-lg: 0 8px 24px rgba(0,82,255,0.35);

  --sidebar-w: 17.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --dark: #0F172A;
  --dark-raised: #16213C;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(0,82,255,0.15); }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.underline-mark { position: relative; display: inline-block; z-index: 0; }
.underline-mark::after {
  content: "";
  position: absolute; left: -0.04em; bottom: 0.02em;
  width: calc(100% + 0.08em); height: 0.22em;
  border-radius: 2px;
  background: linear-gradient(to right, rgba(0,82,255,0.28), rgba(77,124,255,0.14));
  z-index: -1;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.7; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   App shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  background: var(--dark);
  color: rgba(255,255,255,0.85);
  padding: 1.5rem 1rem 3rem;
  z-index: 40;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

.sb-brand {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.75rem;
}
.sb-brand .mark {
  width: 2.25rem; height: 2.25rem; flex-shrink: 0;
  border-radius: 0.625rem;
  background: var(--gradient-diagonal);
  box-shadow: var(--shadow-accent);
  display: grid; place-items: center;
  color: #fff; font-size: 1rem;
}
.sb-brand .name {
  font-family: var(--font-display);
  font-size: 1rem; line-height: 1.35; color: #fff;
}
.sb-brand .sub {
  display: block;
  font-family: var(--font-mono); font-size: 0.5625rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.sb-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.65);
  transition: all 200ms var(--ease-out);
  min-height: 2.875rem;
}
.sb-item .n {
  width: 1.75rem; flex-shrink: 0;
  font-family: var(--font-mono); font-size: 0.6875rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
}
.sb-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sb-item:hover .n { color: rgba(255,255,255,0.6); }
.sb-item[aria-current="page"] {
  background: var(--gradient);
  color: #fff; font-weight: 500;
  box-shadow: var(--shadow-accent);
}
.sb-item[aria-current="page"] .n { color: rgba(255,255,255,0.75); }

/* ─── Mobile top bar + drawer ─── */
.topbar {
  display: none;
  position: sticky; top: 0; z-index: 45;
  align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(250,250,250,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .mark {
  width: 2rem; height: 2rem; border-radius: 0.5rem;
  background: var(--gradient-diagonal);
  display: grid; place-items: center; color: #fff; font-size: 0.875rem;
}
.topbar .now { font-size: 0.875rem; font-weight: 600; }
.menu-toggle {
  margin-left: auto;
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.menu-toggle span {
  display: block; width: 1.125rem; height: 2px; border-radius: 2px;
  background: var(--foreground); position: relative;
}
.menu-toggle span::before,
.menu-toggle span::after {
  content: ""; position: absolute; left: 0;
  width: 100%; height: 2px; border-radius: 2px; background: var(--foreground);
}
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }

.scrim {
  display: none;
  position: fixed; inset: 0; z-index: 39;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(2px);
}
.scrim.open { display: block; }

/* ─── Main ─── */
.main { min-width: 0; }
.page { display: none; padding: 3.5rem 3rem 7rem; }
.page.active { display: block; animation: fadeUp 450ms var(--ease-out); }
.wrap { max-width: 62rem; }

/* ============================================================
   Page header / labels
   ============================================================ */
.page-head {
  display: flex; gap: 1.25rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.page-head .num {
  width: 3rem; height: 3rem; flex-shrink: 0;
  border-radius: 0.875rem;
  background: var(--gradient-diagonal);
  box-shadow: var(--shadow-accent);
  color: #fff;
  font-family: var(--font-mono); font-size: 1.125rem;
  display: grid; place-items: center;
}
.page-head .tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: rgba(0,82,255,0.07);
  border: 1px solid rgba(0,82,255,0.2);
  border-radius: 999px;
  padding: 0.1875rem 0.625rem;
  margin-bottom: 0.625rem;
}
.page-head h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.35; letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.page-head p { color: var(--muted-foreground); font-size: 0.9375rem; line-height: 1.75; }

.label-badge {
  display: inline-flex; align-items: center; gap: 0.75rem;
  border: 1px solid rgba(0,82,255,0.3);
  background: rgba(0,82,255,0.05);
  border-radius: 999px;
  padding: 0.4375rem 1.125rem;
}
.label-badge .dot {
  width: 0.5rem; height: 0.5rem; border-radius: 999px;
  background: var(--accent); animation: pulse 2s ease-in-out infinite;
}
.label-badge span:last-child {
  font-family: var(--font-mono); font-size: 0.6875rem;
  text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent);
}

.block-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem; font-weight: 600;
  color: var(--accent);
  margin: 3rem 0 0.375rem;
}
.block-label .pip {
  width: 0.5rem; height: 0.5rem; border-radius: 999px;
  background: var(--gradient);
}
.block-hint {
  font-size: 0.875rem; color: var(--muted-foreground);
  margin-bottom: 1.25rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 3rem; padding-inline: 1.5rem;
  border-radius: var(--radius-lg);
  font-size: 0.9375rem; font-weight: 500;
  transition: all 200ms var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-accent-lg); filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }
.btn-outline { border: 1px solid var(--border); color: var(--foreground); background: var(--card); }
.btn-outline:hover { background: var(--muted); border-color: rgba(0,82,255,0.3); transform: translateY(-2px); }
.btn-lg { height: 3.5rem; padding-inline: 2rem; font-size: 1rem; }
.btn .arrow { display: inline-block; transition: transform 200ms var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

.on-dark .btn-outline { border-color: rgba(255,255,255,0.18); color: rgba(255,255,255,0.8); background: transparent; }
.on-dark .btn-outline:hover { background: rgba(255,255,255,0.07); border-color: rgba(77,124,255,0.5); color: #fff; }

/* ============================================================
   1) 예시 갤러리
   ============================================================ */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.25rem;
}

.g-card {
  display: block; text-align: left; width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 300ms var(--ease-out);
}
.g-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
  border-color: rgba(0,82,255,0.25);
}

.g-figure {
  position: relative; display: block;
  aspect-ratio: 4 / 3;
  background: var(--muted);
  overflow: hidden;
}
.g-figure img { width: 100%; height: 100%; object-fit: cover; }
.g-figure .placeholder {
  position: absolute; inset: 0;
  display: grid; place-content: center; gap: 0.625rem; justify-items: center;
  text-align: center; padding: 1rem;
  background: radial-gradient(60% 60% at 50% 40%, rgba(0,82,255,0.07), transparent 70%), var(--muted);
}
.g-figure .placeholder .ph-mark {
  width: 2.5rem; height: 2.5rem; border-radius: 0.625rem;
  background: var(--gradient-diagonal); opacity: 0.25;
}
.g-figure .placeholder code,
.g-figure .placeholder span {
  font-family: var(--font-mono); font-size: 0.6875rem;
  color: var(--muted-foreground);
  background: rgba(255,255,255,0.75);
  padding: 0.1875rem 0.4375rem; border-radius: 4px;
  word-break: break-all;
}
.g-index {
  position: absolute; top: 0.75rem; left: 0.75rem; z-index: 2;
  font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.1em;
  background: rgba(15,23,42,0.72); color: #fff;
  padding: 0.1875rem 0.5rem; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.g-hover {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center;
  background: rgba(0,82,255,0.82);
  color: #fff; font-size: 0.9375rem; font-weight: 600;
  opacity: 0;
  transition: opacity 250ms var(--ease-out);
}
.g-card:hover .g-hover,
.g-card:focus-visible .g-hover { opacity: 1; }

.g-meta { display: block; padding: 1rem 1.125rem 1.125rem; }
.g-title {
  display: block;
  font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}
.g-note {
  display: block;
  font-size: 0.8125rem; line-height: 1.6;
  color: var(--muted-foreground);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center; padding-block: 3.5rem;
  color: var(--muted-foreground);
  font-size: 0.9375rem; line-height: 1.9;
  border: 1px dashed var(--border); border-radius: var(--radius-xl);
}
.empty-state code {
  font-family: var(--font-mono); font-size: 0.8125rem;
  background: var(--muted); padding: 0.125rem 0.375rem; border-radius: 4px;
}

/* ============================================================
   프롬프트 보기 창 (모달)
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 1.5rem; }
.modal[hidden] { display: none; }
.modal-scrim { position: absolute; inset: 0; background: rgba(15,23,42,0.6); backdrop-filter: blur(3px); }
.modal-box {
  position: relative; z-index: 1;
  width: min(48rem, 100%);
  max-height: min(88vh, 54rem);
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: popIn 300ms var(--ease-out);
}
.modal-close {
  position: absolute; top: 0.875rem; right: 0.875rem; z-index: 3;
  width: 2.25rem; height: 2.25rem; border-radius: 999px;
  background: rgba(15,23,42,0.6); color: #fff;
  display: grid; place-items: center; font-size: 0.875rem;
  backdrop-filter: blur(4px);
  transition: background 200ms var(--ease-out);
}
.modal-close:hover { background: rgba(15,23,42,0.85); }

/* 이미지를 자르지 않고 전체를 보여준다. 비율은 원본을 따라가고,
   너무 길어지지 않게 높이만 제한한다. */
.modal-figure {
  position: relative;
  background: var(--muted);
  min-height: 10rem;
  display: flex; align-items: center; justify-content: center;
}
.modal-figure img {
  display: block;
  width: auto; height: auto;
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
}
.modal-figure .placeholder {
  position: absolute; inset: 0;
  display: grid; place-content: center; gap: 0.625rem; justify-items: center;
  background: radial-gradient(60% 60% at 50% 40%, rgba(0,82,255,0.07), transparent 70%), var(--muted);
}
.modal-figure .placeholder .ph-mark {
  width: 3rem; height: 3rem; border-radius: 0.75rem;
  background: var(--gradient-diagonal); opacity: 0.25;
}
.modal-figure .placeholder code,
.modal-figure .placeholder span {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-foreground);
  background: rgba(255,255,255,0.75); padding: 0.1875rem 0.5rem; border-radius: 4px;
}

.modal-body { padding: 1.75rem; }
.modal-body h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.5rem; letter-spacing: -0.01em;
  margin-bottom: 0.375rem;
}
.modal-note { font-size: 0.9375rem; color: var(--accent); margin-bottom: 1.25rem; }
.modal-note[hidden] { display: none; }
.modal-tip { margin-top: 0.875rem; font-size: 0.8125rem; color: var(--muted-foreground); }

/* 프롬프트 블록 */
.prompt-block {
  background: var(--dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pb-head {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pb-head .pip {
  width: 0.4375rem; height: 0.4375rem; border-radius: 999px;
  background: var(--accent-secondary); flex-shrink: 0;
}
.pb-head .name { font-size: 0.8125rem; font-weight: 500; color: rgba(255,255,255,0.85); }
.pb-head .copy {
  margin-left: auto; flex-shrink: 0;
  height: 2rem; padding-inline: 0.875rem;
  border-radius: 0.5rem;
  background: var(--gradient);
  color: #fff; font-size: 0.75rem; font-weight: 500;
  transition: all 200ms var(--ease-out);
}
.pb-head .copy:hover { filter: brightness(1.12); box-shadow: var(--shadow-accent); }
.pb-body {
  padding: 1.125rem 1.25rem;
  font-size: 0.8125rem; line-height: 1.9;
  color: rgba(255,255,255,0.82);
  white-space: pre-wrap;
  max-height: 22rem; overflow-y: auto;
}

/* ============================================================
   2) 프롬프트 다듬기
   ============================================================ */
.refine { display: grid; gap: 1.25rem; }

.refine-in {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.refine-guide { font-size: 0.875rem; color: var(--muted-foreground); margin-bottom: 0.875rem; }
.r-input {
  width: 100%;
  min-height: 8rem;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background);
  padding: 0.875rem 1rem;
  font-size: 0.9375rem; line-height: 1.75;
  font-family: var(--font-sans);
  transition: all 200ms var(--ease-out);
}
.r-input::placeholder { color: rgba(100,116,139,0.55); }
.r-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,82,255,0.12);
  background: var(--card);
}

/* 등장인물 — 성별 / 나이대 / 얼굴 참조 */
.person-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  margin-top: 1rem;
}
.p-field { display: flex; align-items: center; gap: 0.4375rem; }
.p-field > span { font-size: 0.8125rem; font-weight: 500; color: var(--muted-foreground); }
.p-field select {
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 0 2rem 0 0.75rem;
  font-size: 0.8125rem;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%),
                    linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
  background-position: calc(100% - 1rem) 1.1875rem, calc(100% - 0.6875rem) 1.1875rem;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: all 200ms var(--ease-out);
}
.p-field select:hover { border-color: rgba(0,82,255,0.35); }
.p-field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,82,255,0.12); }



.ratio-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1rem; }
.ratio-label { font-size: 0.8125rem; font-weight: 500; color: var(--muted-foreground); margin-right: 0.25rem; }
.chip-btn {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.9375rem;
  font-size: 0.8125rem; font-weight: 500;
  min-height: 2.75rem;
  transition: all 200ms var(--ease-out);
}
.chip-btn:hover { border-color: rgba(0,82,255,0.4); background: rgba(0,82,255,0.04); }
.chip-btn[aria-pressed="true"] {
  background: var(--gradient); border-color: transparent;
  color: #fff; box-shadow: var(--shadow-accent);
}

.refine-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 1.25rem; }

.output-panel {
  border-radius: var(--radius-xl);
  background: var(--gradient-diagonal);
  padding: 2px;
  box-shadow: var(--shadow-accent-lg);
}
.output-inner {
  background: var(--dark-raised);
  border-radius: calc(var(--radius-xl) - 2px);
  padding: 1.25rem;
  color: rgba(255,255,255,0.85);
}
.output-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.875rem;
}
.output-head strong { font-size: 0.9375rem; color: #fff; }
.output-head .count { font-family: var(--font-mono); font-size: 0.6875rem; color: rgba(255,255,255,0.45); }
.r-output {
  width: 100%; min-height: 16rem; max-height: 26rem; resize: vertical;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  color: rgba(255,255,255,0.88);
  font-size: 0.8125rem; line-height: 1.85;
  font-family: var(--font-sans);
}
.r-output:focus { outline: none; border-color: var(--accent-secondary); }
.out-hint {
  margin-top: 0.5rem;
  font-size: 0.78125rem; line-height: 1.6;
  color: rgba(255,255,255,0.55);
}
.output-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.875rem; }

/* ============================================================
   24개 강점 참고 목록
   ============================================================ */
.strength-ref {
  margin-top: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.strength-ref summary {
  cursor: pointer; list-style: none;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem; font-weight: 600;
  display: flex; align-items: center; gap: 0.5rem;
}
.strength-ref summary::-webkit-details-marker { display: none; }
.strength-ref summary::before {
  content: "▸"; color: var(--accent);
  transition: transform 200ms var(--ease-out);
}
.strength-ref[open] summary::before { transform: rotate(90deg); }
.strength-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
  padding: 0 1.25rem 1.25rem;
}
.s-item { display: block; }
.s-item b { display: block; font-size: 0.875rem; font-weight: 600; }
.s-item small { display: block; font-size: 0.75rem; color: var(--muted-foreground); }

/* ============================================================
   시작하기 페이지
   ============================================================ */
.hero { position: relative; margin-bottom: 3rem; }
.hero::before {
  content: "";
  position: absolute; inset: -2rem -2rem 0;
  background: radial-gradient(55% 60% at 80% 25%, rgba(0,82,255,0.08), transparent 70%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem; align-items: center;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.25; letter-spacing: -0.02em;
  margin-block: 1.25rem 1rem;
}
.hero p.lead { color: var(--muted-foreground); font-size: 1rem; line-height: 1.85; max-width: 32rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.hero-visual { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.ring {
  position: absolute; inset: 8%;
  border: 1.5px dashed rgba(0,82,255,0.25); border-radius: 999px;
  animation: spin 60s linear infinite;
}
.ring.inner {
  inset: 24%; border-style: solid; border-color: rgba(0,82,255,0.1);
  animation-duration: 45s; animation-direction: reverse;
}
.orb {
  position: absolute; width: 45%; aspect-ratio: 1; border-radius: 999px;
  background: var(--gradient-diagonal); opacity: 0.12; filter: blur(30px);
}
.float-card {
  position: absolute;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
  padding: 0.75rem 1rem;
  display: flex; align-items: center; gap: 0.625rem;
  font-size: 0.78125rem; font-weight: 500; white-space: nowrap;
}
.float-card .chip {
  width: 1.875rem; height: 1.875rem; flex-shrink: 0;
  border-radius: 0.5rem; background: var(--gradient-diagonal);
  display: grid; place-items: center; color: #fff; font-size: 0.8125rem;
}
.float-card.a { top: 8%; left: -8%; animation: bob 5s ease-in-out infinite; }
.float-card.b { bottom: 16%; right: -6%; animation: bob 4s ease-in-out infinite 0.6s; }
.float-card.c {
  bottom: 2%; left: 4%; animation: bob 4.5s ease-in-out infinite 1.2s;
  font-family: var(--font-mono); font-size: 0.625rem;
  letter-spacing: 0.08em; color: var(--muted-foreground);
}
.hero-dots {
  position: absolute; right: 8%; top: 4%;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
}
.hero-dots i { width: 4px; height: 4px; border-radius: 999px; background: rgba(0,82,255,0.3); }
.corner-block {
  position: absolute; top: 10%; right: 32%;
  width: 3rem; height: 3rem; border-radius: 0.875rem;
  background: var(--accent); box-shadow: var(--shadow-accent-lg);
}

.module-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.module-card {
  position: relative; display: block;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 300ms var(--ease-out);
}
.module-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: rgba(0,82,255,0.25); }
.module-card .badge {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.12em;
  color: var(--accent); background: rgba(0,82,255,0.08);
  border-radius: 999px; padding: 0.1875rem 0.625rem; margin-bottom: 0.875rem;
}
.module-card h3 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.375rem; letter-spacing: -0.01em; margin-bottom: 0.5rem;
}
.module-card p { font-size: 0.875rem; color: var(--muted-foreground); line-height: 1.75; }
.module-card .go {
  display: inline-flex; align-items: center; gap: 0.375rem;
  margin-top: 1rem; font-size: 0.8125rem; font-weight: 500; color: var(--accent);
}
.module-card .go .arrow { display: inline-block; transition: transform 200ms var(--ease-out); }
.module-card:hover .go .arrow { transform: translateX(4px); }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.steps.two { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.steps.three { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

/* AI에게 그대로 말해 보라고 보여주는 문장 */
.step p.say {
  margin-top: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-left: 2px solid var(--accent);
  background: rgba(0,82,255,0.05);
  border-radius: 0 0.5rem 0.5rem 0;
  color: var(--accent);
  font-weight: 500;
}
.step p.say::before { content: "\201C"; }
.step p.say::after  { content: "\201D"; }
.step {
  position: relative;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.625rem;
  box-shadow: var(--shadow-sm);
  transition: all 300ms var(--ease-out);
}
.step:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.step .n {
  font-family: var(--font-display); font-size: 2rem; line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 0.625rem;
}
.step h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.375rem; }
.step p { font-size: 0.875rem; color: var(--muted-foreground); line-height: 1.7; }
.step p + p { margin-top: 0.625rem; }
.step-arrow {
  position: absolute; top: 50%; right: -0.8125rem; transform: translateY(-50%);
  width: 1.5rem; height: 1.5rem; border-radius: 999px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 0.625rem;
  box-shadow: var(--shadow-accent); z-index: 2;
}

/* ============================================================
   Toast
   ============================================================ */
#toast {
  position: fixed; left: 50%; bottom: 2rem; z-index: 100;
  transform: translate(-50%, 1.5rem);
  display: flex; align-items: center; gap: 0.625rem;
  background: var(--foreground); color: #fff;
  border-radius: 999px; padding: 0.75rem 1.375rem;
  font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow-xl);
  opacity: 0; pointer-events: none;
  transition: all 300ms var(--ease-out);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast .tick {
  width: 1.125rem; height: 1.125rem; flex-shrink: 0; border-radius: 999px;
  background: var(--gradient); display: grid; place-items: center; font-size: 0.625rem;
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.reveal.visible { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-visual { display: none; }
  .page { padding-inline: 2rem; }
}

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0;
    width: min(20rem, 84vw); height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 300ms var(--ease-out);
  }
  .sidebar.open { transform: none; }
  .scrim { z-index: 46; }
  .page { padding: 2rem 1.25rem 5rem; }
  .module-cards { grid-template-columns: 1fr; }
  /* 3단계는 좁은 화면에서 세로로 쌓는다 */
  .steps.three { grid-template-columns: 1fr; }
  .steps.three .step-arrow { display: none; }
}

@media (max-width: 640px) {
  .steps, .steps.two, .steps.three { grid-template-columns: 1fr; }
  .step-arrow { display: none; }
  .gallery { grid-template-columns: 1fr; }
  .page-head { gap: 0.875rem; }
  .page-head .num { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
  .hero-actions .btn { width: 100%; }
  .modal { padding: 0.75rem; }
  .modal-body { padding: 1.25rem; }
  .refine-in { padding: 1.125rem; }
  .output-inner { padding: 1rem; }
  .refine-actions .btn { width: 100%; }
  .strength-list { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .sidebar, .topbar, .output-actions, #toast, .pb-head .copy { display: none; }
  .app { grid-template-columns: 1fr; }
  .pb-body { max-height: none; }
}
