/* Moonbay at night, and the paper objects visitors bring back from it. */
@media screen {
  :root { --port:#102537; --port-deep:#0c1e2c; --cream:#fbebcd; --amber:#ffd58a; --paper-ink:#372d28; --song:"Songti SC","STSong","Noto Serif CJK SC",SimSun,serif; }
  body { background:var(--port-deep); }
  .sky { background:radial-gradient(ellipse at 85% 0,#264151,transparent 54%),linear-gradient(150deg,#142d3b,#101d2e 80%); }
  .topbar { height:auto; min-height:calc(68px + env(safe-area-inset-top)); flex-wrap:wrap; padding-bottom:8px; padding-top:calc(8px + env(safe-area-inset-top)); row-gap:0; border-color:#c2b39439; }
  .brand { display:grid; grid-template-columns:30px auto; align-items:center; gap:2px 8px; flex-shrink:0; text-decoration:none; font:650 19px/1.1 var(--song); letter-spacing:.1em; color:var(--cream); }
  .brand small { font:8px/1.15 Georgia,serif; letter-spacing:.29em; color:#ead7ac; margin:0; }
  .harbor-mark { width:27px; height:31px; grid-row:span 2; border:1px solid #d7b572; border-radius:14px 14px 4px 4px; position:relative; overflow:hidden; }
  .harbor-mark::before { content:""; position:absolute; width:12px; height:12px; border-radius:100%; box-shadow:-3px 3px 0 #ffda92; left:8px; top:2px; transform:rotate(-18deg); }
  .harbor-mark::after { content:""; position:absolute; height:6px; left:3px; right:3px; bottom:4px; border-block:1px solid #d7b572; transform:skewY(-8deg); }
  .bar-links,.journey-actions:not([hidden]) { display:flex; align-items:center; flex-wrap:wrap; gap:0 13px; }
  .bar-links { justify-content:flex-end; margin-left:auto; }
  .journey-actions:not([hidden]) { padding:0; }
  .topbar .text-button { font-size:13px; color:#e5d5ba; }
  .app-shell:has(.port-landing),.app-shell:has(.loading-harbor) { max-width:1480px; border:0; padding:0 0 env(safe-area-inset-bottom); background:var(--port-deep); box-shadow:none; }
  .app-shell:has(.port-landing) .topbar,.app-shell:has(.loading-harbor) .topbar { margin:0; padding-inline:max(5%,env(safe-area-inset-left)); position:relative; z-index:2; background:#102536; }
  .app-shell:has(.port-landing) .site-foot { margin:0; padding:29px 20px 24px; color:#e5d8bf; background:#102130; }
  .port-landing { background:var(--port-deep); }
  .port-hero { isolation:isolate; position:relative; overflow:hidden; background:#112738; min-height:clamp(540px,55vw,790px); display:grid; align-items:center; }
  .harbor-scene { position:absolute; right:0; bottom:0; width:min(86%,1120px); aspect-ratio:1600/1150; z-index:-1; }
  .harbor-panorama { width:100%; height:100%; object-fit:fill; max-width:none; }
  .harbor-scene::after { content:""; position:absolute; inset:-1px; background:linear-gradient(90deg,#112738 0, #112738d4 9%,#11273854 28%,transparent 49%),linear-gradient(0deg,#0c1e2c 0,transparent 11%); pointer-events:none; }
  .port-lights { position:absolute; inset:0; z-index:1; pointer-events:none; }
  .window-pin { position:absolute; width:44px; height:44px; transform:translate(-50%,-50%); background:none; border:0; display:grid; place-items:center; pointer-events:auto; color:#fff1cf; }
  .window-pin i { height:13px; width:13px; border-radius:50%; border:1px solid #fff1be; display:grid; place-items:center; background:#a86121; box-shadow:0 0 11px 2px #ffd187; }
  .window-pin i::before { content:""; height:4px; width:4px; background:#fff7cd; border-radius:50%; }
  .window-pin i::after { content:""; position:absolute; height:23px; width:23px; border:1px solid #ffecc0; border-radius:50%; }
  .window-pin span { position:absolute; bottom:calc(50% + 17px); left:50%; transform:translateX(-50%); white-space:nowrap; border-radius:3px; font:600 12px/1.3 var(--song); background:#0e2536ea; padding:3px 7px; color:#ffe8ae; border:1px solid #eac7896b; opacity:0; }
  .window-pin:focus-visible span,.window-pin:hover span { opacity:1; }
  .stop-0 { left:45%; top:64%; }.stop-1 { left:72%; top:60%; }.stop-2 { left:84%; top:70%; }
  .port-copy { padding:62px 0 82px; margin-left:7.2%; width:min(44%,520px); pointer-events:none; }
  .place-line { display:inline-flex; align-items:center; gap:10px; font:600 14px/1.35 var(--song); letter-spacing:.21em; color:#f6d8a0; }
  .place-line i { width:29px; height:1px; position:relative; display:inline-block; background:currentColor; }
  .place-line i::after { content:""; position:absolute; right:0; width:5px; height:5px; top:-2px; background:currentColor; transform:rotate(45deg); }
  .port-copy h1 { font:600 clamp(48px,6vw,90px)/1.15 var(--song); color:#fff1d4; letter-spacing:-.06em; margin:20px 0 17px; text-shadow:0 2px 18px #10212d80; }
  .port-copy h1 em { font-style:normal; color:#ffdb96; }
  .port-copy > p { color:#eddfc7; font-size:16px; line-height:1.9; text-shadow:0 1px 6px #102231; }
  .port-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px 21px; margin-top:28px; pointer-events:auto; width:fit-content; }
  .boarding-action { isolation:isolate; display:inline-flex; align-items:stretch; justify-content:space-between; padding:0; color:#35291e; background:linear-gradient(110deg,#ffe2a7,#e9b967); border:0; border-radius:5px; box-shadow:0 4px 18px #05111e50; text-decoration:none; min-height:48px; font:700 18px/1.25 var(--song); }
  .boarding-action span { display:grid; place-items:center; padding:10px 23px; }
  .ticket-cut { position:relative; margin-block:3px; border-left:1px dashed #69482988; display:grid; place-items:center; width:31px; }
  .ticket-cut::before { content:""; width:14px; height:14px; border-radius:50%; border:1px solid #524433; }
  .ticket-cut::after { content:"✧"; color:#574536; font:15px/1 Georgia,serif; position:absolute; }
  .boarding-action:hover { filter:brightness(1.07); }
  .knock-link { min-height:46px; padding:6px 0; border:0; background:none; color:#fff0d4; text-decoration:underline; text-decoration-color:#d8b575; text-underline-offset:6px; font-size:15px; }
  .harbor-below { max-width:1040px; padding:60px 5% 36px; margin:auto; display:grid; grid-template-columns:1fr 1fr; gap:clamp(32px,7vw,88px); align-items:center; }
  .desk-note h2,.ticket-heading h2 { font:650 clamp(25px,3.1vw,38px)/1.35 var(--song); letter-spacing:-.04em; }
  .desk-note h2 { margin:13px 0; color:var(--cream); }
  .desk-note p { color:#d5d9d4; line-height:1.9; font-size:15px; }
  .desk-note .desk-sign { text-align:right; color:#e6cb94; margin-top:10px; font:16px/1.5 var(--song); }
  .port-ticket { color-scheme:light; color:var(--paper-ink); background:linear-gradient(125deg,#f9edcf,#e8d4ad); border:1px solid #dac19b; border-radius:5px; box-shadow:0 9px 27px #06121d65; padding:20px clamp(18px,3vw,30px); }
  .ticket-heading { padding-bottom:14px; margin-bottom:13px; border-bottom:1px dashed #886f53; }
  .ticket-heading small,.paper-kicker { color:#73543d; letter-spacing:.15em; font:650 12px/1.4 var(--sans); }
  .ticket-heading h2 { margin-top:4px; font-size:25px; }
  .port-ticket label { color:#49392d; font-size:14px; }
  .port-ticket .key-input { color:#342a25; background:#fff8e4b0; border:1px solid #96815f; border-radius:4px; }
  .port-ticket .key-input::placeholder { color:#786957; }
  .port-ticket .primary { border-radius:5px; background:#26483f; color:#ffefce; border:1px solid #234137; box-shadow:none; }
  .port-ticket .tiny,.return-note { color:#65523e; font-size:13px; }
  .port-ticket .error { color:#8b2b26; }
  .return-note { margin-bottom:12px; }
  .entry-fine { max-width:920px; margin:auto; border-top:1px solid #bcb09242; padding:10px 0 18px; color:#c3c6be; font-size:14px; }
  .entry-fine summary { cursor:pointer; padding:8px 0; color:#dfd2b9; }
  .entry-fine p { padding:7px 0; }
  .loading-harbor { min-height:68svh; align-items:end; padding:24px; background:linear-gradient(0deg,#0c1e2c 0,transparent 33%),url("/art/moonbay-harbor.webp") center / cover; }
  dialog:has(.window-letter) { width:min(440px,calc(100% - 30px)); max-width:none; padding:0; border:0; border-radius:8px; color-scheme:light; background:#f8ebcc; box-shadow:0 15px 70px #050d1caa; }
  dialog:has(.window-letter)::backdrop { background:#051422bf; backdrop-filter:blur(4px); }
  dialog:has(.window-letter) .dialog-close { color:#54402e; background:#f8edcf; border-color:#93765277; top:9px; right:10px; }
  .window-letter { padding:25px 24px 17px; color:var(--paper-ink); background:linear-gradient(125deg,#fbefd2,#ebd7b6); border-top:6px solid transparent; border-image:repeating-linear-gradient(120deg,#a35c46 0 11px,#eddfbf 11px 18px,#427276 18px 29px,#eddfbf 29px 36px) 6; }
  .postcard-top { margin:18px 0 14px; padding-bottom:13px; display:flex; align-items:center; justify-content:space-between; gap:8px; border-bottom:1px solid #a386605e; }
  .postcard-top span { color:#745f4d; font-size:13px; }
  .window-letter h2 { color:#42352d; font:700 clamp(26px,7.4vw,36px)/1.2 var(--song); margin:5px 0; outline:none; }
  .resident-stamp { width:92px; padding:5px; transform:rotate(5deg); background:#fdf7df; border:2px dashed #ab916e; }
  .resident-stamp img { width:100%; height:auto; object-fit:contain; mix-blend-mode:multiply; border:1px solid #bbaa83; }
  .window-letter h3 { font:650 19px/1.5 var(--song); color:#3d342c; margin-bottom:7px; }
  .window-story { color:#59493d; font-size:16px; line-height:1.85; }
  .window-letter blockquote { margin:15px 0 19px; color:#365447; font:650 18px/1.7 var(--song); }
  .postcard-foot { display:flex; justify-content:space-between; gap:10px; align-items:center; border-top:1px dashed #9d805b; padding-top:8px; }
  .postcard-foot button { border:0; background:none; color:#574436; min-height:44px; font-size:14px; padding:5px 0; }
  .postcard-foot button:first-child { color:#2b5048; font-weight:700; }
}
@media screen and (max-width:679px) {
  .app-shell:has(.port-landing) .topbar,.app-shell:has(.loading-harbor) .topbar { padding-inline:max(21px,env(safe-area-inset-left)); }
  .port-hero { min-height:0; display:block; height:clamp(506px,calc(64vw + 290px),680px); }
  .harbor-scene { width:117%; right:-7%; bottom:53px; }
  .harbor-scene::after { background:linear-gradient(180deg,#112738 0%,#11273888 8%,transparent 22%),linear-gradient(0deg,#0c1e2c 0%,#0c1e2c18 13%,transparent 26%); }
  .port-hero { background:linear-gradient(#112738 40%,#0c1e2c); }
  .port-copy { padding:0; pointer-events:none; margin:0; width:100%; height:100%; }
  .port-copy > .place-line,.port-copy h1,.port-copy > p { position:relative; margin-left:max(7%,env(safe-area-inset-left)); }
  .port-copy > .place-line { margin-top:24px; font-size:13px; }
  .port-copy h1 { font-size:clamp(43px,11vw,66px); margin-top:9px; margin-bottom:9px; line-height:1.12; letter-spacing:-.045em; }
  .port-copy > p { font-size:14px; line-height:1.65; max-width:72%; }
  .port-actions { position:absolute; left:7%; right:7%; bottom:12px; margin:0; gap:18px; }
  .harbor-below { padding:16px 7% 24px; display:flex; flex-direction:column; gap:25px; align-items:stretch; }
  .port-ticket { order:-1; }
  .desk-note { padding:5px 0; }
  .entry-fine { margin:0 7%; }
  .bar-links,.journey-actions:not([hidden]) { gap:0 9px; }
  .app-shell:has(.port-landing) #use-new-code { display:none; }
}
@media screen and (max-width:370px) {
  .port-copy > .place-line { margin-top:18px; }
  .topbar { column-gap:4px; }
  .brand { font-size:16px; grid-template-columns:24px auto; column-gap:6px; }
  .harbor-mark { width:23px; height:27px; }
  .topbar .text-button { font-size:12px; }
  .port-actions { gap:13px; }
}
@media screen and (min-width:680px) and (max-width:1040px) { .entry-fine { margin-inline:5%; } }
@media (prefers-reduced-motion:no-preference) {
  .window-pin i::after { animation:ripple 3.4s ease-out infinite; }
  .stop-1 i::after { animation-delay:1.05s; }.stop-2 i::after { animation-delay:2.1s; }
  @keyframes ripple { 0%,12% { transform:scale(.56); opacity:1; } 68%,100% { transform:scale(1.4); opacity:0; } }
}
@media screen {
  .letter-ritual { text-align:center; padding:24px 0 12px; }
  .letter-heading h1 { font:650 clamp(31px,8.5vw,48px)/1.28 var(--song); letter-spacing:-.035em; margin:10px 0 6px; color:var(--cream); }
  .letter-heading p,.arrival-note { font-size:14px; color:#d1d6ce; }
  .letter-stage { margin:16px 0 8px; position:relative; isolation:isolate; display:grid; place-items:center; height:clamp(260px,74vw,372px); }
  .letter-view { position:absolute; inset:0 calc(-1 * min(22px,4vw)); z-index:-1; background:linear-gradient(180deg,#152a3b 0%,transparent 23%,transparent 64%,#142636 100%),url("/art/moonbay-harbor.webp") center 64% / cover; border-radius:14px; opacity:.78; }
  .sealed-letter { display:block; isolation:isolate; position:relative; width:min(79%,330px); aspect-ratio:1.5; padding:0; border:0; background:none; perspective:900px; color:#584538; transform:rotate(-4deg); filter:drop-shadow(0 13px 11px #09142199); outline-offset:8px; }
  .mailer-back,.mailer-flap,.mailer-folds { position:absolute; inset:0; pointer-events:none; }
  .mailer-back { border-radius:3px; border:1px solid #c2a279; background:linear-gradient(135deg,#e8cfa7,#c39f72); }
  .mailer-folds { background:conic-gradient(from 90deg at 50% 50%,#e2c59c 0deg 55deg,#f7e2b9 56deg 124deg,#d7b58c 125deg 179deg,transparent 180deg); border-radius:3px; }
  .mailer-flap { clip-path:polygon(0 0,100% 0,100% 2%,51% 58%,49% 58%,0 2%); background:linear-gradient(169deg,#fff0c8 0%,#e4c7a0 49%,#af8d60 73%); transform-origin:top; transition:transform .38s ease,filter .3s; }
  .wax-seal { position:absolute; left:50%; top:54%; transform:translate(-50%,-50%) rotate(12deg); display:grid; place-items:center; width:clamp(45px,12vw,59px); aspect-ratio:1; border-radius:48% 41% 44% 49% / 45% 49% 40% 48%; background:radial-gradient(at 31% 22%,#cc7757 0,#a34339 38%,#7c342e 65%,#bc6a49 79%,#803e32 95%); box-shadow:1px 3px 3px #5c36246b,inset 0 1px 1px #e8a477; transition:transform .3s,opacity .24s; }
  .wax-seal i { display:grid; place-items:center; border:1px solid #e69b70; border-radius:50%; width:74%; height:74%; font:30px/1 Georgia,serif; color:#ffd49a; text-shadow:0 1px 0 #663329; box-shadow:0 0 0 1px #873e32; }
  .letter-address { position:absolute; left:9%; bottom:13%; font:600 clamp(13px,3.8vw,17px)/1.4 var(--song); color:#564031; letter-spacing:.08em; }
  .letter-open { position:absolute; right:7%; bottom:8%; color:#6a4538; font:600 clamp(11px,2.9vw,13px)/1.4 var(--song); border-bottom:1px solid #a7785d; padding-bottom:1px; }
  .sealed-letter.turning { opacity:1; }
  .sealed-letter.turning .mailer-flap { transform:rotateX(165deg); filter:brightness(.93); }
  .sealed-letter.turning .wax-seal { opacity:0; transform:translate(-45%,-65%) rotate(26deg) scale(1.14); }
  .mail-in-flight { width:100px; aspect-ratio:1.6; position:relative; background:#eed4a7; border:1px solid #9c7653; box-shadow:0 7px 13px #0a122166; transform:rotate(-11deg); }
  .mail-in-flight i { position:absolute; inset:0; background:linear-gradient(155deg,#ffebc2,#d0ad7f); clip-path:polygon(0 0,100% 0,50% 67%); }
  .letter-ritual > .secondary { min-width:140px; }
  .result-page .reveal-summary { color-scheme:light; color:#443b31; border:0; border-radius:5px; padding:25px 19px 19px; background:linear-gradient(155deg,#fff1d1 2%,#eedbbc 68%,#e9d4b0); box-shadow:0 12px 26px #07172170; border-top:6px solid transparent; border-image:repeating-linear-gradient(122deg,#ae6550 0 16px,#e8dbbb 16px 23px,#568185 23px 39px,#e8dbbb 39px 46px) 6; }
  .result-page .reveal-summary::before { display:none; }
  .reveal-summary .eyebrow { color:#785139; font:600 13px/1.4 var(--song); letter-spacing:.16em; }
  .reveal-summary h1 { position:relative; color:#3e3c30; font:650 clamp(27px,7.3vw,39px)/1.35 var(--song); }
  .reveal-summary > p:last-of-type { position:relative; color:#5a5042; }
  .result-postmark { position:absolute; right:-18px; top:-4px; opacity:.25; border:3px double #865841; border-radius:50%; width:82px; height:82px; display:grid; place-items:center; transform:rotate(14deg); }
  .result-postmark i { font:42px/1 Georgia,serif; color:#865841; }
  .result-postmark::before { content:""; position:absolute; right:58px; top:31px; width:58px; height:6px; border-block:1px solid #865841; }
  .reveal-gallery { flex-wrap:wrap; gap:12px; margin:18px 0 23px; }
  .reveal-gallery .reveal-portrait { overflow:visible; padding:7px 5px 3px; border:2px dashed #af9369; border-radius:1px; flex:0 1 124px; background:#fffae9; box-shadow:1px 4px 8px #5b4b332a; transform:rotate(-2deg); }
  .reveal-gallery .reveal-portrait:nth-child(2n) { transform:rotate(2deg); }
  .reveal-gallery .reveal-portrait img { object-fit:contain; height:clamp(75px,23vw,105px); background:#f3ead2; border:1px solid #b59c794d; }
  .reveal-gallery .reveal-portrait>span { color:#524438; font:650 15px/1.3 var(--song); }
  .reveal-gallery.one-resident .reveal-portrait { flex-basis:172px; border-radius:1px; }
  .reveal-gallery.one-resident img { height:145px; }
  .reveal-summary .primary { background:#294b43; color:#fff3d9; border:1px solid #27453e; border-radius:5px; box-shadow:none; }
  .reveal-summary .secondary { background:transparent; color:#544532; border-color:#8d7b60; border-radius:5px; }
  .reveal-summary .reveal-peek { background:#b1956921; color:#534536; border:0; border-left:2px solid #977956; border-radius:0; }
  .reveal-summary .reveal-peek span { color:#725736; }
  .reveal-moon { color:#9d6734; background:#ead1a0; border-color:#b39562; }
  .journal-cover { background:linear-gradient(0deg,#10283cf5 0%,#102537bb 53%,#10253744),url("/art/moonbay-harbor.webp") center 72% / cover; }
  .journal-stamp { margin:0 auto 7px; width:23px; height:24px; display:block; border-radius:50%; box-shadow:-5px 4px 0 #ffe5a4; transform:rotate(-16deg); }
  .question-card { border-radius:5px; border-left:4px solid #8c9c83; box-shadow:2px 4px 0 -1px #ad9d7f; }
  .question-card::before { content:""; height:9px; width:31px; border-block:1px solid #ae9571; transform:rotate(-9deg); }
  .question-card .eyebrow { font-size:13px; letter-spacing:.12em; }
  .question-card h1 { font-family:var(--song); }
}
@media (prefers-reduced-motion:no-preference) {
  .mail-in-flight { animation:letter-arrival 1.8s ease-out both; }
  @keyframes letter-arrival { from { opacity:.2; transform:translate(68%,-30%) rotate(12deg) scale(.5); } to { opacity:1; transform:translate(0,0) rotate(-11deg); } }
  .sealed-letter:not(.turning):hover .wax-seal { transform:translate(-50%,-56%) rotate(7deg); }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  .result-page,.window-pin i::after,.sealed-letter *,.mail-in-flight { animation:none!important; transition:none!important; }
}
@media screen {
  .mailer-folds { overflow:hidden; background:linear-gradient(104deg,#e0c198 0%,#edd2ab 52%,#dfbf94 100%); }
  .mailer-folds::before { content:""; position:absolute; inset:0; clip-path:polygon(0% 100%,49% 40%,51% 40%,100% 100%); background:linear-gradient(165deg,#c8aa84 5%,#eed3a9 55%,#f6e1bb 100%); }
  .reveal-summary h1 span { display:block; }
  .reveal-summary .reveal-peek strong { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; white-space:normal; line-height:1.6; }
  .reveal-gallery.many-residents { flex-wrap:nowrap; justify-content:flex-start; overflow-x:auto; scroll-snap-type:x proximity; padding:7px 8px 10px; margin-bottom:0; scrollbar-color:#a38d6a transparent; }
  .many-residents .reveal-portrait { flex:0 0 112px; scroll-snap-align:center; }
  .result-page .gallery-note { margin:4px 0 13px; font-size:13px; color:#705d48; }
  .stop-0 { left:50.9%; top:64.2%; }
  .stop-1 { left:70.1%; top:48.5%; }
  .stop-2 { left:82.8%; top:57.5%; }
}
@media screen {
  .harbor-ferry { position:absolute; left:38%; top:69.565217%; width:29%; height:19.478261%; pointer-events:none; }
  .port-actions a.knock-link { display:inline-flex; align-items:center; }
}
@media (prefers-reduced-motion:no-preference) {
  .harbor-ferry { animation:ferry-docks 3.8s cubic-bezier(.19,.6,.23,1) both; }
  @keyframes ferry-docks { from { transform:translate(-32%,1.5%) rotate(-1deg); } 65% { transform:translate(-4%,0%) rotate(.4deg); } to { transform:none; } }
}
