/* ─── Coldcaked foundations: variables, typography, nav, buttons ─────── */

:root {
  --bg: #F4F0E8;
  --ink: #0A0A0A;
  --pink: #FF2D2D;
  --pink-shadow: #C81E1E;
  --tape: rgba(255, 232, 138, 0.55);
  --tape-edge: rgba(180, 152, 60, 0.35);
  --muted: #6B6358;
  --page-gutter: max(48px, min(9.5vw, 128px));
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,0.025) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 { font-family: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif; font-size: clamp(32px, 4.5vw, 56px); line-height: 1.1; font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: clamp(24px, 3vw, 36px); line-height: 1.15; }
h3 { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.2; }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--pink-shadow); }

.accent {
  font-family: 'Caveat', cursive;
  color: var(--pink-shadow);
  font-weight: 700;
  font-size: 1.25em;
}

/* ─── Page shell ────────────────────────────────────────────── */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px var(--page-gutter) 64px;
}

.page--narrow {
  max-width: 760px;
}

/* Shared page-gutter wrapper — apps/vc defines its own richer .wrap in
   apps/vc/styles/main.css; this rule exists so the cross-app shell
   (landing, admin-vc-orders) still gets gutter padding when only the
   shared stylesheet is loaded. */
.wrap {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--page-gutter);
  position: relative;
}

/* ─── Top nav ───────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.nav__brand {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.nav__brand .accent { font-size: 1.1em; }

.nav__links {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.nav__link {
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav__link:hover {
  border-color: var(--ink);
  background: rgba(255,255,255,0.5);
}

.nav__link.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--pink);
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  border: 1.5px solid var(--ink);
}

.nav__badge[hidden] { display: none; }

#user-button-mount {
  display: inline-flex;
  align-items: center;
}

/* ─── Buttons ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--pink);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-primary:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.btn-primary:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn-secondary {
  background: var(--white);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg);
}

.btn-danger {
  background: #FFE0E0;
  border-color: #6E1818;
  color: #6E1818;
}

.btn-action--accept {
  background: var(--ink);
  color: var(--bg);
  box-shadow: 3px 3px 0 var(--pink);
}

.btn-action--accept:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--pink);
}

.btn-action--accept:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--pink);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.5);
}

/* ─── Forms ─────────────────────────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field__label {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.field__hint {
  font-size: 13px;
  color: var(--muted);
}

.input,
.select,
.textarea {
  font-family: inherit;
  font-size: 16px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  width: 100%;
  transition: box-shadow 100ms ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  box-shadow: 3px 3px 0 var(--pink);
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .row { grid-template-columns: 1fr; }
}

/* ─── Cards ─────────────────────────────────────────────────── */

.card {
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 4px 4px 0 var(--ink);
}

/* ─── Auth states ───────────────────────────────────────────── */

[data-auth-only="signed-in"] { display: none; }
[data-auth-only="signed-out"] { display: none; }

body.clerk-loaded[data-clerk="signed-in"] [data-auth-only="signed-in"] { display: revert; }
body.clerk-loaded[data-clerk="signed-out"] [data-auth-only="signed-out"] { display: revert; }

/* ─── Auth gate ─────────────────────────────────────────────── */

.auth-gate {
  max-width: 520px;
  margin: 60px auto 0;
  text-align: center;
  padding: 40px 32px;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink);
  position: relative;
}

.auth-gate__eyebrow {
  font-family: 'Caveat', cursive;
  color: var(--pink-shadow);
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 8px;
}

.auth-gate__title {
  font-family: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  line-height: 1.1;
}

.auth-gate__body {
  color: var(--muted);
  margin: 0 0 24px;
}

.auth-gate__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.auth-gate__returning {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted, #6B6358);
  text-align: center;
}
.auth-gate__returning button {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 0 4px;
  color: var(--ink, #0A0A0A);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.auth-gate__returning button:hover { color: var(--pink, #FF2D2D); }

/* ─── No-access card ────────────────────────────────────────── */

.no-access {
  max-width: 600px;
  margin: 60px auto 0;
  padding: 36px 32px;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink);
}

.no-access__eyebrow {
  font-family: 'Caveat', cursive;
  color: var(--pink-shadow);
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 8px;
}

.no-access__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 8px;
}

.no-access__body { color: var(--muted); margin: 0 0 16px; }

.signed-in-as {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

/* ─── Error card ────────────────────────────────────────────── */

.error-card {
  max-width: 540px;
  margin: 48px auto;
  padding: 24px;
  background: #FFE0E0;
  border: 1.5px solid #6E1818;
  border-radius: 14px;
  color: #6E1818;
}

.error-card__title { font-family: 'Fraunces', Georgia, serif; font-size: 20px; margin: 0 0 6px; }

/* ─── Misc helpers ──────────────────────────────────────────── */

[hidden] { display: none !important; }

.muted { color: var(--muted); }
.center { text-align: center; }

.eyebrow {
  font-family: 'Caveat', cursive;
  color: var(--pink-shadow);
  font-weight: 700;
  font-size: 22px;
  display: inline-block;
  margin-bottom: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--ink);
  background: var(--bg);
}

.pill--pink { background: var(--pink); }
.pill--ink { background: var(--ink); color: var(--bg); }

/* ─── Unified site nav (Daymaker) ─────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0 8px;
  border-bottom: 1px dashed var(--ink, #0A0A0A);
  font-size: 15px;
}
.site-nav__brand {
  font-family: Fraunces, Georgia, serif;
  font-size: 22px;
  text-decoration: none;
  color: var(--ink, #0A0A0A);
}
.site-nav__links {
  display: flex;
  gap: 20px;
}
.site-nav__links a {
  text-decoration: none;
  color: var(--ink, #0A0A0A);
  font-weight: 600;
}
.site-nav__links a:hover {
  color: var(--accent, #FF2D2D);
}
.site-nav__auth {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted, #6B6358);
}
.site-nav__signin {
  font: inherit;
  font-weight: 600;
  color: var(--ink, #0A0A0A);
  background: transparent;
  border: 1.5px solid var(--ink, #0A0A0A);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.site-nav__signin:hover {
  background: var(--ink, #0A0A0A);
  color: var(--bg, #F4F0E8);
}
/* Hide sign-in CTA once Clerk reports signed-in; show user-button only. */
body.clerk-signed-in .site-nav__signin { display: none; }
body.clerk-signed-out #user-button-mount { display: none; }
