:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-soft: #f3f0e9;
  --text: #20201f;
  --muted: #696761;
  --border: #dedbd2;
  --accent: #f08b62;
  --accent-dark: #ca6844;
  --accent-soft: #fff0e9;
  --success: #2f7a58;
  --danger: #b84b43;
  --shadow: 0 18px 50px rgba(44, 39, 32, 0.08);
  --radius: 22px;
}

body.dark {
  --bg: #171716;
  --surface: #232321;
  --surface-soft: #2d2d2a;
  --text: #f3f1eb;
  --muted: #bbb7ad;
  --border: #3d3c38;
  --accent-soft: #3a2922;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  transition: background .25s ease, color .25s ease;
}
button, input { font: inherit; }
button { cursor: pointer; }

.site-header {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  color: var(--text);
  text-decoration: none;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
}
.icon-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 20px;
}

main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero { text-align: center; padding: 64px 0 42px; }
.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-dark);
}
.hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}
.hero h1 span { color: var(--accent-dark); }
.hero-copy {
  max-width: 680px;
  margin: 24px auto 30px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}
.search-box {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.search-field-wrap { position: relative; }
.search-field-wrap input {
  width: 100%;
  height: 62px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 18px;
  padding: 0 52px 0 52px;
  font-family: "Nanum Gothic", sans-serif;
  font-size: 20px;
  outline: none;
  box-shadow: var(--shadow);
}
.search-field-wrap input:focus { border-color: var(--accent); }
.search-icon, .clear-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.search-icon { left: 19px; font-size: 25px; color: var(--muted); }
.clear-button {
  right: 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
}
.search-button {
  height: 62px;
  border: 0;
  padding: 0 28px;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.search-button:hover { background: var(--accent-dark); }
.suggestions {
  position: absolute;
  z-index: 10;
  top: 70px;
  left: 0;
  width: calc(100% - 139px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: none;
  text-align: left;
}
.suggestion {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
}
.suggestion:hover { background: var(--surface-soft); }
.suggestion strong { font-family: "Nanum Gothic", sans-serif; }
.suggestion span { color: var(--muted); }
.quick-verbs {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.quick-verbs button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font-family: "Nanum Gothic", sans-serif;
}

.card, .empty-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.empty-state, .not-found { padding: 38px 0 90px; }
.empty-card { max-width: 650px; margin: auto; padding: 54px 30px; text-align: center; }
.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  font: 700 32px "Nanum Gothic", sans-serif;
}
.empty-card h2 { margin-bottom: 10px; }
.empty-card p { color: var(--muted); line-height: 1.6; }

.results { padding: 22px 0 90px; }
.verb-overview {
  padding: 32px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.result-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.verb-title-line { display: flex; align-items: center; gap: 14px; }
.verb-title-line h2 {
  margin: 0;
  font: 700 clamp(38px, 6vw, 58px) "Nanum Gothic", sans-serif;
}
.audio-button {
  border: 0;
  background: var(--accent-soft);
  color: var(--accent-dark);
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
.meaning { margin: 9px 0 0; color: var(--muted); font-size: 18px; }
.verb-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}
.result-tabs {
  display: flex;
  gap: 8px;
  margin: 26px 0;
  overflow-x: auto;
}
.tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 17px;
  white-space: nowrap;
}
.tab.active { color: #fff; background: var(--text); border-color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.section-block { padding-top: 10px; }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 20px;
}
.section-heading h2, .content-card h2 { margin: 0; font-size: 30px; }
.section-heading > p { max-width: 450px; color: var(--muted); text-align: right; line-height: 1.5; }
.conjugation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.conjugation-card {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 18px;
  padding: 20px;
  min-height: 142px;
  transition: transform .18s ease, border-color .18s ease;
}
.conjugation-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.conjugation-card .category { color: var(--muted); font-size: 12px; }
.conjugation-card .form { font: 700 25px "Nanum Gothic", sans-serif; margin: 17px 0 8px; }
.conjugation-card .translation { color: var(--accent-dark); font-size: 14px; }
.explanation-panel { margin-top: 18px; padding: 30px; }
.explanation-top { display: flex; justify-content: space-between; gap: 20px; }
.explanation-top h2 { margin: 0; font: 700 38px "Nanum Gothic", sans-serif; }
.explanation-meaning { color: var(--accent-dark); font-weight: 600; }
.explanation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 25px 0; }
.explanation-grid h3 { margin-bottom: 8px; }
.explanation-grid p { color: var(--muted); line-height: 1.65; }
.example-box { background: var(--surface-soft); border-radius: 18px; padding: 22px; }
.example-header { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.text-button { border: 0; background: transparent; color: var(--accent-dark); font-weight: 600; }
.example-korean { font: 700 24px/1.55 "Nanum Gothic", sans-serif; margin: 18px 0 7px; }
.example-english { margin: 0; color: var(--muted); }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.content-card { padding: 28px; }
.list-stack { margin-top: 20px; display: grid; gap: 10px; }
.list-item { border-top: 1px solid var(--border); padding: 16px 0 6px; }
.list-item:first-child { border-top: 0; }
.list-korean { font: 700 19px "Nanum Gothic", sans-serif; }
.list-item p { color: var(--muted); margin: 7px 0; line-height: 1.55; }
.chip-wrap { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 9px; }
.chip { padding: 9px 13px; border-radius: 999px; background: var(--surface-soft); font-family: "Nanum Gothic", sans-serif; }
.mistake-row { background: var(--surface-soft); padding: 16px; border-radius: 14px; }
.wrong { color: var(--danger); font-family: "Nanum Gothic", sans-serif; }
.correct { color: var(--success); font-family: "Nanum Gothic", sans-serif; margin-top: 5px; }
.rule-note { margin-top: 20px; color: var(--muted); line-height: 1.7; }
.rule-note strong { color: var(--text); }
.hidden { display: none !important; }
footer { text-align: center; color: var(--muted); padding: 30px 16px 50px; }

@media (max-width: 800px) {
  .hero { padding-top: 38px; }
  .search-box { grid-template-columns: 1fr; }
  .search-button { width: 100%; }
  .suggestions { width: 100%; }
  .verb-overview { align-items: flex-start; flex-direction: column; }
  .verb-meta { justify-content: flex-start; }
  .conjugation-grid { grid-template-columns: 1fr 1fr; }
  .two-column, .explanation-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading > p { text-align: left; margin-top: 0; }
}

@media (max-width: 520px) {
  main { width: min(100% - 22px, 1120px); }
  .site-header { width: calc(100% - 24px); }
  .hero h1 { font-size: 40px; }
  .hero-copy { font-size: 16px; }
  .conjugation-grid { grid-template-columns: 1fr; }
  .verb-overview, .explanation-panel, .content-card { padding: 22px; }
}
