:root {
  color-scheme: dark;
  --bg: #07090a;
  --panel: #0d1113;
  --text: #f2f5f5;
  --muted: #858f92;
  --accent: #3fe8e0;
  --line: rgba(255, 255, 255, 0.08);
  --max: 1440px;
  --pad: clamp(20px, 4vw, 64px);
  font-family: Pretendard, "Noto Sans KR", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: #051112;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 var(--pad);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 9, 10, 0.72);
  backdrop-filter: blur(6px);
}

.wordmark {
  font-family: "Arial Narrow", "Roboto Condensed", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 34px); }
.nav-links button, .nav-links a {
  border: 0;
  padding: 8px 0;
  background: none;
  color: rgba(242, 245, 245, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: color 220ms ease;
}
.nav-links button:hover, .nav-links a:hover, .nav-links button.is-active { color: var(--accent); }

.hero {
  position: relative;
  min-height: 70vh;
  max-height: 860px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero > img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; object-position: 50% 42%; }
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3, 5, 6, 0.88) 0%, rgba(3, 5, 6, 0.44) 42%, rgba(3, 5, 6, 0.16) 70%), linear-gradient(0deg, rgba(7, 9, 10, 0.54), transparent 40%);
}
.hero-copy {
  position: absolute;
  left: var(--pad);
  bottom: clamp(72px, 12vh, 132px);
  max-width: 760px;
}
.eyebrow, .section-index, .modal-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.18em;
}
.hero h1 {
  margin: 0;
  max-width: 760px;
  font-family: "Arial Narrow", "Roboto Condensed", sans-serif;
  font-size: clamp(3.25rem, 8.5vw, 8.4rem);
  font-stretch: condensed;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.82;
}
.hero-subtitle { margin: 26px 0 0; font-size: clamp(1rem, 1.5vw, 1.3rem); color: rgba(242, 245, 245, 0.82); }
.hero-meta { display: flex; gap: 24px; margin: 14px 0 0; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.13em; }
.hero-meta span + span::before { content: "·"; margin-right: 24px; color: var(--accent); }
.explore {
  position: absolute;
  right: var(--pad);
  bottom: 34px;
  display: flex;
  gap: 10px;
  align-items: center;
  color: rgba(242, 245, 245, 0.72);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
}
.explore span { color: var(--accent); transition: transform 220ms ease; }
.explore:hover span { transform: translateY(4px); }

.intro, .archive, .footer { max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.intro {
  display: grid;
  grid-template-columns: minmax(160px, 0.65fr) 2fr;
  gap: 40px;
  padding-top: clamp(90px, 12vw, 170px);
  padding-bottom: clamp(100px, 14vw, 190px);
}
.intro h2 {
  margin: 0;
  max-width: 920px;
  font-family: "Arial Narrow", "Roboto Condensed", sans-serif;
  font-size: clamp(2.5rem, 5.8vw, 6rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.96;
}
.intro h2 span { color: var(--accent); }
.intro div > p { max-width: 580px; margin: 32px 0 0; color: var(--muted); }
.intro strong { color: var(--accent); font-weight: 600; }

.archive { padding-bottom: clamp(120px, 12vw, 190px); }
.archive-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.archive-head h2 { margin: 0; font-family: "Arial Narrow", sans-serif; font-size: 1rem; letter-spacing: 0.14em; }
.archive-head p { margin: 0; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.14em; }
.archive-tools { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; padding: 25px 0 46px; }
.filters { display: flex; gap: clamp(18px, 3vw, 44px); overflow-x: auto; }
.filter {
  flex: 0 0 auto;
  border: 0;
  padding: 0 0 8px;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: color 220ms ease, border-color 220ms ease;
}
.filter span { margin-left: 6px; font-variant-numeric: tabular-nums; }
.filter:hover, .filter.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.search-field { flex: 0 1 260px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); transition: border-color 220ms ease; }
.search-field:focus-within { border-bottom-color: var(--accent); }
.search-field input { width: 100%; border: 0; outline: 0; padding: 0 0 9px; background: transparent; color: var(--text); font-size: 0.76rem; letter-spacing: 0.12em; }
.search-field input::placeholder { color: var(--muted); opacity: 0.9; }
.search-field > span:last-child { padding-bottom: 8px; color: var(--accent); }
.empty-state { grid-column: 1 / -1; padding: 90px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); text-align: center; letter-spacing: 0.1em; }
.prompt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(52px, 6vw, 92px) clamp(20px, 3vw, 44px); }
.prompt-card { min-width: 0; opacity: 0; transform: translateY(10px); animation: card-in 420ms ease forwards; }
@keyframes card-in { to { opacity: 1; transform: translateY(0); } }
.card-button { display: block; width: 100%; border: 0; padding: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.card-image { position: relative; aspect-ratio: 832 / 1216; overflow: hidden; background: var(--panel); }
.card-image img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 280ms ease, filter 280ms ease; }
.card-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(3, 6, 7, 0); transition: background 260ms ease; }
.card-overlay span { opacity: 0; transform: translateY(8px); padding: 9px 13px; border: 1px solid rgba(63, 232, 224, 0.7); background: rgba(7, 9, 10, 0.72); color: var(--text); font-size: 0.72rem; letter-spacing: 0.12em; transition: opacity 240ms ease, transform 240ms ease; }
.card-button:hover .card-image img, .card-button:focus-visible .card-image img { transform: scale(1.018); filter: brightness(0.68); }
.card-button:hover .card-overlay, .card-button:focus-visible .card-overlay { background: rgba(3, 6, 7, 0.18); }
.card-button:hover .card-overlay span, .card-button:focus-visible .card-overlay span { opacity: 1; transform: translateY(0); }
.card-meta { margin-top: 17px; color: var(--accent); font-size: 0.7rem; letter-spacing: 0.14em; }
.card-title { margin: 7px 0 0; font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-weight: 500; letter-spacing: -0.01em; }

.footer { padding-top: 34px; padding-bottom: 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; }
.footer-top { display: grid; grid-template-columns: minmax(190px, 0.7fr) minmax(0, 1.6fr); gap: clamp(40px, 8vw, 120px); }
.footer-identity { display: grid; align-content: start; gap: 7px; }
.footer p { margin: 0; }
.footer span { color: var(--accent); }
.footer a:hover { color: var(--text); }
.usage-note { max-width: 760px; }
.usage-en, .usage-ko { display: grid; gap: 3px; }
.usage-en { color: #bcc4c6; line-height: 1.6; }
.usage-en span, .usage-ko span { color: inherit; }
.usage-ko { margin-top: 14px !important; color: #687376; font-size: 0.68rem; line-height: 1.65; letter-spacing: 0.035em; }
.footer-bottom { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); color: #687376; font-size: 0.66rem; }

.modal[hidden] { display: none; }
.modal { position: fixed; z-index: 80; inset: 0; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(1, 2, 3, 0.82); animation: fade-in 220ms ease; }
.modal-panel {
  position: absolute;
  inset: clamp(18px, 3vw, 48px);
  display: grid;
  grid-template-columns: minmax(300px, 42%) minmax(0, 58%);
  max-width: 1500px;
  max-height: 900px;
  margin: auto;
  border: 1px solid var(--line);
  background: #090c0d;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
  overflow: hidden;
  animation: modal-in 280ms ease;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } }
.modal-close { position: absolute; z-index: 2; top: 18px; right: 22px; border: 0; background: rgba(7, 9, 10, 0.72); padding: 8px 10px; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.12em; cursor: pointer; }
.modal-close span { margin-left: 8px; color: var(--accent); font-size: 1rem; }
.modal-image-wrap { min-height: 0; background: #050708; overflow: hidden; }
.modal-image-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center top; }
.modal-content { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: clamp(32px, 4vw, 64px); overflow: hidden; }
.modal-heading { padding-right: 70px; }
.modal-kicker { margin-bottom: 10px; }
.modal-heading h2 { margin: 0 0 24px; font-size: clamp(1.8rem, 3vw, 3.25rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; }
.notice { margin: 0 0 12px; padding: 10px 12px; border-left: 2px solid var(--accent); background: rgba(63, 232, 224, 0.05); color: #c2cccc; font-size: 0.82rem; }
.notice.warning { border-left-color: #91a3a6; background: rgba(255, 255, 255, 0.035); }
.appearance-help { margin: 0 0 12px; color: var(--muted); font-size: 0.82rem; }
.appearance-help strong { color: var(--accent); }
.prompt-code { flex: 1 1 auto; min-height: 180px; margin: 0; padding: 22px; border: 1px solid var(--line); background: var(--panel); color: #cbd2d3; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.84rem; line-height: 1.7; white-space: pre-wrap; overflow: auto; scrollbar-color: #344144 var(--panel); }
.prompt-code .appearance-token { color: var(--accent); font-weight: 700; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.copy-button, .x-button { display: grid; place-items: center; min-height: 50px; border: 1px solid var(--accent); background: var(--accent); color: #041011; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.1em; cursor: pointer; transition: background 220ms ease, color 220ms ease; }
.copy-button:hover { background: #71f1eb; }
.x-button { border-color: var(--line); background: transparent; color: var(--text); }
.x-button:hover { border-color: rgba(63, 232, 224, 0.55); color: var(--accent); }
.share-link { align-self: flex-start; margin-top: 13px; border: 0; border-bottom: 1px solid var(--line); padding: 3px 0; background: transparent; color: var(--muted); font-size: 0.68rem; letter-spacing: 0.12em; cursor: pointer; }
.share-link:hover { color: var(--text); border-bottom-color: var(--accent); }

@media (max-width: 920px) {
  .prompt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-panel { grid-template-columns: 42% 58%; }
  .modal-content { padding: 38px 30px 28px; }
  .footer-top { grid-template-columns: minmax(160px, 0.55fr) minmax(0, 1.45fr); }
}

@media (max-width: 680px) {
  .site-header { min-height: 58px; }
  .wordmark { font-size: 0.67rem; }
  .nav-links { gap: 13px; }
  .nav-links button { display: none; }
  .nav-links a { font-size: 0.68rem; }
  .hero { min-height: 61vh; }
  .hero > img { object-position: 62% 46%; }
  .hero-shade { background: linear-gradient(90deg, rgba(3, 5, 6, 0.8), rgba(3, 5, 6, 0.18)), linear-gradient(0deg, rgba(7, 9, 10, 0.68), transparent 50%); }
  .hero-copy { bottom: 84px; }
  .hero h1 { font-size: clamp(3rem, 16vw, 5rem); line-height: 0.87; }
  .hero-subtitle { margin-top: 20px; }
  .hero-meta { gap: 12px; font-size: 0.65rem; }
  .hero-meta span + span::before { margin-right: 12px; }
  .explore { left: var(--pad); right: auto; bottom: 28px; }
  .intro { grid-template-columns: 1fr; gap: 24px; }
  .intro h2 { font-size: clamp(2.5rem, 12vw, 4.4rem); }
  .intro div > p { margin-top: 24px; }
  .archive-tools { display: block; padding-bottom: 34px; }
  .filters { padding-bottom: 26px; }
  .search-field { max-width: none; }
  .prompt-grid { grid-template-columns: 1fr; gap: 62px; }
  .card-image { aspect-ratio: 832 / 1120; }
  .footer-top { grid-template-columns: 1fr; gap: 34px; }
  .modal { position: fixed; overflow-y: auto; background: #090c0d; }
  .modal-backdrop { display: none; }
  .modal-panel { position: relative; inset: auto; display: block; max-height: none; min-height: 100%; border: 0; overflow: visible; }
  .modal-close { position: fixed; top: 12px; right: 12px; background: rgba(7, 9, 10, 0.9); }
  .modal-image-wrap { height: min(70vh, 620px); }
  .modal-image-wrap img { object-position: center top; }
  .modal-content { display: block; padding: 34px var(--pad) 64px; overflow: visible; }
  .modal-heading { padding-right: 0; }
  .prompt-code { max-height: 52vh; min-height: 340px; font-size: 0.82rem; }
  .modal-actions { grid-template-columns: 1fr; }
  .copy-button, .x-button { min-height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
