/* ReptileManager · Botanical Boutique Design System (Phases 3-6 Shared Tokens) */
:root {
  /* Botanical Herbarium & Terrarium Forest Palette */
  --bg: #EFF1EC;
  --surface: #E2E7DF;
  --surface-deep: #D4DDD1;
  --paper: #F7F8F5;

  --forest: #13251B;
  --forest-surface: #1B3326;
  --forest-elev: #234131;

  --ink: #131D16;
  --muted: #415146;
  --ink-on-dark: #EFF2EC;
  --muted-on-dark: #B5C4B9;

  --accent: #195A3F;
  --accent-strong: #124630;
  --accent-ink: #EFF2EC;

  --amber-bg: #E6DFC8;
  --amber-ink: #4E380B;
  --danger-bg: #EAD8D5;
  --danger-ink: #641E16;

  /* Two-Face Korean Editorial Typography */
  --font-display: 'Gowun Batang', serif;
  --font-sans: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Strict 6-Step Type Scale (minimum 14px everywhere) */
  --step-display: clamp(2.1rem, 4.2vw, 3.85rem);
  --step-h2: clamp(1.65rem, 2.8vw, 2.5rem);
  --step-h3: clamp(1.25rem, 1.65vw, 1.5rem);
  --step-lead: clamp(1.125rem, 1.3vw, 1.25rem);
  --step-body: 1.0625rem;
  --step-small: 0.875rem;

  /* Unified Geometry */
  --radius: 8px;
  --gutter: clamp(1.25rem, 3.2vw, 2.75rem);
  --max-w: 1320px;

  /* Motion Choreography Tokens */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
  --t-reveal: 760ms;
  --t-open: 1050ms;
  --stagger-line: 95ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-body);
  overflow-x: clip;
  word-break: keep-all;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Rule 4: Anti-Clipping Flex Safety */
.row-safe {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.row-safe-main {
  flex: 1 1 auto;
  min-width: 0;
}

.row-safe-end {
  flex-shrink: 0;
}

/* Unified Frame & 12-Column Editorial Grid */
.wrap {
  width: min(var(--max-w), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2vw, 1.75rem);
  row-gap: 1.5rem;
}

/* Unified Button Shape */
.btn-boutique {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.75rem 1.35rem;
  border: 0;
  border-radius: var(--radius);
  background-color: var(--accent);
  color: var(--accent-ink);
  font-size: var(--step-body);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}

.btn-boutique:active {
  transform: scale(0.97);
}

.btn-boutique--surface {
  background-color: var(--surface);
  color: var(--ink);
}

.btn-boutique--paper {
  background-color: var(--bg);
  color: var(--ink);
}

.btn-boutique--forest {
  background-color: var(--forest-surface);
  color: var(--ink-on-dark);
}

@media (hover: hover) and (pointer: fine) {
  .btn-boutique:hover {
    background-color: var(--accent-strong);
  }
  .btn-boutique--surface:hover {
    background-color: var(--surface-deep);
  }
  .btn-boutique--paper:hover {
    background-color: var(--surface);
  }
  .btn-boutique--forest:hover {
    background-color: var(--forest-elev);
  }
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.24em;
  text-decoration-color: currentColor;
  transition: opacity var(--t-hover) ease;
}

@media (hover: hover) and (pointer: fine) {
  .text-link:hover {
    opacity: 0.76;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
