:root{color-scheme:light;--paper:#f6f2e9;--ink:#202a22;--green:#17683e;--rule:#d4d4c6;--secondary:#555f53;font-family:Archivo,Arial,sans-serif}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--paper);color:var(--ink);min-height:100svh}
a{color:inherit;text-decoration:none}
button{font:inherit;cursor:pointer;color:inherit;touch-action:manipulation}
button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #ba531e;outline-offset:4px}
.site-head{max-width:1136px;margin:auto;padding:23px 0 19px;border-bottom:1px solid var(--rule);display:flex;align-items:center;justify-content:space-between}
.brand{font-size:29px;font-weight:800;letter-spacing:-2.1px;display:inline-flex;align-items:center;gap:7px;line-height:1}
.brand img{width:32px;height:32px;display:block;border-radius:50%}
.home{font-weight:600;font-size:14px}.home span{margin-left:3px}
main{display:grid;grid-template-columns:minmax(280px,.85fr) minmax(0,1.15fr);grid-template-areas:"heading stage" "controls stage";column-gap:clamp(30px,7vw,112px);align-content:center;align-items:start;max-width:1060px;margin:clamp(48px,8vh,100px) auto;padding:0 20px}
.heading{grid-area:heading;align-self:end}
.eyebrow,.stage-head,.stage-foot small{font:650 11px/1.2 Archivo,Arial,sans-serif;text-transform:uppercase;letter-spacing:.13em}
.eyebrow{margin:0 0 15px;color:var(--green)}
h1{font-size:clamp(57px,7.6vw,108px);line-height:.89;letter-spacing:-.055em;font-weight:800;margin:0 0 19px}
h1 span{color:var(--green)}
.lead{font-size:clamp(22px,2.4vw,33px);font-weight:600;line-height:1.1;letter-spacing:-.045em;margin:0;max-width:16em}
.controls{grid-area:controls;align-self:start;margin-top:14px;max-width:360px}
#note,#invite{font-size:16px;line-height:1.45;margin:0 0 20px;color:var(--secondary)}
#invite{font-weight:700;color:var(--green);margin-bottom:8px}
#actions{display:flex;flex-direction:column;gap:8px;align-items:stretch}
button{border:0;border-radius:9px;min-height:46px;padding:11px 21px;font-size:15px;font-weight:700;line-height:1.05}
.primary{background:var(--green);color:white;display:flex;align-items:center;justify-content:center;gap:12px}
.primary:hover{background:#104d30}.primary span{font-size:19px}
.secondary{background:transparent;border:1px solid #9baca0}.secondary:hover{background:#e7ebdf}
.quiet{min-height:36px;background:transparent;text-decoration:underline;text-underline-offset:4px}
.privacy,.feedback,#shareFallback label{color:var(--secondary);font-size:12px;line-height:1.45;margin:13px 0 0}
.privacy-dot{display:inline-block;width:7px;height:7px;border:1.5px solid var(--green);border-radius:50%;margin-right:5px}
.feedback:empty{display:none}
#shareFallback{display:grid;gap:5px}#shareLink{width:100%;font:inherit;padding:8px;background:white;border:1px solid var(--rule)}
.stage{grid-area:stage;position:relative;isolation:isolate;overflow:hidden;width:100%;aspect-ratio:1/.99;align-self:center;border-radius:24px;background:radial-gradient(ellipse at 52% 37%,#fff4da 1%,#f7e6c6 62%,#e4c99e 100%);border:1px solid #cfba99;box-shadow:0 15px 35px -24px #493c26a8}
.stage:before{content:"";position:absolute;inset:62% 0 0;background-color:#d8a788;background-image:repeating-linear-gradient(0deg,#fff6e9a6 0 10px,transparent 10px 20px),repeating-linear-gradient(90deg,#fff7ed9c 0 10px,transparent 10px 20px);transform:perspective(210px) rotateX(34deg) scale(1.28);transform-origin:center top;opacity:.78}
#camera,#selfie,.stage-fade{position:absolute;inset:0;width:100%;height:100%;display:none}
#camera,#selfie{object-fit:cover;object-position:50% 42%;transform:scaleX(-1)}
#selfie{opacity:0;pointer-events:none}
body.camera-live #selfie{display:block}
body.camera-live #selfie.streaming{opacity:1}
.stage-fade{background:linear-gradient(180deg,#17201b52,transparent 13%,transparent 74%,#17201b55);pointer-events:none}
body.camera-live #camera,body.camera-live .stage-fade{display:block}
.stage-head,.stage-foot{position:absolute;left:5.6%;right:5.6%;display:flex;align-items:center;justify-content:space-between;z-index:1}
.stage-head{top:5.8%;color:#514432}
.stage-foot{bottom:5.4%;color:#3b3024}
body.camera-live .stage{aspect-ratio:4/5;max-height:calc(100svh - 130px);background:#222a25}
body.camera-live .stage:before,body.camera-live .stage-foot{display:none}
body.camera-live .stage-head{top:14px;left:16px;right:16px;color:white}
body.camera-live .stage-head span,body.camera-live #pips{background:#11271ccd;border-radius:20px;padding:7px 10px}
body.camera-live #pips i.pass{background:#9ef1ac}
.stage-foot small,.stage-foot strong{display:block}
.stage-foot small{font-size:9px;margin-bottom:4px}
.stage-foot strong{font-size:clamp(19px,2vw,27px);font-weight:750;line-height:1.05;letter-spacing:-.045em}
#pips{display:flex;gap:4px}#pips i{width:15px;height:6px;border-radius:5px;background:currentColor;opacity:.23}#pips i.pass{opacity:1;background:#117144}#pips i.fail{opacity:1;background:#a32f3b}
body.camera-live #pips i{box-shadow:0 0 1px 1px #fff8}
.board{position:absolute;inset:12% 0 14%;display:flex;align-items:center;justify-content:center;pointer-events:none}
#poster{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
#recovery{font-size:14px;line-height:1.45;color:var(--secondary)}
#recovery a,.reload-link{color:var(--green);font-weight:700;text-decoration:underline;text-underline-offset:3px}
.reload-link{text-align:center;padding:12px 0}
#art{width:100%;height:100%;object-fit:contain;display:block}
body.camera-live .board{inset:auto 3% 1%;height:31%;min-height:min(124px,75%);align-items:end}
body.camera-live #art{width:100%;height:100%;object-fit:contain;object-position:center bottom}
#lastRatio{font-size:clamp(24px,3vw,42px);font-weight:800;letter-spacing:-.075em;font-variant-numeric:tabular-nums}
body[data-state="result"] #lastRatio{color:#3b3024}
@media(min-width:761px) and (max-width:1200px){.site-head{margin:0 5vw}}
@media(max-width:760px){
 .site-head{margin:0 5%;padding:14px 0 12px}.brand{font-size:24px}.brand img{width:26px;height:26px}.home{font-size:13px}
 main{max-width:490px;display:flex;flex-direction:column;align-items:stretch;gap:0;margin:0 auto;padding:21px 5% max(17px,env(safe-area-inset-bottom))}
 .heading{align-self:stretch}.eyebrow{margin-bottom:7px;font-size:9px}h1{font-size:clamp(48px,13vw,70px);margin-bottom:7px}.lead{font-size:20px;max-width:none}
 .stage{margin:15px 0 13px;aspect-ratio:1/.87;border-radius:17px}
 .stage-head{top:5.5%;font-size:10px}.stage-foot{bottom:5%}.stage-foot strong{font-size:19px}
 .controls{margin:0;max-width:none;align-self:stretch}#note,#invite{font-size:14px;margin-bottom:12px}
 button{min-height:42px}#actions{gap:7px}.privacy{margin-top:10px;font-size:11px}
}
@media(max-width:760px) and (max-height:680px){main{padding-top:12px}.stage{aspect-ratio:1/.73;margin:10px 0}h1{font-size:42px}.lead{font-size:17px}.site-head{padding:9px 0}.privacy{margin-top:7px}}

/* Give the camera the full phone width. The knife and cake stay in the lower third. */
@media (max-width:760px) and (orientation:portrait){
  body.camera-live .site-head,body.camera-live .heading{display:none}
  body.camera-live main{
    display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;
    grid-template-areas:"stage" "controls";gap:0;max-width:none;margin:0;padding:0;
    height:100vh;height:100svh;height:100dvh;min-height:360px;
  }
  body.camera-live .stage{height:100%;max-height:none;align-self:stretch;aspect-ratio:auto;margin:0;border:0;border-radius:0;box-shadow:none}
  body.camera-live .stage-head{top:max(12px, env(safe-area-inset-top))}
  body.camera-live .controls{
    display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0 12px;
    padding:10px 16px max(10px, env(safe-area-inset-bottom));background:var(--paper);
  }
  /* Reserve three lines so status updates never resize the selfie as the user blinks. */
  body.camera-live #note{margin:0;min-block-size:4.05em;font-size:14px;line-height:1.35;align-content:center}
  body.camera-live #actions{grid-column:2;grid-row:1}
  body.camera-live #stop{min-height:42px;padding:8px 14px}
  body.camera-live .privacy{display:none}
}
@media (max-width:360px) and (orientation:portrait){
  body.camera-live #note{min-block-size:5.4em}
}
