/* Link to QR — CCNDR brand tokens (see CCNDR-Digital-Brand-and-Divi-Design-System-Guide.md) */

@font-face {
  font-family: "Space Grotesk";
  font-weight: 700;
  font-display: swap;
  src: url("fonts/SpaceGrotesk-Bold.ttf") format("truetype");
}

:root {
  --midnight: #2B2033;
  --deep: #4C2D61;
  --bright: #8951A1;
  --orange-dark: #E16E26;
  --orange: #F0852E;
  --beige-dark: #E1DBD3;
  --beige-light: #F6F6F6;
  --tint-10: #F3EDF6;
  --tint-20: #E7DCED;
  --muted: #5A5160;
  --hair: rgba(43, 32, 51, 0.12);
  --font-heading: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--beige-light);
  color: var(--midnight);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

/* ---------- top bar ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--hair);
}
.logo { display: block; height: 40px; width: auto; max-width: 70%; }
.tag {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--deep);
  background: var(--tint-10);
  border-radius: 9999px;
  padding: 6px 12px;
}
@media (max-width: 480px) {
  .logo { height: 30px; }
  .tag { font-size: 10.5px; letter-spacing: 0.06em; padding: 5px 9px; }
}

/* ---------- layout ---------- */
.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 16px 40px;
  display: grid;
  gap: 16px;
}
@media (min-width: 860px) {
  .wrap { grid-template-columns: 1.05fr 1fr; gap: 24px; padding: 40px 24px 56px; align-items: start; }
  .privacy { grid-column: 1 / -1; }
}

.panel {
  border-radius: 20px;
  padding: 24px 20px;
}
@media (min-width: 480px) { .panel { padding: 32px; } }

/* ---------- intro (dark showcase panel) ---------- */
.intro {
  background: linear-gradient(135deg, var(--midnight) 0%, var(--deep) 100%);
  color: #fff;
}
.accent-bar {
  width: 64px;
  height: 5px;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--bright), var(--orange));
  margin-bottom: 14px;
}
.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
}
h1 {
  margin: 8px 0 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.lead {
  margin: 12px 0 0;
  font-size: 17px;
  color: var(--beige-dark);
  text-wrap: pretty;
}

form { margin-top: 24px; }
label[for="link"] { display: block; font-weight: 600; margin-bottom: 8px; }
.input-row { display: flex; gap: 8px; }
#link {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 17px;            /* 16px+ stops iOS zooming in on focus */
  color: var(--midnight);
  background: #fff;
  border: 2px solid #fff;
  border-radius: 12px;
  padding: 12px 14px;
}
#link::placeholder { color: #8C8492; }
#link:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.hint, .error {
  margin: 10px 0 0;
  font-size: 15px;
  border-radius: 10px;
  padding: 10px 12px;
}
.hint { background: rgba(255, 255, 255, 0.1); color: var(--beige-dark); }
.error { background: rgba(240, 133, 46, 0.16); box-shadow: inset 4px 0 0 var(--orange); color: #fff; }

/* on/off switches (a real checkbox underneath, so keyboards and screen readers work) */
.switch {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--beige-dark);
  cursor: pointer;
}
.switch input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  margin: 0;
}
.switch .track {
  flex: none;
  position: relative;
  width: 40px; height: 24px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(225, 219, 211, 0.45);
  transition: background-color 150ms ease, border-color 150ms ease;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 150ms ease;
}
.switch input:checked + .track { background: var(--orange); border-color: var(--orange); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid var(--orange); outline-offset: 2px; }
.switch code { font-family: var(--font-mono); font-size: 13px; }
.switch small { display: block; margin-top: 2px; font-size: 13px; color: rgba(225, 219, 211, 0.75); }
@media (prefers-reduced-motion: reduce) {
  .switch .track, .switch .track::after { transition: none; }
}

/* ---------- buttons ---------- */
.btn {
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.btn-primary { background: var(--deep); color: #fff; }
.btn-primary:hover { background: var(--bright); }
.btn-on-dark {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(225, 219, 211, 0.35);
  flex: none;
}
.btn-on-dark:hover { background: rgba(255, 255, 255, 0.18); }
.btn-wide { width: 100%; margin-top: 24px; }

/* ---------- result ---------- */
.result {
  background: #fff;
  border: 1px solid var(--hair);
  box-shadow: 0 2px 10px rgba(43, 32, 51, 0.08);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.empty { color: var(--muted); }
.empty p { margin: 12px 0 0; }
.empty-icon {
  width: 64px; height: 64px;
  fill: none; stroke: var(--bright); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.out { display: flex; flex-direction: column; align-items: center; width: 100%; }
.qr-tile {
  width: min(100%, 340px);
  background: #fff;
  border: 5px solid var(--orange);
  border-radius: 20px;
  padding: 8px;
  line-height: 0;
}
.qr-tile svg, .qr-big svg { display: block; width: 100%; height: auto; }
.opens {
  margin: 18px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bright);
}
.url {
  margin: 6px 0 0;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  color: var(--midnight);
  background: var(--tint-10);
  border-radius: 10px;
  padding: 8px 12px;
}
.size {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  border-radius: 14px;
  padding: 7px 14px;
}
.size[data-state="ok"] { background: var(--tint-10); color: var(--deep); }
.size[data-state="bad"] { background: var(--orange); color: var(--midnight); }
.note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
#bigger { margin-top: 18px; }

.privacy { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }

/* ---------- full-screen QR ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
}
.qr-big { width: min(88vw, 70vh); }
.overlay .url { max-width: min(88vw, 640px); text-align: center; }
