/* Departure pages (it, photography, nature, return_to_harbour): loaded after harbour-fit.css.
   The page background, logo, countdown and sounds stay; around them a premium nautical departure:
   the logo framed as an ivory plate, and a "departure log" with the Compass Mind instrument at its heart.
   --dep-accent is the destination's colour (departure.js). The page still never scrolls (harbour-fit.css). */

body.departure{--dep-accent:#c9aa6a;--dep-gold:#c9aa6a;--dep-ivory:#f7f0e2;}

/* ---------- The logo as an ivory plate in a gold frame ---------- */
body.departure .logo{
  border-radius:3px;
  box-shadow:0 0 0 clamp(6px,1.2vh,12px) #fbf8f1,0 0 0 calc(clamp(6px,1.2vh,12px) + 1px) rgba(169,132,63,.8),
    0 0 0 calc(clamp(6px,1.2vh,12px) + 6px) #fbf8f1,0 0 0 calc(clamp(6px,1.2vh,12px) + 7px) rgba(169,132,63,.45),
    0 30px 70px rgba(4,12,24,.35),0 8px 20px rgba(4,12,24,.18)!important;
  filter:none!important;
}

/* ---------- The departure log ---------- */
body.departure .content{
  position:relative;isolation:isolate;box-sizing:border-box;
  width:min(520px,100%)!important;padding:clamp(16px,3.2vh,34px) clamp(18px,3vw,38px) clamp(14px,2.8vh,30px);
  border-radius:22px;color:var(--dep-ivory);
  background:
    repeating-linear-gradient(0deg,rgba(255,255,255,.025) 0 1px,transparent 1px 36px),
    repeating-linear-gradient(90deg,rgba(255,255,255,.025) 0 1px,transparent 1px 36px),
    radial-gradient(circle at 50% 0%,color-mix(in srgb,var(--dep-accent) 22%,transparent),transparent 60%),
    linear-gradient(160deg,rgba(7,20,38,.86),rgba(4,12,26,.92));
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  border:1px solid rgba(201,170,106,.6);
  outline:1px solid rgba(201,170,106,.22);outline-offset:-8px;
  box-shadow:0 30px 80px rgba(2,8,18,.45),0 0 50px color-mix(in srgb,var(--dep-accent) 14%,transparent);
}
body.departure .departure-kicker{margin:0 0 clamp(4px,1vh,10px);font-size:11px;font-weight:900;letter-spacing:.26em;text-transform:uppercase;color:var(--dep-gold);}
body.departure h1{margin:0;font-style:italic!important;font-size:clamp(26px,min(5.4vh,7vw),48px)!important;letter-spacing:-.01em!important;color:var(--dep-ivory);text-shadow:none;}
body.departure .message{color:rgba(247,240,226,.78)!important;}
body.departure .message strong{color:var(--dep-ivory);}
body.departure .transition{width:100%!important;}
body.departure .trail-awaits{color:#f2d99b!important;}

/* ---------- The Compass Mind instrument ---------- */
.departure-dial{width:clamp(96px,23vh,200px);aspect-ratio:1;margin:0 auto;}
.departure-dial>svg{display:block;width:100%;height:100%;overflow:visible;}
.dep-track{fill:rgba(2,8,18,.35);stroke:rgba(255,255,255,.12);stroke-width:3;}
.dep-progress{fill:none;stroke:var(--dep-accent);stroke-width:3.6;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:1;
  filter:drop-shadow(0 0 6px var(--dep-accent));animation:depFill 15s linear forwards;}
@keyframes depFill{to{stroke-dashoffset:0}}
.dep-ticks line{stroke:rgba(242,217,155,.38);stroke-width:1;}
.dep-ticks line.is-major{stroke:#e9cf8f;stroke-width:2;}
.dep-cardinals text{fill:#e9cf8f;font:italic 400 13px "Harbour Serif",Georgia,"Times New Roman",serif;text-anchor:middle;}
.dep-compass{overflow:visible;filter:drop-shadow(0 10px 22px rgba(0,0,0,.45));}
.dep-tremble{transform-box:view-box;transform-origin:32px 32px;animation:depTremble 3.2s ease-in-out 2.6s infinite;}
@keyframes depTremble{0%,100%{transform:rotate(0)}30%{transform:rotate(1.6deg)}65%{transform:rotate(-1.2deg)}}
/* arrived: the ring glows and the needle is still */
.transition.is-complete .dep-progress{filter:drop-shadow(0 0 12px var(--dep-accent));}
.transition.is-complete .dep-tremble{animation:none;}

/* The Compass Mind speaks */
.departure-mind{margin:clamp(6px,1.4vh,14px) auto 0;max-width:400px;font:italic 400 clamp(13px,1.9vh,16px)/1.45 "Harbour Serif",Georgia,"Times New Roman",serif;color:rgba(247,240,226,.86);}
.departure-mind__who{display:block;margin-bottom:3px;font:900 11px/1.2 Inter,system-ui,"Segoe UI",Arial,sans-serif;letter-spacing:.24em;text-transform:uppercase;color:var(--dep-accent);}
body.departure .seconds-line{color:rgba(247,240,226,.7)!important;}
body.departure .final-message{color:#f2d99b!important;}

/* ---------- Actions: gold, like the chart plates on the harbour ---------- */
body.departure .early-access-btn,body.departure .return-harbour-button{
  background:linear-gradient(135deg,#f4dfa6,#c9aa6a 55%,#a9843f)!important;color:#07111c!important;border:0!important;
  box-shadow:0 14px 30px rgba(0,0,0,.35),inset 0 0 0 1px rgba(255,255,255,.3),0 0 26px color-mix(in srgb,var(--dep-accent) 30%,transparent)!important;
  text-shadow:none!important;
}
body.departure .early-access-btn *,body.departure .return-harbour-button *{color:inherit!important;}

/* ---------- What awaits: a short line, three points and the opening date, and the way back to the harbour ---------- */
.departure-info{margin:clamp(6px,1.4vh,14px) auto 0;max-width:420px;}
.departure-about{margin:0;font-size:clamp(12px,1.7vh,15px);line-height:1.45;color:rgba(247,240,226,.82);}
.departure-tiles{display:flex;justify-content:center;gap:clamp(6px,1.2vw,10px);margin:clamp(6px,1.2vh,10px) 0 0;padding:0;list-style:none;}
.departure-tiles li{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:clamp(70px,6.4vw,92px);padding:clamp(4px,.9vh,8px) 4px;border:1px solid color-mix(in srgb,var(--dep-accent) 55%,transparent);border-radius:12px;background:rgba(255,255,255,.05);}
.departure-tiles img{height:clamp(18px,3.2vh,28px);width:auto;max-width:100%;object-fit:contain;}
.departure-tiles span{font-size:10px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--dep-ivory);line-height:1.2;text-align:center;}
/* the opening date as a small calendar leaf */
.departure-tiles .departure-date{border-color:#f2d99b;background:linear-gradient(160deg,rgba(242,217,155,.2),rgba(242,217,155,.06));}
.departure-tiles .departure-date b{letter-spacing:0;text-transform:none;font:italic 400 clamp(20px,3.6vh,28px)/1 "Harbour Serif",Georgia,"Times New Roman",serif;color:#f2d99b;}
.departure-date span{color:#f2d99b;}
.departure-guide{margin:clamp(2px,.6vh,6px) 0 0;font-size:12px;line-height:1.45;color:rgba(247,240,226,.7);}
.departure-guide strong{margin-right:6px;font-size:10px;font-weight:900;letter-spacing:.22em;text-transform:uppercase;color:var(--dep-accent);}
body.departure .message strong{color:#f2d99b;}
/* the countdown: the ring breathes, the seconds sit as a badge on its lower edge */
.dep-track{animation:depBreathe 3.6s ease-in-out infinite;}
@keyframes depBreathe{0%,100%{stroke:rgba(255,255,255,.12)}50%{stroke:color-mix(in srgb,var(--dep-accent) 55%,transparent)}}
body.departure .seconds-line{position:relative;z-index:2;display:inline-flex;align-items:baseline;gap:6px;margin-top:calc(-1 * clamp(10px,1.8vh,16px))!important;padding:3px 16px 4px;border:1px solid var(--dep-gold);border-radius:999px;background:rgba(4,12,26,.94);font-size:10px!important;letter-spacing:.2em!important;}
body.departure .seconds-line span{font:italic 400 clamp(20px,3.4vh,26px)/1 "Harbour Serif",Georgia,"Times New Roman",serif;letter-spacing:0;color:#f2d99b!important;min-width:1.2ch;text-align:center;}
@media (min-width:900px) and (max-height:900px){.departure-dial{width:clamp(96px,19vh,200px);}}
@media (min-width:900px) and (max-height:1000px){.departure-about{display:none;}}
@media (min-width:900px) and (max-height:640px){.departure-tiles li:not(.departure-date){display:none;}}
.stay-harbour-btn{display:inline-block;margin-top:clamp(6px,1.4vh,12px);padding:6px 10px;font-size:12px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:rgba(247,240,226,.82);text-decoration:none;border-bottom:1px solid rgba(201,170,106,.5);}
.stay-harbour-btn:hover,.stay-harbour-btn:focus-visible{color:#fff;border-bottom-color:#f2d99b;}

/* the route strip: the Compass Mind sails from the harbour to the destination while the ring fills */
.departure-route{margin:clamp(4px,1vh,8px) auto 0;max-width:380px;}
.dep-route{display:block;width:100%;height:auto;overflow:visible;}
.dep-route-line{fill:none;stroke:rgba(242,217,155,.4);stroke-width:1.6;stroke-dasharray:2 6;stroke-linecap:round;}
.dep-route-wake{fill:none;stroke:var(--dep-accent);stroke-width:2.6;stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:100;filter:drop-shadow(0 0 4px var(--dep-accent));animation:depWake 15s linear forwards;}
@keyframes depWake{to{stroke-dashoffset:0}}
.dep-node-disc{fill:#f8efd2;stroke:var(--dep-gold);stroke-width:1.6;}
.dep-node-pulse{fill:none;stroke:rgba(242,217,155,.5);stroke-width:1.2;transform-box:fill-box;transform-origin:center;}
.dep-node-from .dep-node-pulse{animation:depNodePulse 2.8s ease-out infinite;}
.dep-route.is-docked .dep-node-to .dep-node-pulse{animation:depNodePulse 2.8s ease-out infinite;stroke:var(--dep-accent);}
@keyframes depNodePulse{0%{opacity:.9;transform:scale(.6)}100%{opacity:0;transform:scale(2)}}
.dep-node text{fill:rgba(247,240,226,.86);font:italic 400 11px "Harbour Serif",Georgia,"Times New Roman",serif;}
.dep-ship{filter:drop-shadow(0 3px 5px rgba(0,0,0,.5));}
.dep-ship .cm-needle{transform-box:view-box;transform-origin:32px 32px;}

/* the harbour page: brand tiles are links, plus the things only the harbour has */
.departure-tiles a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%;height:100%;color:inherit;text-decoration:none;}
.departure-tiles--worlds li{width:clamp(92px,8.4vw,118px);padding:0;}
.departure-tiles--worlds a{padding:clamp(4px,.9vh,8px) 4px;}
.departure-tiles--worlds li:hover,.departure-tiles--worlds li:focus-within{border-color:#f2d99b;background:rgba(242,217,155,.12);}
.departure-tiles b{font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:var(--dep-ivory);}
.departure-tiles a span{font-size:10px;font-weight:700;letter-spacing:.06em;color:rgba(247,240,226,.7);text-transform:none;}
.departure-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:clamp(6px,1.2vh,10px) 0 0;padding:0;list-style:none;}
.departure-chips a{display:block;padding:3px 11px;border:1px solid rgba(201,170,106,.5);border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:rgba(247,240,226,.86);text-decoration:none;}
.departure-chips a:hover,.departure-chips a:focus-visible{border-color:#f2d99b;color:#fff;}
@media (min-width:900px) and (max-height:860px){.departure-chips{display:none;}}

/* ---------- Sound toggle as a brass-trimmed pill ---------- */
body.departure .forest-sound-toggle{
  background:linear-gradient(160deg,rgba(7,20,38,.86),rgba(4,12,26,.92))!important;border:1px solid rgba(201,170,106,.55)!important;
  color:var(--dep-ivory)!important;box-shadow:0 14px 34px rgba(2,8,18,.35)!important;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
}

/* ---------- Wide screens: logo on the left, the departure log on the right ---------- */
@media (min-width:900px) and (min-height:560px){
  body.departure{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;column-gap:clamp(24px,4vw,70px);}
  body.departure .header{grid-column:1;grid-row:1;justify-content:flex-end!important;padding:clamp(10px,3vh,40px) 0 clamp(10px,3vh,40px) 4vw!important;}
  body.departure .logo-stage{max-height:min(470px,100%)!important;}
  body.departure main{grid-column:2;grid-row:1;justify-content:flex-start!important;padding:clamp(10px,3vh,40px) 4vw clamp(10px,3vh,40px) 0!important;}
  body.departure .site-footer{grid-column:1/-1;grid-row:2;}
}
/* Phones and narrow or low screens: the page may scroll and everything flows in one calm column,
   so nothing is squeezed on top of anything else (this overrides the fit-to-screen rules of harbour-fit.css).
   Order: logo plate, departure log, footer. The compass orb (top right), the sound pill (bottom left) and the
   page-code seal (bottom right) are fixed and get their own corner. */
@media (max-width:899px),(max-height:559px){
  html{height:auto!important;min-height:100%;overflow-x:hidden!important;overflow-y:auto!important;}
  body.departure{height:auto!important;min-height:100vh!important;min-height:100dvh!important;overflow-x:hidden!important;overflow-y:auto!important;display:flex!important;flex-direction:column!important;}

  body.departure .header{flex:0 0 auto!important;height:auto!important;padding:calc(84px + env(safe-area-inset-top,0px)) 20px 8px!important;}
  body.departure .logo-stage{height:auto!important;max-height:none!important;padding:0!important;}
  body.departure .logo{width:min(56vw,240px)!important;height:auto!important;max-width:none!important;max-height:none!important;}
  body.departure .fireflies{inset:-40px -50px;}

  body.departure main{flex:1 0 auto!important;align-items:flex-start!important;padding:22px 14px 28px!important;}
  body.departure .content{width:min(520px,100%)!important;padding:22px 18px 20px;border-radius:20px;}
  body.departure .departure-kicker{margin-bottom:8px;font-size:11px;letter-spacing:.2em;line-height:1.5;}
  body.departure h1{font-size:clamp(28px,9vw,40px)!important;line-height:1.1!important;}
  body.departure .message{margin-top:10px!important;font-size:clamp(14px,4vw,16px)!important;line-height:1.5;}
  body.departure .transition{margin-top:20px!important;}
  body.departure .trail-awaits{margin-bottom:10px!important;font-size:14px!important;}
  .departure-dial{width:clamp(120px,36vw,150px);}
  body.departure .seconds-line{margin-top:12px!important;font-size:12px!important;}
  .departure-mind{margin-top:12px;font-size:15px;line-height:1.5;}
  body.departure .final-message{margin-top:12px!important;font-size:12px!important;line-height:1.5;}
  body.departure .early-access-btn,body.departure .return-harbour-button{width:100%!important;max-width:320px;min-height:50px!important;margin-top:16px!important;}

  /* the sound pill keeps the bottom left corner; the page-code seal moves to the right */
  .hero-code-beacon{left:auto;right:14px;}
  body.departure .site-footer,.hx-footer.hx-footer--fit{flex:0 0 auto!important;}
}
/* A phone on its side: logo on the left, the log on the right, still scrollable */
@media (max-height:559px) and (min-width:640px){
  body.departure{display:grid!important;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);grid-template-rows:auto auto;align-items:start;column-gap:24px;}
  body.departure .header{grid-column:1;grid-row:1;padding:20px 0 20px 24px!important;position:sticky;top:0;}
  body.departure .logo{width:min(34vw,200px)!important;}
  body.departure main{grid-column:2;grid-row:1;padding:20px 80px 20px 0!important;}
  body.departure .site-footer,.hx-footer.hx-footer--fit{grid-column:1/-1;grid-row:2;}
}

@media (prefers-reduced-motion:reduce){
  .dep-track,.dep-node-pulse{animation:none;}
  .dep-route-wake{animation:none;stroke-dashoffset:0;}
  .dep-tremble{animation:none;}
  .dep-progress{animation-duration:15s;}
}
