:root {
  /* O.B. Designs brand: four colours plus white, never tinted (creative/brand/BRAND.md). */
  --peach: #FEB993;
  --sage: #779D91;
  --brown: #5E4E3B;
  --grey: #C9C4BE;
  --white: #FFFFFF;
  /* Functional only: form error messages. */
  --error: #A3402A;
  --radius: 18px;
  --font: "Jost", Futura, "Century Gothic", "Trebuchet MS", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--brown);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
}
/* Sage on white is under 3:1, so body links stay brown with a sage underline. */
a { color: var(--brown); text-decoration-color: var(--sage); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--brown); text-decoration-color: var(--brown); }

.page { max-width: 680px; margin: 0 auto; padding: 20px 16px 48px; }

.hero {
  background: var(--sage);
  color: var(--white);
  border-radius: var(--radius);
  padding: 22px 22px 26px;
  text-align: center;
  position: relative;
}
.logo {
  display: block;
  width: 96px;
  height: auto;
  margin: 0 auto 14px;
  background: var(--white);
  border-radius: 14px;
  padding: 10px 12px;
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  /* White on sage (peach on sage is illegible). */
  color: var(--white);
}
h1 {
  font-family: var(--font);
  font-weight: 500;
  font-size: clamp(32px, 8vw, 50px);
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}
/* Emphasis on sage: white with a peach underline. */
h1 em { font-style: normal; display: block; color: var(--white); text-decoration: underline; text-decoration-color: var(--peach); text-decoration-thickness: .07em; text-underline-offset: .14em; text-decoration-skip-ink: none; }
/* Links on sage: white, underlined. */
.hero a:not(.logo-link), .cta-card a:not(.btn) { color: var(--white); text-decoration: underline; text-decoration-color: var(--white); }
h2 { font-family: var(--font); font-weight: 500; color: var(--brown); font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 10px; }

.intro { font-size: 18px; margin: 22px 4px 18px; }

/* ---------- Visuals ---------- */
.card-photo { margin: -22px -16px 20px; }
.card-photo img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--grey);
}
.state-card .card-photo { margin: -34px -22px 24px; }
.has-photo-top { overflow: hidden; }

.steps { margin: 0 0 22px; }
.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.step { display: flex; align-items: flex-start; gap: 12px; font-size: 15.5px; line-height: 1.45; }
.step strong { display: block; color: var(--brown); font-weight: 600; font-size: 16.5px; }
.step-n {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--peach); color: var(--brown);
  font-family: var(--font); font-weight: 600; font-size: 18px;
}

.prizes {
  background: var(--grey);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  margin: 0 0 22px;
  text-align: center;
}
.prizes h2 { margin-bottom: 4px; }
.prizes-sub { margin: 0 auto 14px; max-width: 30em; font-size: 16px; }
.prize-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
}
.prize {
  background: var(--white); border-radius: 12px; padding: 6px 4px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.prize img { display: block; width: 100%; max-width: 160px; height: auto; aspect-ratio: 1; object-fit: contain; }
.prize span { font-weight: 600; font-size: 13.5px; color: var(--brown); line-height: 1.3; }
.prizes-note { margin: 12px 0 0; font-size: 13.5px; color: var(--brown); }

.card {
  background: var(--white);
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  padding: 22px 16px;
}
.notice { margin-bottom: 16px; }

fieldset { border: 0; margin: 0 0 26px; padding: 0; min-width: 0; }
legend {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 500;
  color: var(--brown);
  margin-bottom: 12px;
  padding: 0;
}
.opt { font-family: var(--font); font-weight: 400; font-size: 15px; color: var(--brown); }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.hint { font-size: 14.5px; color: var(--brown); margin: 0 0 6px; }
.hint-after { margin: 6px 0 0; }

input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--brown);
  background: var(--white);
  /* Brown keeps the field edge above 3:1 (grey and sage are not). */
  border: 1.5px solid var(--brown);
  border-radius: 12px;
  padding: 11px 13px;
  min-height: 48px;
}
input.short { max-width: 11em; }
textarea { resize: vertical; min-height: 120px; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%235E4E3B' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible,
.check input:focus-visible + label::before {
  outline: 3px solid var(--brown);
  outline-offset: 2px;
}
.hero :focus-visible, .cta-card :focus-visible { outline-color: var(--white); }
[aria-invalid="true"] { border-color: var(--error) !important; border-width: 2px; }

.row-2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 560px) {
  .row-2 { grid-template-columns: 1fr 1fr; }
  .card { padding: 30px 32px; }
  .hero { padding: 30px 32px 34px; }
  .card-photo { margin: -30px -32px 26px; }
  .prize-list { gap: 12px; }
  .prize { padding: 10px 8px 12px; }
  .prize span { font-size: 15px; }
  .prizes { padding: 24px 22px 18px; }
  .step-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .step { flex-direction: column; gap: 8px; }
}

.counter { font-size: 14.5px; color: var(--brown); margin: 6px 0 0; text-align: right; font-weight: 500; }
.counter.near { color: var(--brown); font-weight: 600; }
.counter.over { color: var(--error); }

.error { color: var(--error); font-size: 15px; font-weight: 600; margin: 6px 0 0; }
.error::before { content: "! "; }
.error-summary {
  border: 2px solid var(--error);
  background: var(--white);
  color: var(--error);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-weight: 600;
}

.error-summary.info { border-color: var(--sage); background: var(--white); color: var(--brown); }

/* Checkboxes: large, custom, still native inputs */
.check { position: relative; margin: 0 0 14px; }
.check input { position: absolute; opacity: 0; width: 26px; height: 26px; margin: 0; left: 0; top: 0; cursor: pointer; }
.check label { display: block; padding-left: 38px; cursor: pointer; min-height: 26px; }
.check label::before {
  content: "";
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px;
  border: 2px solid var(--brown);
  border-radius: 8px;
  background: var(--white);
}
.check input:checked + label::before {
  background: var(--brown) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12' viewBox='0 0 16 12'%3E%3Cpath d='M1.5 6l4.5 4.5L14.5 1.5' stroke='%23FFFFFF' stroke-width='2.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat;
  border-color: var(--brown);
}
.check input[aria-invalid="true"] + label::before { border-color: var(--error); }
.check .hint { display: block; margin: 2px 0 0; }
.check .error { padding-left: 38px; }
.check a { font-weight: 600; }
.check-terms {
  background: var(--white);
  border: 1.5px solid var(--grey);
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin-bottom: 12px;
}
.check-terms input, .check-terms label::before { left: 14px; top: 14px; }
.check-terms label { font-weight: 500; }
.check-terms .hint { font-weight: 400; margin-top: 6px; }
.check-terms .error { padding-left: 38px; }
.check-optional { padding: 2px 14px 0; }
.check-optional input, .check-optional label::before { left: 14px; top: 2px; }
.check-optional label { font-size: 15.5px; }

.radios { display: flex; gap: 10px; flex-wrap: wrap; }
.radio {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--brown); border-radius: 999px;
  padding: 9px 18px; background: var(--white); cursor: pointer; font-weight: 500; min-height: 46px;
}
.radio input { width: 20px; height: 20px; accent-color: var(--brown); margin: 0; }
.radio:has(input:checked) { border-color: var(--brown); background: var(--peach); font-weight: 600; }
.which-one { margin-top: 14px; }

.photo { margin-top: 4px; }
.photo-btn { cursor: pointer; }
.photo-preview { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.photo-preview img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 1px solid var(--grey); }
.photo-status { font-size: 14.5px; color: var(--brown); margin: 8px 0 0; min-height: 1em; }
.photo-status:empty { display: none; }

.link-btn { background: none; border: 0; padding: 6px 0; font: inherit; color: var(--brown); text-decoration: underline; text-decoration-color: var(--sage); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; font-weight: 600; }

.privacy, .skill { font-size: 14.5px; color: var(--brown); margin: 0 0 10px; }
.turnstile-field { margin: 16px 0 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; text-decoration: none; text-transform: uppercase; letter-spacing: 0.12em;
  border-radius: 999px; padding: 12px 24px; min-height: 48px; border: 2px solid transparent; cursor: pointer;
}
/* Primary: peach with brown text (4.8:1). Hover swaps to brown with white text. */
.btn-primary { background: var(--peach); color: var(--brown); width: 100%; font-size: 16px; }
.btn-primary:hover { background: var(--brown); color: var(--white); }
.btn-primary[disabled] { background: var(--grey); color: var(--brown); cursor: progress; }
.btn-secondary { background: var(--white); color: var(--brown); border-color: var(--brown); }
.btn-secondary:hover { background: var(--peach); color: var(--brown); }
@media (min-width: 560px) { .btn-primary { width: auto; min-width: 260px; } }

.round-note { font-size: 13px; color: var(--brown); margin: 14px 0 0; }

.state-card { text-align: center; padding: 34px 22px; margin-top: 22px; }
.state-card p { font-size: 18px; margin: 0 auto 18px; max-width: 34em; }
.success h2::after {
  content: ""; display: block; width: 56px; height: 4px; border-radius: 4px;
  background: var(--sage); margin: 14px auto 0;
}

/* ---------- Compact hero (gallery, story pages) ---------- */
.page-wide { max-width: 1000px; }
.hero-compact { padding: 18px 20px 22px; }
.hero-compact .logo { width: 76px; margin-bottom: 10px; }
.hero-compact h1 { font-size: clamp(30px, 6.4vw, 44px); }
.hero-compact .eyebrow:last-child { margin-bottom: 0; }
.logo-link { display: inline-block; }

/* ---------- Gallery ---------- */
.gallery-intro p { font-size: 18px; margin: 20px 4px 16px; max-width: 40em; }
.g-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.g-tab {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px;
  border-radius: 999px; border: 1.5px solid var(--brown); background: var(--white);
  color: var(--brown); font-weight: 600; text-decoration: none;
}
.g-tab:hover { background: var(--peach); color: var(--brown); }
.g-tab.active { background: var(--brown); border-color: var(--brown); color: var(--white); }
.g-grid { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 560px) { .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .g-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.g-card { background: var(--white); border: 1px solid var(--grey); border-radius: var(--radius); overflow: hidden; }
.g-card-text { background: var(--peach); border-color: transparent; }
.g-link { display: flex; flex-direction: column; height: 100%; color: var(--brown); text-decoration: none; }
.g-link:hover { color: var(--brown); }
.g-link:hover .g-name { text-decoration: underline; }
.g-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--grey); }
.g-quote-mark { display: block; height: 64px; padding: 20px 18px 0; font-family: var(--font); font-weight: 500; font-size: 104px; line-height: 0.9; color: var(--brown); }
.g-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px 18px; }
.g-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.g-round { font-size: 12.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brown); }
.g-badge { background: var(--peach); color: var(--brown); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; }
.g-card-text .g-badge { background: var(--brown); color: var(--peach); }
.g-story { font-family: var(--font); font-weight: 400; font-size: 19px; line-height: 1.4; }
.g-card-text .g-story { font-size: 22px; font-weight: 500; line-height: 1.3; }
.g-name { font-weight: 600; color: var(--brown); }
.g-empty { text-align: center; color: var(--brown); }

/* ---------- Story page ---------- */
.story-card { padding: 0 0 26px; margin-top: 22px; }
.story-card:not(.has-photo-top) { background: var(--peach); border-color: transparent; padding-top: 30px; }
.story-card:not(.has-photo-top) .g-badge { background: var(--brown); color: var(--peach); }
.story-photo { margin: 0 0 22px; background: var(--grey); }
.story-photo img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; }
.story-meta, .story-quote, .story-name { padding: 0 22px; }
.story-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 10px; }
.story-quote { margin: 0; }
.story-quote p { margin: 0; font-family: var(--font); font-weight: 500; font-size: clamp(25px, 5.6vw, 34px); line-height: 1.25; letter-spacing: -0.01em; color: var(--brown); }
.story-name { margin: 14px 0 0; font-weight: 600; font-size: 18px; color: var(--brown); }
.cta-card { background: var(--sage); color: var(--white); font-weight: 500; border-radius: var(--radius); padding: 26px 22px 28px; text-align: center; margin: 22px 0 18px; }
.cta-card h2 { color: var(--white); }
.cta-card p { margin: 0 auto 18px; max-width: 30em; }
.cta-card .btn-primary { background: var(--peach); color: var(--brown); }
.cta-card .btn-primary:hover { background: var(--white); color: var(--brown); }
.story-links { text-align: center; margin: 0 0 10px; font-weight: 600; }
.takedown { text-align: center; font-size: 14px; color: var(--brown); margin: 0; }
@media (min-width: 560px) {
  .story-meta, .story-quote, .story-name { padding: 0 32px; }
  .story-card { padding-bottom: 32px; }
  .cta-card { padding: 30px 32px 32px; }
}

/* ---------- Success: share card and invite link ---------- */
.share-block, .invite-block { text-align: left; border-top: 1px solid var(--grey); padding-top: 22px; margin: 8px 0 22px; }
.share-block h3, .invite-block h3 { font-family: var(--font); font-weight: 500; color: var(--brown); font-size: 23px; margin: 0 0 12px; text-align: center; }
.share-preview { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto 16px; border-radius: 14px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16); }
.share-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.share-actions .btn { width: auto; min-width: 150px; font-size: 15px; }
.state-card .invite-block p { font-size: 16.5px; margin: 0 0 14px; max-width: none; }
.invite-label { display: block; font-weight: 600; margin-bottom: 4px; }
.copy-row { display: flex; gap: 8px; margin-bottom: 14px; }
.copy-row input { flex: 1; min-width: 0; font-size: 15px; }
.copy-row .btn { flex: none; padding: 10px 16px; }
.state-card .invite-block p.fine { font-size: 14.5px; color: var(--brown); margin: 0 0 8px; }
.story-link { word-break: break-all; font-weight: 600; color: var(--brown); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Keep the file input focusable for keyboard users: show focus on its label. */
#photo:focus-visible + .photo-btn { outline: 3px solid var(--brown); outline-offset: 2px; }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .radio, input, select, textarea { transition: background-color .15s, border-color .15s; }
}
