/* ============================================================
   The Mirror
   Design system components reimplemented as CSS, matched to
   _ds/.../_ds_bundle.js (Button, Badge, Input), plus the
   screens described in the build brief and README.
   ============================================================ */

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--obsidian);
  color: var(--text-primary);
}

body {
  background-image: var(--spotlight-gold);
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--gold-400); text-decoration: none; }
a:hover { color: var(--gold-200); }

textarea::placeholder, input::placeholder { color: var(--text-muted); opacity: 1; }

:focus-visible { outline: 2px solid var(--gold-600); outline-offset: 2px; }

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

/* ---------------------------------------------------------- shell */

.shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 36px 22px 110px;
}

.shell--wide { max-width: 1180px; }

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

/* Wordmark, with its reflection under it. */
.wordmark {
  display: grid;
  line-height: 1;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  justify-items: start;
}
.wordmark__face,
.wordmark__reflection {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: .02em;
}
.wordmark__reflection {
  transform: scaleY(-1);
  opacity: .35;
  margin-top: 2px;
  -webkit-mask-image: linear-gradient(to top, transparent 10%, #000 90%);
  mask-image: linear-gradient(to top, transparent 10%, #000 90%);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  padding-top: 6px;
}
.site-nav a {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-base) var(--ease-lux);
}
.site-nav a:hover { color: var(--text-secondary); }
.site-nav a[aria-current="page"] {
  color: var(--gold-300);
  border-bottom-color: var(--gold-a40);
}

/* ---------------------------------------------------------- type */

.eyebrow {
  font-family: var(--font-condensed);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 12px;
  color: var(--text-gold);
  margin-bottom: 14px;
}

h1, .h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: -.01em;
  margin: 0 0 30px;
}

h2, .h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.16;
  margin: 0 0 18px;
}

.script {
  font-family: var(--font-script);
  font-size: 38px;
  line-height: 1;
  color: var(--gold-300);
}

.prose {
  font-size: 21px;
  line-height: 1.55;
  display: grid;
  gap: 18px;
}
.prose p { margin: 0; }
.prose--secondary p { color: var(--text-secondary); }
.prose em { font-style: italic; }

.lede { font-size: 21px; line-height: 1.55; margin: 0; }
.sub { margin: 0 0 22px; font-size: 19px; line-height: 1.5; color: var(--text-secondary); }
.meta {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hairline { height: 1px; background: var(--gold-a24); border: 0; margin: 50px 0 26px; }
.hairline--tight { margin: 24px 0; }

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 30px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .16em;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              background var(--dur-base), color var(--dur-base),
              border-color var(--dur-base);
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primary {
  background: var(--gradient-gold);
  color: #2A2007;
  box-shadow: var(--sheen-top), var(--glow-gold-sm);
}
.btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--sheen-top), var(--glow-gold-md);
}
.btn--primary:active:not(:disabled) { transform: translateY(0) scale(.98); }

.btn--outline {
  background: transparent;
  color: var(--gold-400);
  border-color: var(--gold-a40);
}
.btn--outline:hover:not(:disabled) { background: var(--gold-a12); border-color: var(--gold-600); }
.btn--outline:active:not(:disabled) { transform: scale(.98); }

.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover:not(:disabled) { color: var(--ivory); }

.btn--sm { padding: 9px 18px; font-size: 12px; letter-spacing: .14em; gap: 8px; }

.btn-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.text-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-gold);
}
.text-btn:hover { color: var(--gold-200); }

/* ---------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  background: var(--gold-a12);
  color: var(--gold-300);
  border: 1px solid var(--gold-a24);
}
.badge--emerald {
  background: rgba(52, 209, 127, .12);
  color: var(--emerald-400);
  border-color: rgba(52, 209, 127, .28);
}
.badge--terracotta {
  background: rgba(193, 119, 103, .14);
  color: var(--rose);
  border-color: rgba(193, 119, 103, .3);
}

/* ---------------------------------------------------------- fields */

.field { width: 100%; }
.field + .field { margin-top: 22px; }

.field__label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-secondary);
}

.field__helper {
  margin: 0 0 8px;
  font-size: 17px;
  font-style: italic;
  color: var(--text-secondary);
}

.input,
.textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ivory);
  background: var(--surface-input);
  border: 1px solid var(--charcoal-500);
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  outline: none;
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
}
.input:focus, .textarea:focus {
  border-color: var(--gold-600);
  box-shadow: 0 0 0 3px var(--gold-a24);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--terracotta); }

/* Long answers are read as prose, so they are set in the serif. */
.textarea {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.5;
  min-height: 220px;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  resize: vertical;
}
.textarea--journal { min-height: 180px; }
.textarea--short { min-height: 150px; }

.error {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--rose);
  margin: 16px 0 0;
}

.saved-flash {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-lux);
}
.saved-flash.is-on { opacity: 1; }

/* Pills: the 0-10 placement scale, the emotions, the two-way choices. */
.pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 10px;
}
.pills--wide { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

.pill {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  padding: 13px 10px;
  border-radius: var(--radius-pill);
  background: var(--charcoal-700);
  color: var(--text-secondary);
  border: 1px solid var(--charcoal-500);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-lux),
              color var(--dur-base), border-color var(--dur-base),
              transform var(--dur-fast) var(--ease-out);
}
.pill:hover { border-color: var(--gold-a40); color: var(--ivory); }
.pill[aria-pressed="true"] {
  background: var(--gradient-gold);
  color: #2A2007;
  border-color: transparent;
  box-shadow: var(--sheen-top), var(--glow-gold-sm);
}

/* ---------------------------------------------------------- cards */

.card {
  background: var(--surface-card);
  border: 1px solid var(--gold-a24);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.card--plain { border-color: var(--charcoal-500); }

.note {
  font-size: 19px;
  line-height: 1.55;
  border-left: 1px solid var(--gold-a40);
  padding: 14px 18px;
  margin: 20px 0 0;
  color: var(--text-secondary);
}

.nudge {
  background: var(--charcoal-800);
  border: 1px solid var(--gold-a24);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 16px;
  display: grid;
  gap: 12px;
  justify-items: start;
}
.nudge p { margin: 0; font-size: 19px; line-height: 1.5; }

/* ---------------------------------------------------------- home */

.hero {
  position: relative;
  height: 340px;
  margin: -10px 0 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gold-a24);
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(10, 9, 8, .1) 0%, transparent 30%,
    rgba(10, 9, 8, .55) 65%, rgba(10, 9, 8, .92) 100%);
}
.hero__wordmark {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 14px;
  pointer-events: none;
  display: grid;
  line-height: 1;
}
.hero__wordmark .wordmark__face,
.hero__wordmark .wordmark__reflection { font-size: 44px; }
.hero__wordmark .wordmark__reflection {
  opacity: .3;
  margin-top: 3px;
  -webkit-mask-image: linear-gradient(to top, transparent 15%, #000 95%);
  mask-image: linear-gradient(to top, transparent 15%, #000 95%);
}

.status-rows { display: grid; gap: 16px; }
.status-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.status-row__label {
  font-family: var(--font-serif);
  font-size: 21px;
  color: var(--ivory);
  transition: color var(--dur-base) var(--ease-lux);
}
.status-row:hover .status-row__label { color: var(--gold-200); }
.status-row__status { white-space: nowrap; }

/* ---------------------------------------------------------- journal */

.entry-list { display: grid; gap: 28px; }
.entry { display: grid; gap: 8px; }
.entry__text { font-size: 21px; line-height: 1.55; margin: 0; white-space: pre-wrap; }

.logged { font-size: 22px; margin: 0 0 26px; }

/* ---------------------------------------------------------- witnesses */

.link-box {
  background: var(--charcoal-800);
  border: 1px solid var(--gold-a24);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 28px 0 18px;
}
.link-box__url {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ivory);
  word-break: break-all;
}

.share-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------- your chats */

.prompt-block {
  background: var(--charcoal-800);
  border: 1px solid var(--gold-a24);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 0;
  max-height: 440px;
  overflow: auto;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ivory);
  white-space: pre-wrap;
  word-break: break-word;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 44px 0 14px;
}
.section-head h2 { margin: 0; font-size: 26px; }

.helper-sans {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 12px 0 0;
}

.dropzone {
  border: 1px dashed var(--gold-a40);
  border-radius: var(--radius-md);
  padding: 34px 22px;
  text-align: center;
  cursor: pointer;
  background: transparent;
  width: 100%;
  color: var(--ivory);
  transition: background var(--dur-base) var(--ease-lux), border-color var(--dur-base);
}
.dropzone:hover, .dropzone.is-over { background: var(--gold-a12); border-color: var(--gold-600); }
.dropzone__main { font-size: 21px; line-height: 1.4; margin: 0 0 6px; }
.dropzone__sub { font-family: var(--font-sans); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 0; }

.file-list { display: grid; gap: 14px; margin-top: 22px; }
.file-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  border-bottom: 1px solid var(--charcoal-500);
  padding-bottom: 12px;
}
.file-row__name { font-size: 19px; word-break: break-all; }

/* ---------------------------------------------------------- record control */

.record {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}
.record__button {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  border: 1px solid var(--gold-a40);
  background: var(--gradient-gold);
  cursor: pointer;
  transition: box-shadow var(--dur-base) var(--ease-lux), background var(--dur-base);
}
.record__button.is-recording {
  background: var(--terracotta);
  box-shadow: 0 0 0 6px rgba(193, 119, 103, .22);
}
.record__label { font-size: 19px; color: var(--text-secondary); }

/* ---------------------------------------------------------- read-back */

.readback-columns { display: grid; gap: 32px; }
@media (min-width: 600px) {
  .readback-columns { grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
  .readback-columns__entries {
    border-left: 1px solid var(--gold-a40);
    padding-left: 28px;
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* ---------------------------------------------------------- reflection */

.gap { margin-top: 56px; }
.gap:first-of-type { margin-top: 40px; }
.gap h2 { margin-bottom: 18px; }

/* Quotes and readings must be visually distinct at a glance. */
.evidence { margin: 0 0 16px; }
.evidence__meta { margin-bottom: 6px; }
.evidence--quote .evidence__body {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.5;
  background: var(--charcoal-800);
  border-left: 2px solid var(--gold-600);
  padding: 14px 18px;
  margin: 0;
  white-space: pre-wrap;
}
.evidence--record .evidence__body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  border-left: 2px solid var(--charcoal-500);
  padding: 10px 18px;
  margin: 0;
}

.reading { margin: 22px 0 0; }
.reading__text {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.gap-question {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 24px;
  line-height: 1.4;
  margin: 24px 0 0;
}

.round { margin-top: 18px; display: grid; gap: 12px; }
.round__label { margin-bottom: 6px; }
.round__wrote { font-size: 21px; line-height: 1.55; margin: 0; white-space: pre-wrap; }
.round__response {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  border-left: 2px solid var(--charcoal-500);
  padding: 8px 18px;
}

.no-gap {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.pattern-cards { display: grid; gap: 14px; margin-bottom: 30px; }
.pattern-card {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--charcoal-800);
  border: 1px solid var(--charcoal-500);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 0;
}

.steps {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  margin: 18px 0 0;
  padding-left: 22px;
}
.steps li { margin-bottom: 6px; }

/* ---------------------------------------------------------- admin */

.admin-meta { font-family: var(--font-sans); font-size: 13px; color: var(--text-muted); }

.order-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 6px 0 26px;
}
.order-strip__step.is-current { color: var(--gold-400); }
.order-strip__step.is-done { text-decoration: line-through; color: var(--text-muted); }

.gate {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 34px;
}
.gate__title { font-family: var(--font-display); font-size: 22px; margin: 0 0 4px; }
.gate__status { font-family: var(--font-sans); font-size: 14px; color: var(--text-secondary); margin: 0; }

.banner {
  border: 1px solid var(--terracotta);
  background: rgba(193, 119, 103, .10);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--rose-200);
  margin-bottom: 22px;
}

.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.feed-card { display: grid; gap: 10px; }
.feed-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.feed-card__name { font-family: var(--font-display); font-size: 20px; margin: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-family: var(--font-sans); font-size: 13px; }
.kv dt { color: var(--text-muted); margin: 0; }
.kv dd { margin: 0; color: var(--ivory); }
.kv dd.is-stale { color: var(--rose); }

.table-wrap { overflow-x: auto; margin-top: 18px; }
.table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: 13px; }
.table th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--charcoal-500); color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--charcoal-700); vertical-align: top; }
.table td.quote { font-family: var(--font-serif); font-size: 16px; line-height: 1.45; min-width: 320px; }

.queue-card { display: grid; gap: 12px; }
.queue-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.queue-card__text { font-family: var(--font-serif); font-size: 18px; line-height: 1.45; margin: 0; }
.queue-card__why { font-family: var(--font-sans); font-size: 13px; color: var(--text-secondary); margin: 0; }
.queue-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.select {
  font-family: var(--font-sans); font-size: 13px; color: var(--ivory);
  background: var(--surface-input); border: 1px solid var(--charcoal-500);
  border-radius: var(--radius-pill); padding: 9px 14px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-sans); font-size: 12px; letter-spacing: .04em;
  background: var(--charcoal-700); border: 1px solid var(--charcoal-500);
  border-radius: var(--radius-pill); padding: 6px 12px; color: var(--text-secondary);
}
.chip--gold { border-color: var(--gold-a40); color: var(--gold-300); }

.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 30px; }
.stat-tile__value { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1; letter-spacing: -.02em; }
.stat-tile__label { font-family: var(--font-sans); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; color: var(--text-secondary); margin-top: 10px; line-height: 1.5; }

.admin-grid { display: grid; gap: 22px; }
.identity-card { display: grid; gap: 10px; }
.identity-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.identity-card__name { font-family: var(--font-display); font-size: 20px; margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form .input { width: auto; min-width: 220px; }

/* ---------------------------------------------------------- misc */

.stack { display: grid; gap: 22px; }
.stack--tight { gap: 12px; }

.centre-note {
  max-width: 460px;
  margin: 12vh auto;
}

.screen { animation: rise var(--dur-slow) var(--ease-lux) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

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

@media (max-width: 560px) {
  h1, .h1 { font-size: 32px; }
  h2, .h2 { font-size: 26px; }
  .script { font-size: 32px; }
  .hero { height: 260px; }
  .hero__wordmark .wordmark__face,
  .hero__wordmark .wordmark__reflection { font-size: 34px; }
  .prose, .lede, .status-row__label, .entry__text { font-size: 19px; }
}
