/* SillyCuts "warm precision" tokens, copied from apps/web/src/theme.css. */
@font-face {
  font-family: 'Fredoka Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('/fonts/fredoka.woff2') format('woff2-variations');
}

:root {
  --ink: oklch(19% 0.03 205);
  --graphite: oklch(29% 0.038 197);
  --muted: oklch(45% 0.035 193);
  --quiet: oklch(62% 0.03 188);
  --line: oklch(84% 0.018 181);
  --soft-line: oklch(91% 0.014 178);
  --paper: oklch(98% 0.014 76);
  --wash: oklch(95% 0.015 181);
  --mint-surface: oklch(94% 0.026 168);
  --orange-surface: oklch(94% 0.05 52);
  --orange: oklch(65% 0.19 43);
  --orange-action: oklch(56% 0.17 43);
  --orange-dark: oklch(49% 0.155 42);
  --green: oklch(45% 0.11 164);
  --red: oklch(50% 0.17 27);
  --teal: oklch(44% 0.072 180);
  --teal-dark: oklch(28% 0.058 187);
  --teal-deep: oklch(23% 0.05 190);
  --on-teal: oklch(93% 0.025 170);
  --on-teal-muted: oklch(80% 0.04 175);
  --shadow: 0 24px 70px oklch(20% 0.03 190 / 0.14);
  --soft-shadow: 0 12px 32px oklch(20% 0.03 190 / 0.075);
  --radius: 12px;
  --font: 'Fredoka Variable', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, oklch(44% 0.072 180 / 0.035) 1px, transparent 1px),
    linear-gradient(180deg, oklch(44% 0.072 180 / 0.035) 1px, transparent 1px),
    var(--wash);
  background-size: 42px 42px;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

::selection { background: color-mix(in oklch, var(--orange) 30%, transparent); color: var(--ink); }
:focus-visible { outline: 3px solid color-mix(in oklch, var(--teal) 42%, transparent); outline-offset: 3px; }

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

/* ---------- Layout ---------- */

.page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
}

.intro {
  align-self: start;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 40px clamp(28px, 4vw, 64px) 36px;
  color: var(--on-teal);
  background:
    linear-gradient(90deg, oklch(100% 0 0 / 0.035) 1px, transparent 1px),
    linear-gradient(180deg, oklch(100% 0 0 / 0.035) 1px, transparent 1px),
    radial-gradient(120% 70% at 0% 100%, oklch(34% 0.07 182) 0%, transparent 60%),
    var(--teal-deep);
  background-size: 42px 42px, 42px 42px, auto, auto;
  overflow: hidden;
}

.brand { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; }
.brand-mark,
.brand-wordmark {
  display: block;
  background: var(--paper);
  -webkit-mask: var(--art) center / contain no-repeat;
  mask: var(--art) center / contain no-repeat;
}
.brand-mark { --art: url('/mark.svg'); width: 52px; height: 30px; }
.brand-wordmark { --art: url('/wordmark.svg'); width: 128px; height: 30px; }

.intro-copy { margin-top: auto; }

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4.2vw, 3.6rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--paper);
}

.lede {
  max-width: 30ch;
  margin: 20px 0 0;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--on-teal-muted);
}

.promises {
  list-style: none;
  margin: 0;
  padding: 24px 0 0;
  display: grid;
  gap: 14px;
  border-top: 1px solid oklch(100% 0 0 / 0.12);
}
.promises li { display: flex; gap: 12px; align-items: flex-start; color: var(--on-teal); }
.promises svg {
  flex: none;
  width: 22px; height: 22px; margin-top: 1px;
  fill: none; stroke: var(--orange); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

/* The one moment of motion: a laser line cuts across the panel on load. */
.kerf { width: 100%; height: 18px; margin-top: 4px; overflow: visible; }
.kerf path {
  fill: none;
  stroke: var(--orange);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 460;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 4px oklch(70% 0.19 45 / 0.7));
  animation: cut 1.6s var(--ease-out) 0.2s both;
}
@keyframes cut { from { stroke-dashoffset: 460; } to { stroke-dashoffset: 0; } }

.sheet {
  padding: clamp(28px, 5vw, 72px) clamp(20px, 5vw, 72px) 80px;
  display: flex;
  justify-content: center;
}

.form,
.done {
  width: 100%;
  max-width: 40rem;
}

/* ---------- Form ---------- */

.group {
  margin: 0 0 18px;
  padding: 24px 26px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--soft-shadow);
}

legend {
  float: left;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--teal-dark);
}
legend + * { clear: both; }

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

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

label,
.label {
  display: block;
  margin-bottom: 7px;
  font-weight: 560;
  color: var(--graphite);
}

.opt { font-size: 0.82rem; font-weight: 400; color: var(--muted); margin-left: 4px; }

input[type='text'],
input[type='email'],
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: oklch(99.5% 0.006 76);
  color: var(--ink);
  font: inherit;
  caret-color: var(--orange-action);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
textarea { resize: vertical; min-height: 150px; line-height: 1.55; }
input::placeholder,
textarea::placeholder { color: var(--muted); opacity: 0.85; }
input[type='text']:hover,
input[type='email']:hover,
textarea:hover { border-color: color-mix(in oklch, var(--teal) 45%, var(--line)); }
input[type='text']:focus,
input[type='email']:focus,
textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--teal) 20%, transparent);
}
.invalid input,
.invalid textarea { border-color: var(--red); }

.hint { margin: 6px 0 0; font-size: 0.86rem; color: var(--muted); }
.error { margin: 6px 0 0; font-size: 0.88rem; font-weight: 500; color: var(--red); }
.error:empty { display: none; }

.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Stars */
.stars { display: flex; align-items: center; gap: 4px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label {
  margin: 0;
  width: 40px; height: 40px;
  cursor: pointer;
  border-radius: 8px;
  background: var(--line);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.75 5.8 6.3.75-4.65 4.35 1.2 6.25L12 16.9l-5.6 3.05 1.2-6.25L2.95 9.35l6.3-.75z' stroke='black' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E") center / 34px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.75 5.8 6.3.75-4.65 4.35 1.2 6.25L12 16.9l-5.6 3.05 1.2-6.25L2.95 9.35l6.3-.75z' stroke='black' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E") center / 34px no-repeat;
  transition: background 120ms ease, transform 160ms var(--ease-out);
}
.stars label:hover { transform: scale(1.08); }
.stars[data-show='1'] label:nth-of-type(-n + 1),
.stars[data-show='2'] label:nth-of-type(-n + 2),
.stars[data-show='3'] label:nth-of-type(-n + 3),
.stars[data-show='4'] label:nth-of-type(-n + 4),
.stars[data-show='5'] label:nth-of-type(-n + 5) { background: var(--orange); }
.stars input:focus-visible + label { outline: 3px solid color-mix(in oklch, var(--teal) 42%, transparent); outline-offset: 0; }
.stars-word { margin-left: 10px; font-size: 0.95rem; font-weight: 500; color: var(--muted); }

/* Photos */
.drop-target {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0;
  padding: 26px 18px;
  text-align: center;
  font-weight: 400;
  border: 1.5px dashed color-mix(in oklch, var(--teal) 35%, var(--line));
  border-radius: 10px;
  background: var(--wash);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.drop-target svg {
  width: 30px; height: 30px; margin-bottom: 4px;
  fill: none; stroke: var(--teal); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.drop-target strong { font-weight: 600; color: var(--teal-dark); }
.drop-target:hover,
.drop.dragging .drop-target { border-color: var(--teal); background: var(--mint-surface); }
#photos:focus-visible + .drop-target { outline: 3px solid color-mix(in oklch, var(--teal) 42%, transparent); outline-offset: 3px; }
.drop.full .drop-target { display: none; }

.thumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs:not(:empty) { margin-top: 14px; }
.thumbs li {
  position: relative;
  width: 92px; height: 92px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--wash);
}
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .no-preview {
  display: grid; place-items: center; height: 100%;
  padding: 6px; font-size: 0.72rem; text-align: center; color: var(--muted);
}
.thumbs button {
  position: absolute; top: 5px; right: 5px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0; border-radius: 99px;
  background: oklch(20% 0.03 200 / 0.72);
  color: white; cursor: pointer;
}
.thumbs button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.thumbs button:hover { background: var(--orange-dark); }

/* Consent */
.check {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 0 12px;
  font-weight: 400; color: var(--ink); cursor: pointer;
}
.check input {
  flex: none;
  width: 22px; height: 22px; margin: 1px 0 0;
  accent-color: var(--teal);
  cursor: pointer;
}

/* Submit */
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 26px; }

.button {
  min-height: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 0 26px;
  font: inherit; font-size: 1.02rem; font-weight: 600; line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.button-primary {
  border-color: var(--orange-action);
  background: var(--orange-action);
  color: white;
  box-shadow: 0 8px 20px oklch(56% 0.17 43 / 0.22);
}
.button-primary:hover:not(:disabled) { background: var(--orange-dark); border-color: var(--orange-dark); }
.button-primary:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { cursor: progress; opacity: 0.78; }
.button-secondary { border-color: color-mix(in oklch, var(--teal-dark) 42%, var(--line)); background: var(--paper); color: var(--teal-dark); }
.button-secondary:hover { border-color: var(--teal); }
.label-busy { display: none; }
.busy .label-idle { display: none; }
.busy .label-busy { display: inline; }

.form-error { margin: 0; color: var(--red); font-weight: 500; }
.form-error:empty { display: none; }

/* Done */
.done {
  align-self: center;
  padding: 48px 36px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.done:focus { outline: none; }
.done h2 { margin: 18px 0 8px; font-size: 2rem; font-weight: 600; letter-spacing: -0.015em; color: var(--teal-dark); }
.done p { margin: 0 auto; max-width: 34ch; color: var(--graphite); font-size: 1.08rem; }
.done .done-sub { margin-top: 28px; margin-bottom: 12px; color: var(--muted); font-size: 0.95rem; }
.done-mark { width: 72px; height: 72px; margin: 0 auto; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.done-mark .ring { stroke: var(--orange); stroke-width: 2.5; stroke-dasharray: 176; animation: trace 900ms var(--ease-out) both; }
.done-mark .tick { stroke: var(--teal); stroke-width: 3.5; stroke-dasharray: 40; animation: trace 500ms var(--ease-out) 500ms both; }
@keyframes trace { from { stroke-dashoffset: 176; } to { stroke-dashoffset: 0; } }
.done-mark .tick { animation-name: trace-tick; }
@keyframes trace-tick { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }

/* ---------- Small screens ---------- */

@media (max-width: 880px) {
  .page { grid-template-columns: 1fr; }
  .intro { position: relative; height: auto; gap: 28px; padding: 22px 20px 26px; }
  .intro-copy { margin-top: 8px; }
  h1 { font-size: clamp(2rem, 8.5vw, 2.6rem); }
  .lede { font-size: 1.05rem; max-width: 36ch; }
  .promises { gap: 10px; padding-top: 18px; font-size: 0.95rem; }
  .sheet { padding: 22px 14px 56px; }
  .group { padding: 20px 18px 22px; }
}

@media (max-width: 520px) {
  .row.two { grid-template-columns: 1fr; gap: 0; }
  .row.two .field { margin-bottom: 18px; }
  .submit-row .button { width: 100%; }
  .stars label { width: 44px; height: 44px; }
}

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