/* Normal document flow, with balanced space above and below the composition. */
.site .referral-section { padding:0; min-height:0; scroll-margin-top:-24px; }
.referral-legacy-anchor { position:absolute; top:0; }
.referral-section .about-stage {
  --frame-height:clamp(720px,92svh,900px);
  --frame-inset:clamp(36px,5svh,60px);
  --frame-gutter:clamp(28px,5vw,80px);
  position:relative; container-type:inline-size;
  display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);
  column-gap:clamp(24px,3vw,54px); align-items:start;
  width:100%; max-width:none; height:auto; min-height:var(--frame-height);
  padding:var(--frame-inset) var(--frame-gutter) clamp(112px,14vw,176px);
  aspect-ratio:auto; border-radius:0;
}
.referral-content { position:relative; z-index:1; grid-column:1; width:100%; max-width:820px; align-self:start; margin:0; padding:0; text-align:left; background:none; border:0; box-shadow:none; }
.referral-content h2 { font-family:Adventure,Arial,sans-serif; margin:0 0 30px; width:max-content; max-width:calc(100cqw - var(--frame-gutter)*2); font-size:clamp(34px,4.2vw,68px); line-height:1.1; letter-spacing:-.03em; font-weight:600; text-transform:uppercase; white-space:normal; }
/* A horizontal sweep through the lettering; the headline itself stays still. */
.referral-headline { display:block; width:fit-content; color:#fff; }
@supports ((background-clip:text) or (-webkit-background-clip:text)) {
  .referral-headline {
    background:linear-gradient(90deg,#777 0%,#aaa 28%,#fff 43%,#fff 57%,#aaa 72%,#777 100%);
    background-size:200% 100%; background-position:200% 50%;
    background-clip:text; -webkit-background-clip:text; color:transparent;
    animation:referral-heading-wave 2.6s linear infinite;
    animation-play-state:paused;
  }
  .referral-headline.is-visible { animation-play-state:running; }
}
@keyframes referral-heading-wave {
  from { background-position:200% 50%; }
  to { background-position:0% 50%; }
}
@media (prefers-reduced-motion:reduce) {
  .referral-headline { animation:none; background:none; color:#fff; }
}
.referral-form,.referral-success { width:100%; background:none; border:0; box-shadow:none; }
.site .referral-section .referral-content p { max-width:100%; margin:0; text-align:left; font-weight:400; letter-spacing:normal; transform:none; }
.referral-fields { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:16px; }
.referral-fields label { grid-column:span 6; }
.referral-fields label,.referral-success label { min-width:0; display:block; color:#bbb; font-size:clamp(14px,1.2vw,17px); line-height:1.4; text-align:left; }
.referral-fields input,.referral-link-row input { display:block; width:100%; height:clamp(48px,4vw,58px); margin-top:6px; border:1px solid #494949; border-radius:12px; padding:12px 15px; background:transparent; color:white; font:inherit; font-size:clamp(16px,1.25vw,19px); outline:none; transition:border-color .18s; }
.referral-fields input::placeholder { color:#999; }
.referral-fields input:focus,.referral-link-row input:focus { border-color:#fff; background:transparent; }
.referral-fields input[aria-invalid=true] { border-color:#ffb4a9; }
.referral-fields .referral-address { grid-column:span 9; }
.referral-fields .referral-unit { grid-column:span 3; }
.site .referral-section .referral-content .referral-how { margin:22px 0; font-size:clamp(15px,1.2vw,18px); line-height:1.5; color:#bbb; }
.referral-submit,.referral-share,.referral-copy { display:inline-flex; align-items:center; justify-content:center; min-height:46px; border:0; border-radius:999px; padding:12px 24px; background:#fff; color:#111; font:inherit; font-size:15px; font-weight:600; cursor:pointer; transition:background-color .18s,color .18s; }
.referral-submit:hover,.referral-share:hover,.referral-copy:hover { background:#ddd; }
.referral-submit[data-incomplete=true] { background:#acacac; color:#222; }
.referral-submit[data-incomplete=true]:hover { background:#bcbcbc; }
.referral-submit:disabled { opacity:.65; cursor:wait; }
.referral-action-row { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.referral-action-row .referral-submit { min-height:52px; padding-inline:28px; font-size:16px; }
.referral-mobile-details { display:block; flex:none; min-height:44px; padding:10px 0; border:0; background:none; color:#bbb; font:inherit; font-size:15px; line-height:1.5; white-space:nowrap; text-decoration:underline; text-underline-offset:4px; cursor:pointer; }
.referral-content > .referral-terms,.referral-content > .referral-privacy { display:none; }
.site .referral-section .referral-content .referral-terms { margin-top:16px; font-size:14px; line-height:1.5; color:#aaa; }
.site .referral-section .referral-content .referral-privacy { margin-top:8px; font-size:14px; line-height:1.5; color:#aaa; }
.referral-privacy a { color:#ddd; text-underline-offset:3px; }
.site .referral-section .referral-content .referral-status,.site .referral-section .referral-content .referral-copy-status { color:#ffb4a9; font-size:14px; line-height:1.5; margin-top:12px; }
.referral-status:empty,.referral-copy-status:empty { display:none; }
.referral-success h3 { font-size:26px; margin:24px 0 12px; letter-spacing:-.025em; }
.site .referral-section .referral-success > p { color:#bbb; font-size:16px; line-height:1.5; margin-bottom:20px; }
.referral-link-row { display:flex; gap:10px; align-items:center; }
.referral-link-row input { min-width:0; margin:7px 0; }
.referral-copy { flex:none; padding-inline:18px; }
.referral-success-actions { display:flex; gap:20px; align-items:center; margin-top:16px; }
.referral-edit { min-height:44px; border:0; background:none; color:#bbb; font:inherit; font-size:14px; text-decoration:underline; cursor:pointer; }
.referral-section :is(button,a):focus-visible { outline:2px solid white; outline-offset:5px; }
.referral-section [hidden] { display:none; }
.site .referral-section .referral-content .referral-copy-status { color:#ccc; }
/* Keep the film's visible floor and right edge inside the frame. The
   canvas includes empty render margins, which are excluded from alignment. */
.referral-section .about-bottle-scene {
  --film-width:min(110cqw,calc((var(--frame-height) - var(--frame-inset)*2)*2.15973));
  position:absolute; top:var(--frame-inset); bottom:var(--frame-inset);
  right:calc(12px - var(--film-width)*.05677); left:auto;
  width:var(--film-width); height:auto; margin:0; clip-path:none; pointer-events:none;
}
.referral-section .about-bottle-scene :is(img,video) {
  inset:auto 0 calc(var(--film-width)*-.0645833) auto;
  width:100%; height:auto; object-fit:contain; object-position:right bottom; transform:none;
}
.referral-section .about-bottle-scene.is-empty picture { visibility:hidden; }
.referral-fields input.is-shaking { animation:referral-field-shake .3s ease-out; }
@keyframes referral-field-shake { 0%,100% { transform:translateX(0); } 25% { transform:translateX(-4px); } 50% { transform:translateX(4px); } 75% { transform:translateX(-2px); } }
@media (max-width:600px) {
  .site .referral-section { min-height:0; }
  .referral-section .about-stage { position:relative; display:block; container-type:normal; height:auto; min-height:0; padding:0; }
  .referral-content { width:min(580px,calc(100% - 48px)); align-self:auto; margin:0 auto; padding-top:36px; padding-bottom:36px; }
  .referral-content h2 { width:auto; max-width:100%; font-size:clamp(26px,3.8vw,40px); white-space:normal; }
  .referral-section .about-bottle-scene { display:none; }
}
@media (max-width:600px) {
  .referral-content { width:calc(100% - 40px); padding-top:32px; padding-bottom:12px; }
  .referral-content h2 { font-size:clamp(25px,6.5vw,34px); margin-bottom:22px; }
  .referral-fields { gap:10px 12px; }
  .referral-fields label,.referral-success label { font-size:14px; }
  .referral-fields input,.referral-link-row input { height:44px; margin-top:5px; padding:10px 13px; font-size:16px; }
  .referral-fields .referral-address { grid-column:span 8; }
  .referral-fields .referral-unit { grid-column:span 4; }
  .site .referral-section .referral-content .referral-how { margin:14px 0; }
  .site .referral-section .referral-content .referral-terms { margin-top:14px; }
  .referral-link-row { flex-wrap:wrap; }
  .referral-link-row input { flex-basis:100%; }
}
@media (prefers-reduced-motion:reduce) {
  .referral-fields input.is-shaking { animation:none; }
  .referral-section :is(button,input) { transition:none; }
}

/* The white Location surface begins at the referral frame's edge. */
.site .location { margin-top:0; }
.site-header .main-nav a[aria-current=location] { text-decoration:none; }

/* Mobile uses one short explanation; offer rules remain one tap away. */
.referral-copy-mobile,.referral-mobile-scatter { display:none; }
@media(max-width:600px) {
  .referral-copy-desktop,.referral-content > .referral-terms,.referral-content > .referral-privacy { display:none; }
  .referral-copy-mobile { display:inline; }
  .referral-form { position:relative; z-index:2; display:flex; flex-direction:column; }
  .site .referral-section .referral-content .referral-how { order:-1; margin:0 0 20px; font-size:16px; line-height:1.45; color:#ccc; }
  .referral-action-row { display:grid; grid-template-columns:max-content minmax(0,1fr); gap:12px; align-items:center; margin-top:30px; }
  .referral-form .referral-submit { position:relative; z-index:3; margin:0; min-height:46px; padding:12px 16px; font-size:14px; white-space:nowrap; }
  .referral-mobile-details { position:relative; z-index:2; display:block; width:max-content; min-height:44px; justify-self:end; margin:0; padding:11px 0; border:0; background:none; color:#bbb; font:inherit; font-size:14px; line-height:1.5; white-space:nowrap; text-decoration:underline; text-underline-offset:4px; cursor:pointer; }
  .referral-success { position:relative; z-index:3; }
}
/* Narrow tablets retain the same grid, spacing rhythm, and artwork anchor. */
@media(min-width:601px) and (max-width:900px) {
  .referral-section .about-stage { --frame-gutter:28px; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); column-gap:24px; }
  .referral-fields { gap:12px 10px; }
  .referral-fields input { padding-inline:10px; }
  .referral-fields .referral-address { grid-column:span 8; }
  .referral-fields .referral-unit { grid-column:span 4; }
  .referral-content .referral-submit { padding-inline:20px; }
  .referral-action-row { flex-wrap:wrap; gap:10px 16px; }
  .referral-content .referral-mobile-details { font-size:14px; }
}

/* The offline 3D pile fills the phone's bottom edge, outside the form. */
@media(max-width:600px) {
  .referral-mobile-scatter { position:relative; display:block; aspect-ratio:1200/474; width:calc(100% + 40px); margin:22px -20px 0; overflow:clip; pointer-events:none; }
  .referral-mobile-scatter img,.referral-mobile-scatter video { display:block; width:100%; height:100%; max-width:none; object-fit:contain; }
  .referral-mobile-scatter video { position:absolute; inset:0; visibility:hidden; }
  .referral-mobile-scatter.is-waiting img,.referral-mobile-scatter.has-film img { visibility:hidden; }
  .referral-mobile-scatter.has-film video { visibility:visible; }
}
@media(max-width:360px) {
  .referral-form .referral-submit { font-size:13px; padding-inline:12px; }
  .referral-mobile-details { font-size:13px; }
}
