:root {
  --night: #0f1b3d;
  --night-2: #1d2f63;
  --gold: #f2c14e;
  --gold-2: #e0a92c;
  --gold-ink: #8a5a00;
  --red: #b3261e;
  --green: #1f6f4a;
  --paper-bg: #f7f2e8;
  --paper: #ffffff;
  --ink: #1b1d22;
  --muted: #59606d;
  --line: #e6dfcf;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 27, 61, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--night-2); }
h1, h2 { font-family: Fraunces, Georgia, serif; line-height: 1.15; color: var(--night); }
h1 { font-size: clamp(1.8rem, 4.4vw, 3rem); margin: 0.15em 0 0.3em; }
h2 { font-size: clamp(1.2rem, 2.2vw, 1.55rem); margin: 0 0 0.6em; }

/* Night sky band behind the header and the hero: a few CSS stars, no images. */
.night {
  background:
    radial-gradient(1.5px 1.5px at 12% 30%, rgba(255, 255, 255, 0.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 28% 70%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(2px 2px at 46% 22%, rgba(255, 236, 180, 0.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 63% 58%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(2.5px 2.5px at 82% 26%, rgba(255, 226, 150, 0.95), transparent 60%),
    radial-gradient(1.5px 1.5px at 92% 72%, rgba(255, 255, 255, 0.55), transparent 60%),
    linear-gradient(180deg, #0b1430 0%, var(--night) 55%, var(--night-2) 100%);
  color: #fff;
  padding-bottom: 54px;
  margin-bottom: -38px;
}
.night h1 { color: #fff; }
.night .lead { color: rgba(255, 255, 255, 0.86); }

.top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  max-width: 1120px; margin: 0 auto; padding: 14px 16px 6px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 1.1rem; color: #fff; text-decoration: none; }
/* Brand mark: the star the Kings followed. */
.brand-mark { width: 20px; height: 20px; display: inline-block; background: var(--gold); clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); }
.top-cta { font-weight: 600; text-decoration: none; color: var(--gold); }

/* The tool is on the first screen: the hero is three short lines, nothing more. */
.hero { max-width: 1120px; margin: 0 auto; padding: 8px 16px 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; font-weight: 600; color: var(--gold); margin: 0; }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 48em; margin: 0; }
.fine { font-size: 0.85rem; color: var(--muted); margin: 0.6em 0 0; }
.fine-inline { font-size: 0.82rem; color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  font: inherit; font-weight: 600; border: 0; border-radius: 999px; cursor: pointer;
  padding: 12px 22px; text-decoration: none; transition: transform 0.08s ease, background 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--gold); color: var(--night); box-shadow: 0 2px 0 var(--gold-2); }
.btn-primary:hover { background: var(--gold-2); }
.btn-ghost { background: transparent; color: var(--night); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--night-2); }
.btn-lg { padding: 15px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-block.btn-ghost { margin-top: 10px; }
.btn-mini { font: inherit; font-size: 0.85rem; font-weight: 600; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--night); cursor: pointer; }
.btn-mini:hover { border-color: var(--night-2); }

.maker {
  position: relative;
  max-width: 1120px; margin: 0 auto; padding: 0 16px 52px;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start;
}
.card-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; }

/* Photo picker */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.photo-box { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: start; margin: 0 0 22px; }
.photo-pick { display: grid; place-items: center; aspect-ratio: 1; border: 2px dashed var(--gold-2); border-radius: 14px; background: var(--paper-bg); cursor: pointer; text-align: center; overflow: hidden; color: var(--muted); font-size: 0.82rem; line-height: 1.35; padding: 10px; }
.photo-pick:hover, #photoInput:focus-visible + .photo-pick { border-color: var(--night); }
.photo-pick strong { display: block; color: var(--gold-ink); font-size: 1rem; margin-bottom: 4px; }
.photo-pick.has-photo { border-style: solid; border-color: var(--green); padding: 0; }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick img[hidden], .photo-pick span[hidden] { display: none; }
.photo-side .fine:first-child { margin-top: 0; }
.photo-side .fine strong { color: var(--ink); }
.photo-side .btn-mini { margin-top: 10px; }

/* Style picker */
.styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.style {
  position: relative; border: 2px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden;
  background: var(--paper-bg); cursor: pointer; text-align: left; font: inherit; color: inherit; min-width: 0;
}
.style img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.style-label { display: block; padding: 6px 8px 0; font-size: 0.86rem; font-weight: 600; line-height: 1.25; color: var(--night); }
.style-note { display: block; padding: 2px 8px 8px; font-size: 0.74rem; line-height: 1.3; color: var(--muted); }
.style[aria-checked="true"] { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.35); }
.style[aria-checked="true"]::after {
  content: "✓"; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); color: var(--night); display: grid; place-items: center; font-size: 0.8rem; font-weight: 700;
}
.style:focus-visible { outline: 3px solid var(--night-2); outline-offset: 2px; }

/* Camel switch */
.camel { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-bg); margin: 0 0 18px; cursor: pointer; font-size: 0.95rem; line-height: 1.4; }
.camel input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--gold-2); }
.camel strong { color: var(--night); }

.form-error { color: var(--red); font-weight: 600; margin: 0 0 12px; }

/* Turnstile widget: invisible unless Cloudflare asks for a click. */
.human-check:empty { display: none; }
.human-check { display: flex; justify-content: center; margin: 0 0 0.8em; }

/* Result panel */
.maker-result { position: sticky; top: 16px; text-align: center; }
.result-title { margin-bottom: 0.5em; }
.spinner { width: 44px; height: 44px; margin: 8px auto 12px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--gold-2); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 10px; border-radius: 999px; background: var(--paper-bg); border: 1px solid var(--line); overflow: hidden; margin: 14px 0 6px; }
.bar-fill { height: 100%; width: 2%; background: linear-gradient(90deg, var(--night-2), var(--gold-2)); transition: width 0.8s ease; }
.actions { margin-top: 14px; }
.paid-note { font-weight: 600; color: var(--green); margin: 0 0 10px; }
#previewBox .fine[hidden] { display: none; }

/* Before/after slider: two stacked pictures, the top one clipped at --pos. A real range input lies over the
   whole picture, so dragging, touch and the arrow keys all work without custom pointer code. */
.cmp { position: relative; width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--paper-bg); user-select: none; -webkit-user-select: none; }
.cmp-landscape { aspect-ratio: 3 / 2; }
.cmp-portrait { aspect-ratio: 2 / 3; }
.cmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cmp .cmp-after { clip-path: inset(0 0 0 var(--pos)); }
.cmp-tag { position: absolute; bottom: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(15, 27, 61, 0.82); color: #fff; font-size: 0.74rem; font-weight: 600; pointer-events: none; }
.cmp-tag-before { left: 10px; }
.cmp-tag-after { right: 10px; }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(15, 27, 61, 0.25); pointer-events: none; }
.cmp-knob { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(15, 27, 61, 0.35); display: grid; place-items: center; color: var(--night); font-size: 1rem; font-weight: 700; }
.cmp-knob::before { content: "↔"; }
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; -webkit-appearance: none; appearance: none; }
.cmp-range:focus-visible ~ .cmp-line .cmp-knob { outline: 3px solid var(--gold-2); outline-offset: 2px; }
.cmp.is-single .cmp-before, .cmp.is-single .cmp-line, .cmp.is-single .cmp-range, .cmp.is-single .cmp-tag { display: none; }
.cmp.is-single .cmp-after { clip-path: none; }

/* Content sections */
.how, .examples, .faq, .tips, .style-links, .page-intro { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 0; margin: 0; list-style: none; counter-reset: s; }
.steps li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 58px; position: relative; counter-increment: s; }
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--night); color: var(--gold); display: grid; place-items: center; font-weight: 700;
}
.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pair { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 0; }
.pair-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.pair-imgs img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.pair figcaption { padding: 8px 12px; font-size: 0.88rem; font-weight: 600; color: var(--night); }
#examplesNote { margin-top: 12px; }
.style-links ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.style-links a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--night); text-decoration: none; font-size: 0.92rem; background: var(--paper); }
.style-links a:hover { border-color: var(--night-2); }
.tips ul { margin: 0; padding-left: 1.2em; color: var(--ink); }
.tips li { margin-bottom: 4px; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--night); }
.faq p { margin: 10px 0 2px; color: var(--muted); }

/* Landing pages: the page's own text with its sample beside it */
.page-intro { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.page-intro-text h2 { margin-top: 1.2em; }
.page-intro-text h2:first-child { margin-top: 0; }
.page-intro-text p, .page-intro-text li { color: var(--muted); line-height: 1.65; }
.page-intro-text ul { padding-left: 1.2em; margin: 0; }
.page-sample { margin: 0; position: sticky; top: 16px; min-width: 0; }
.page-sample figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 8px; }

.foot { text-align: center; padding: 28px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); }
.foot a { color: var(--muted); }

/* Legal pages and the 404 page use a plain header on the night band. */
.legal { max-width: 760px; margin: 0 auto; padding: 24px 16px 56px; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.2rem; margin-top: 1.6em; }
.notfound { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; text-align: center; }
.notfound h1 { font-size: clamp(1.5rem, 5vw, 2.1rem); }
.night-slim { padding-bottom: 6px; margin-bottom: 0; }

@media (max-width: 900px) {
  .maker { grid-template-columns: minmax(0, 1fr); }
  .maker-result { position: static; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .pairs { grid-template-columns: minmax(0, 1fr); }
  .page-intro { grid-template-columns: minmax(0, 1fr); }
  .page-sample { position: static; max-width: 560px; }
}
@media (max-width: 520px) {
  .night { padding-bottom: 46px; }
  .lead { font-size: 0.98rem; }
  .card-panel { padding: 16px; }
  .photo-box { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; margin-bottom: 18px; }
  .styles { gap: 6px; }
  .style-label { font-size: 0.8rem; padding: 5px 6px 0; }
  .style-note { font-size: 0.7rem; padding: 2px 6px 7px; }
  .btn-lg { padding: 14px 18px; font-size: 1rem; }
  .top-cta { display: none; }
}
