/* ============================================================
   KCM Experience Guide — design tokens + base
   Mobile-first. No build step. Outdoor-readable by default.
   ============================================================ */

:root {
  /* Brass → teal is the experience's signature pair: brass is the
     "line up" state, teal is the "locked" state. Used in the portal
     and echoed here so the hub and portal read as one product. */
  --brass:        #b08d57;
  --brass-bright: #d4ab6a;
  --brass-deep:   #8a6d3f;
  --teal:         #2a9d8f;
  --teal-deep:    #1b7f72;

  --ink:          #1c1815;
  --ink-2:        #4a423a;
  --ink-3:        #776c60;
  --paper:        #f7f2e8;
  --paper-2:      #efe7d8;
  --paper-3:      #e4d9c4;
  --card:         #fffdf8;
  --line:         #ddd0b8;

  --danger:       #a4462c;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(28, 24, 21, .06), 0 2px 6px rgba(28, 24, 21, .05);
  --shadow:    0 2px 6px rgba(28, 24, 21, .07), 0 8px 24px rgba(28, 24, 21, .08);
  --shadow-lg: 0 8px 20px rgba(28, 24, 21, .12), 0 24px 60px rgba(28, 24, 21, .16);

  --font-display: ui-serif, Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);

  --gutter: 20px;
  --tap: 44px; /* minimum touch target */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:     #f3ece1;
    --ink-2:   #c4b8a8;
    --ink-3:   #91856f;
    --paper:   #16130f;
    --paper-2: #201b16;
    --paper-3: #2b241d;
    --card:    #221d17;
    --line:    #3a3128;

    --brass:        #d4ab6a;
    --brass-bright: #ecc98d;
    --brass-deep:   #b08d57;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow:    0 2px 8px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
  }
}

:root[data-theme="dark"] {
  --ink:     #f3ece1;
  --ink-2:   #c4b8a8;
  --ink-3:   #91856f;
  --paper:   #16130f;
  --paper-2: #201b16;
  --paper-3: #2b241d;
  --card:    #221d17;
  --line:    #3a3128;

  --brass:        #d4ab6a;
  --brass-bright: #ecc98d;
  --brass-deep:   #b08d57;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow:    0 2px 8px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

/* ---------- Shared primitives ---------- */

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass-deep);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none; /* .btn is used on <a> as well as <button> */
  transition: transform .18s ease, background-color .18s ease, opacity .18s ease;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }

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

.btn-portal {
  background: linear-gradient(135deg, var(--brass-deep), var(--brass));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  color: var(--ink);
  transition: background-color .18s ease;
}
.icon-btn:active { background: var(--paper-3); }
.icon-btn svg { width: 22px; height: 22px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.badge-portal {
  background: color-mix(in srgb, var(--teal) 16%, transparent);
  color: var(--teal-deep);
}
.badge-soon {
  background: var(--paper-3);
  color: var(--ink-3);
}
