@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable-dynamic-subset.css");

:root {
  color-scheme: light;

  --font-family-sans: "Pretendard Variable", Pretendard, "SUIT Variable", SUIT, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-weight-regular: 400;
  --font-weight-semibold: 600;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-title: clamp(1.75rem, 4vw, 2.5rem);
  --font-size-display: clamp(2.25rem, 6vw, 4rem);

  --color-bg: #f6f5ed;
  --color-surface: #fffdf7;
  --color-surface-soft: #edf3e9;
  --color-text: #203c2b;
  --color-text-muted: #68726c;
  --color-accent: #4b7255;
  --color-accent-strong: #203c2b;
  --color-accent-secondary: #b37a3f;
  --color-border: #d4ded2;
  --color-on-accent: #fffdf7;
  --color-surface-glass: rgb(255 253 247 / 94%);
  --color-overlay: rgb(20 42 29 / 42%);
  --color-focus-ring: rgb(75 114 85 / 13%);
  --color-shadow: rgb(32 60 43 / 8%);
  --color-error: #b74444;
  --color-error-soft: #faeeee;
  --color-success: #3f704b;
  --color-warning: #9a6a2f;
  --color-focus: var(--color-accent);
  --color-dark-bg: #111a14;
  --color-dark-surface: #18231c;
  --color-dark-surface-soft: #223229;
  --color-dark-text: #dce9de;
  --color-dark-muted: #a9b6ac;
  --color-dark-border: #384a3d;
  --color-brand-naver: #03c75a;
  --color-brand-naver-hover: #02ad4e;

  --content-width: 1180px;
  --page-padding: clamp(16px, 3vw, 24px);
  --section-space: clamp(64px, 8vw, 104px);
  --card-gap: clamp(12px, 2vw, 24px);
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 12px 32px var(--color-shadow);
  --shadow-modal: 0 16px 38px rgb(32 60 43 / 13%);
  --header-height: 64px;
  --button-height: 48px;
  --button-padding-inline: 18px;
  --input-height: 48px;
  --transition-fast: 180ms ease;
  --transition-normal: 260ms ease;

  /* Existing apps use these aliases; they now resolve to one palette. */
  --bg: var(--color-bg);
  --panel: var(--color-surface);
  --panel-soft: var(--color-surface-soft);
  --soft: var(--color-surface-soft);
  --soft-green: var(--color-surface-soft);
  --soft-blue: var(--color-surface-soft);
  --ink: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --primary: var(--color-accent);
  --primary-hover: var(--color-accent-strong);
  --primary-2: var(--color-accent-secondary);
  --accent: var(--color-accent);
  --green: var(--color-accent);
  --blue: var(--color-accent);
  --gold: var(--color-accent-secondary);
  --rose: var(--color-error);
  --danger: var(--color-error);
  --shadow: var(--shadow-card);
  --shadow-sm: var(--shadow-card);
  --shadow-md: var(--shadow-modal);
  --color-primary: var(--color-accent);
  --color-primary-dark: var(--color-accent-strong);
  --content-max: var(--content-width);
  --space-section: var(--section-space);
  --radius-small: var(--radius-sm);
  --radius-input: var(--radius-md);
  --radius-card: var(--radius-lg);
  --shadow-natural: var(--shadow-card);
  --shadow-raised: var(--shadow-modal);
  --naver: var(--color-brand-naver);
  --naver-dark: var(--color-brand-naver-hover);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-family-sans);
  font-synthesis: none;
}

body,
button,
input,
textarea,
select {
  font-family: var(--font-family-sans);
  font-synthesis: none;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b,
button,
[role="button"],
label,
nav a,
.title,
.brand,
.badge {
  font-weight: var(--font-weight-semibold);
}

p,
li,
dd,
input,
textarea,
select {
  font-weight: var(--font-weight-regular);
}

a {
  color: var(--color-accent);
  text-underline-offset: 0.2em;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-strong);
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
.button,
.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--button-height);
  padding-inline: var(--button-padding-inline);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-surface);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

button:hover,
.button:hover,
.button-primary:hover {
  border-color: var(--color-accent-strong);
  background: var(--color-accent-strong);
}

.button-secondary,
.button-quiet {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.button-secondary:hover,
.button-quiet:hover {
  border-color: var(--color-accent);
  background: var(--color-surface-soft);
  color: var(--color-accent-strong);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

input,
textarea,
select,
.field {
  min-height: var(--input-height);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

input,
select,
.field {
  padding-inline: 14px;
}

textarea {
  padding: 14px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
.field:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-focus-ring);
  outline: 0;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.9;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled,
.is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.card,
.panel-card,
.form-card,
.empty-state,
.error-state,
.modal-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.badge,
.chip,
.level-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding-inline: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-soft);
  color: var(--color-accent-strong);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.modal,
[role="dialog"] {
  color: var(--color-text);
}

.modal-backdrop,
.overlay {
  background: var(--color-overlay);
  backdrop-filter: blur(2px);
}

.empty-state,
.error-state {
  padding: var(--space-lg);
  color: var(--color-text-muted);
  text-align: center;
}

.error-state,
.input-error,
.box-error {
  border-color: var(--color-error);
  background: var(--color-error-soft);
  color: var(--color-error);
}

.site-header,
.site-footer,
body > header,
body > footer {
  border-color: var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-text);
}

body > footer {
  color: var(--color-text-muted);
}

.site-header,
body > header {
  min-height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
}

.site-footer,
body > footer {
  border-top: 1px solid var(--color-border);
}

/* Decorative chevron: pseudo-elements are not announced by screen readers. */
.icon-chevron,
.icon-arrow {
  width: 8px;
  height: 8px;
  display: inline-block;
  flex: 0 0 auto;
  border-top: 1.8px solid currentColor;
  border-right: 1.8px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--transition-fast);
}

.button-link,
.navigation-link,
.navigation-back,
.button-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.button-link::after,
.navigation-link::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-top: 1.8px solid currentColor;
  border-right: 1.8px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--transition-fast);
}

.navigation-back::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-bottom: 1.8px solid currentColor;
  border-left: 1.8px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--transition-fast);
}

.button-link:hover::after,
.button-link:focus-visible::after,
.navigation-link:hover::after,
.navigation-link:focus-visible::after,
.navigation-back:hover::before,
.navigation-back:focus-visible::before,
.button-arrow:hover .icon-chevron,
.button-arrow:hover .icon-arrow,
.button-arrow:focus-visible .icon-chevron,
.button-arrow:focus-visible .icon-arrow {
  transform: translateX(3px) rotate(45deg);
}

.navigation-back:hover::before,
.navigation-back:focus-visible::before {
  transform: translateX(-3px) rotate(45deg);
}

/* Tailwind-based pages share the same type and forest palette. */
.font-normal {
  font-weight: var(--font-weight-regular);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.rounded-lg,
.rounded-xl {
  border-radius: var(--radius-md);
}

.rounded-2xl,
.rounded-3xl {
  border-radius: var(--radius-lg);
}

.text-slate-800,
.text-slate-900 {
  color: var(--color-text);
}

.text-slate-300,
.text-slate-400,
.text-slate-500,
.text-slate-600,
.text-slate-700 {
  color: var(--color-text-muted);
}

.text-blue-500,
.text-blue-600,
.text-blue-700,
.text-blue-800,
.text-indigo-500,
.text-indigo-600,
.text-indigo-700,
.text-indigo-800,
.text-purple-700 {
  color: var(--color-accent);
}

.text-red-500,
.text-red-600,
.text-red-700 {
  color: var(--color-error);
}

.bg-white {
  background-color: var(--color-surface);
}

.bg-slate-50 {
  background-color: var(--color-bg);
}

.bg-slate-100,
.bg-slate-200,
.bg-slate-300,
.bg-blue-50,
.bg-blue-100,
.bg-indigo-50,
.bg-indigo-100,
.bg-purple-50,
.bg-yellow-100 {
  background-color: var(--color-surface-soft);
}

.bg-blue-500,
.bg-blue-600,
.bg-indigo-600,
.bg-slate-700,
.bg-slate-800 {
  background-color: var(--color-accent);
}

.bg-yellow-400 {
  background-color: var(--color-accent-secondary);
}

.bg-red-50 {
  background-color: var(--color-error-soft);
}

.bg-red-500,
.bg-red-600 {
  background-color: var(--color-error);
}

.text-white {
  color: var(--color-on-accent);
}

.border-slate-50,
.border-slate-100,
.border-slate-200,
.border-slate-300,
.border-slate-400,
.border-blue-100,
.border-blue-200,
.border-indigo-50,
.border-indigo-100,
.border-indigo-200,
.border-purple-100,
.border-green-400 {
  border-color: var(--color-border);
}

.border-blue-500,
.border-indigo-500,
.border-indigo-600,
.border-slate-800 {
  border-color: var(--color-accent);
}

.border-red-100,
.border-red-200,
.border-red-300,
.border-red-400,
.border-red-500 {
  border-color: var(--color-error);
}

.glass-nav,
.glass-bottom {
  border-color: var(--color-border);
  background: var(--color-surface-glass);
}

.card-shadow,
.shadow-sm,
.shadow-md,
.shadow-lg,
.shadow-xl,
.shadow-2xl {
  --tw-shadow: var(--shadow-card);
  --tw-shadow-colored: var(--shadow-card);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}

.hover\:bg-blue-50:hover,
.hover\:bg-blue-100:hover,
.hover\:bg-indigo-50\/50:hover,
.hover\:bg-indigo-100:hover,
.hover\:bg-slate-50:hover,
.hover\:bg-slate-100:hover,
.hover\:bg-slate-300:hover {
  background-color: var(--color-surface-soft);
}

.hover\:bg-slate-700:hover,
.hover\:bg-slate-800:hover {
  background-color: var(--color-accent-strong);
}

.focus\:border-blue-500:focus,
.focus\:border-indigo-500:focus,
.focus-within\:border-blue-500:focus-within,
.focus-within\:border-indigo-500:focus-within {
  border-color: var(--color-accent);
}

.ring-blue-50,
.ring-blue-500,
.ring-indigo-50,
.ring-indigo-100,
.ring-indigo-200\/50,
.ring-indigo-600,
.focus\:ring-blue-50:focus,
.focus\:ring-indigo-50:focus,
.focus\:ring-indigo-100:focus,
.focus-within\:ring-blue-50:focus-within,
.focus-within\:ring-indigo-50:focus-within {
  --tw-ring-color: var(--color-focus-ring);
}

.choice-on,
.btn-selected,
.btn-type-selected,
.action-btn-on,
.tab-active {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-surface);
  box-shadow: none;
}

.choice-off,
.btn-unselected,
.action-btn-off,
.tab-inactive {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  box-shadow: none;
}

.suggest-chip,
.chip-active,
.chip-inactive {
  border-color: var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-accent-strong);
  font-weight: var(--font-weight-semibold);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    scroll-behavior: auto;
    transition-duration: 0.01ms;
  }
}
