/* One Man Fleet: homepage hero (approved public fix 6, owner 14 Nov 2026 "ใช้ได้ ทำลงเว็บจริง"). Served at
   /omf/home/hero.css and linked only by src/server/site/home-hero.ts on pages that hold the homepage hero. Loaded after
   the accepted proto.css. Every rule is scoped to #hero, so nothing outside the hero can change.
   The hero is a fixed stage the page scales as one piece (1440 x 900 when wide, 430 x 860 when data-l="tall"); the
   numbers below are stage coordinates. Colour modes: html[data-theme] holds the mode in use (light / dark), whatever
   the visitor's choice in data-mode (system / light / dark). */

/* ---------- 1. the names of the two big ships ---------- */
/* Thai names use the page's Thai face; English names keep the accepted face. */
.lang-th #hero .stage .big h2.hh-name { font-family: "Noto Sans Thai", sans-serif; font-weight: 500; letter-spacing: 0; }
/* Tall layout: the names sit next to their ships, and the descriptions are not shown. */
#hero .stage[data-l="tall"] .big { top: 300px; }
#hero .stage[data-l="tall"] .big p { display: none; }
/* Tall layout in light mode: the sky behind the moved names is pale (white measured 2.7:1), so they use dark ink. */
html[data-theme="light"] #hero .stage[data-l="tall"] .big h2.hh-name { color: #14152B; font-weight: 600; }

/* ---------- 2. the newsletter button (the supporting sentence above it was taken off, owner 17 Nov 2026) ---------- */
#hero .hh-pitch { margin: 0; color: #fff; text-align: center; font-family: "Noto Sans Thai", "Inter", sans-serif; opacity: var(--hh-head, 1); transform: translateY(var(--hh-rise, 0px)); }
.lang-en #hero .hh-pitch, .lang-en #hero .hh-fleet { font-family: "Inter", "Noto Sans Thai", sans-serif; }
/* White 15px on the bright --red measures only 4.24:1; on --red-text (#B31C13) it passes WCAG AA. */
#hero .hh-cta { display: inline-flex; align-items: center; gap: 9px; margin-top: 16px; padding: 13px 19px; border-radius: 0; background: var(--red-text, #B31C13); color: #fff; font-size: 15px; font-weight: 600; line-height: 1; text-decoration: none; pointer-events: auto; }
/* A ring that shows on the dark sea and on the pale day sky alike: white inside, dark outside. */
#hero .hh-cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 0; box-shadow: 0 0 0 6px #14152B; }
#hero .stage[data-l="wide"] .hh-pitch { left: 480px; top: 262px; width: 480px; }
#hero .stage[data-l="tall"] .hh-pitch { left: 20px; top: 206px; width: 390px; }
#hero .stage[data-l="tall"] .hh-cta { margin-top: 9px; padding: 10px 16px; font-size: 14px; }

/* ---------- 3. the caption under the five small ships ---------- */
#hero .hh-fleet { margin: 0; color: #fff; text-align: center; font-family: "Noto Sans Thai", "Inter", sans-serif; font-size: 13.5px; font-weight: 400; line-height: 1.3; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); opacity: var(--hh-fleet, 1); }
#hero .stage[data-l="wide"] .hh-fleet { left: 420px; top: 846px; width: 600px; }
#hero .stage[data-l="tall"] .hh-fleet { left: 20px; top: 806px; width: 390px; font-size: 12.5px; }

/* ---------- 4. before the page has placed the stage, and without JavaScript ---------- */
/* With scripts the stage is placed a moment after the first paint; until then these wait like the ship names do. */
@media (scripting: enabled) {
  #hero .stage:not([data-placed]) .hh-pitch, #hero .stage:not([data-placed]) .hh-fleet, #hero .stage:not([data-placed]) .hh-alive { visibility: hidden; }
}
/* Without scripts the accepted page turns the stage into a plain column (its <noscript> style); these follow it. */
@media (scripting: none) {
  #hero .hh-pitch { max-width: 560px; margin: 4px auto 22px; }
  #hero .hh-fleet { margin-top: 14px; }
}

/* ---------- 5. leaving with the scene as the page scrolls (set by hero.js, in step with the page's own script) ---------- */
#hero .stage.hh-head-gone .hh-pitch, #hero .stage.hh-fleet-gone .hh-fleet { visibility: hidden; }

/* ---------- 6. the looping headline (hero.js) ---------- */
/* The owner's line for screen readers while the visible words change. */
#hero .hh-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* The line that is leaving: a copy the visitor cannot point at. */
#hero .stage .hh-ghost { pointer-events: none; }
/* While the loop draws the red route line, its point of light keeps the page's own position
   (left: (100% - last word - 10px) x route) but gets there by transform, so no frame needs a new layout.
   --hh-route-w is that length in stage pixels, measured once per change. */
#hero .stage .slogan.hh-sweep .route-light { left: 0; transform: translateX(calc(var(--hh-route-w, 0) * var(--route, 0) * 1px)); }
/* The warm light that travels with the seam (dark mode only) and the hairline at the seam itself. */
#hero .hh-glow { left: 0; top: 0; z-index: 5; width: 300px; height: 190px; margin: -95px 0 0 -150px; background: radial-gradient(closest-side, rgba(255, 238, 205, 0.5), rgba(255, 196, 150, 0.14) 46%, rgba(255, 180, 140, 0) 70%); mix-blend-mode: screen; opacity: 0; pointer-events: none; will-change: transform, opacity; }
#hero .hh-blade { left: 0; top: 0; z-index: 5; width: 2px; margin-left: -1px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 246, 228, 0.95) 30%, rgba(255, 246, 228, 0.95) 70%, rgba(255, 255, 255, 0)); filter: blur(0.6px); opacity: 0; pointer-events: none; will-change: transform, opacity; }
/* The point of light on the red waterline (y 450, wide layout only) and its short trail. */
#hero .hh-run { left: 0; top: 447px; z-index: 5; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px 4px rgba(255, 110, 90, 0.95), 0 0 34px 12px rgba(236, 44, 35, 0.45); opacity: 0; pointer-events: none; will-change: transform, opacity; }
#hero .hh-trail { left: 0; top: 449px; z-index: 5; width: 120px; height: 2px; background: linear-gradient(90deg, rgba(255, 120, 100, 0), rgba(255, 214, 200, 0.9)); opacity: 0; pointer-events: none; will-change: transform, opacity; }
#hero .hh-trail.hh-back { background: linear-gradient(270deg, rgba(255, 120, 100, 0), rgba(255, 214, 200, 0.9)); }
/* While the loop holds the compass on a ship, that ship's description and the small ships' notes stay out of the way. */
#hero .stage .big.hh-auto p { visibility: hidden; }
#hero .stage.hh-roll .ship-tip { visibility: hidden; }
/* The page hides the pause button and the scroll cue while a ship's note is open. During the loop's own roll call
   the notes are not shown, so the pause button stays where the visitor can find it. */
#hero:has(.stage.hh-roll) .hero-foot { opacity: calc(1 - var(--leave, 0)); }

/* ---------- 7. the still comes alive (hero.js section 3; owner 17 Nov 2026, "ทำทาง 1") ---------- */
/* Light CSS motion on the still picture, shown only while the still is: the layer fades out with the still when the
   live 3D scene comes in (and is at rest meanwhile), and back in if the scene falls. One box per layout, exactly the
   still's box (proto.css), so effects placed in percent of it line up with the picture at any scale. Only opacity and
   transform move (no filter, no blend mode), and they change on one shared beat of 16 a second (steps set by hero.js),
   so a machine without a graphics chip, which draws this on the processor, redraws 16 times a second, not 60. */
#hero .hh-alive { position: absolute; z-index: -1; left: -480px; top: 0; width: 2400px; height: 900px; pointer-events: none; contain: layout paint; transition: opacity 700ms ease, visibility 0s; }
#hero .stage[data-l="tall"] .hh-alive { left: -85px; width: 600px; height: 860px; }
#hero .hh-alive div { position: absolute; inset: 0; pointer-events: none; }
#hero .hh-alive i { position: absolute; display: block; pointer-events: none; animation-iteration-count: infinite; }
/* the group that matches the layout and the colour mode (hero.js builds a group the first time it is needed) */
#hero .hh-alive .hh-a-tall, #hero .stage[data-l="tall"] .hh-alive .hh-a-wide, #hero .hh-alive .hh-a-n, html[data-theme="dark"] #hero .hh-alive .hh-a-d { display: none; }
#hero .stage[data-l="tall"] .hh-alive .hh-a-tall, html[data-theme="dark"] #hero .hh-alive .hh-a-n { display: block; }
html.scene-on #hero .hh-alive { opacity: 0; visibility: hidden; transition: opacity 700ms ease, visibility 0s 700ms; }
/* the pause button stops everything that moves; under the live scene, and once the hero is out of sight, the layer rests */
html.paused #hero .hh-alive i, html.scene-on #hero .hh-alive i, #hero .hh-alive.hh-rest i { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  #hero .hh-alive { display: none; }
}

/* Stars: a white point with a soft glow that brightens and fades; the bright ones carry a small cross of light. */
#hero .hh-star { border-radius: 50%; background: #fff; box-shadow: 0 0 3px 1px rgba(214, 228, 255, 0.55); opacity: 0.15; animation-name: hh-twinkle; }
#hero .hh-star.hh-big { box-shadow: 0 0 6px 2px rgba(214, 228, 255, 0.7), 0 0 14px 5px rgba(170, 195, 255, 0.25); }
#hero .hh-star.hh-big::before, #hero .hh-star.hh-big::after { content: ""; position: absolute; left: 50%; top: 50%; }
#hero .hh-star.hh-big::before { width: 22px; height: 1px; margin: -0.5px 0 0 -11px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0)); }
#hero .hh-star.hh-big::after { width: 1px; height: 22px; margin: -11px 0 0 -0.5px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0)); }
@keyframes hh-twinkle { 0%, 100% { opacity: 0.15; transform: scale(0.7); } 50% { opacity: 1; transform: scale(1.15); } }
/* Light on the water: short horizontal dashes that open and close, so the water shimmers. Moonlight: cool white; on the
   open sea away from the moon: the same, dimmer. */
#hero .hh-glint { border-radius: 50%; background: radial-gradient(closest-side, #F1F5FF, rgba(225, 235, 255, 0.8) 45%, rgba(225, 235, 255, 0)); opacity: 0; animation-name: hh-shimmer; }
#hero .hh-glint.hh-dim { animation-name: hh-shimmer-dim; }
@keyframes hh-shimmer { 0% { opacity: 0; transform: scaleX(0.4); } 50% { opacity: 0.95; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(0.6); } }
@keyframes hh-shimmer-dim { 0% { opacity: 0; transform: scaleX(0.4); } 50% { opacity: 0.55; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(0.6); } }
/* The big ships' lights in their reflections: short warm upright streaks, fading in at the head and out at the tail,
   that flicker gently (never brighter than the reflections in the picture). */
#hero .hh-streak { border-radius: 1px; background: linear-gradient(180deg, rgba(255, 214, 150, 0), rgba(255, 222, 165, 0.95) 40%, rgba(255, 205, 140, 0.8) 60%, rgba(255, 200, 130, 0)); opacity: 0.25; animation-name: hh-flicker; }
@keyframes hh-flicker { 0%, 100% { opacity: 0.25; transform: scaleY(0.85); } 50% { opacity: 0.58; transform: scaleY(1.1); } }
/* The sun on the sea by day: a quick flash of three beats (bright, fading, faint), then dark for the rest of the cycle
   (32, 40 or 48 beats). Each value holds until the next keyframe (step-end), and every keyframe falls on a beat. */
#hero .hh-flash { border-radius: 50%; background: radial-gradient(closest-side, #FFFEF8, rgba(255, 248, 225, 0.9) 55%, rgba(255, 244, 214, 0)); opacity: 0; animation-timing-function: step-end; }
#hero .hh-flash.hh-fa { animation-name: hh-flash-a; }
#hero .hh-flash.hh-fb { animation-name: hh-flash-b; }
#hero .hh-flash.hh-fc { animation-name: hh-flash-c; }
@keyframes hh-flash-a { 0%, 84.375% { opacity: 0; transform: scaleX(0.5); } 87.5% { opacity: 0.85; transform: scaleX(1); } 90.625% { opacity: 0.6; transform: scaleX(0.85); } 93.75% { opacity: 0.3; transform: scaleX(0.7); } 96.875%, 100% { opacity: 0; transform: scaleX(0.5); } }
@keyframes hh-flash-b { 0%, 87.5% { opacity: 0; transform: scaleX(0.5); } 90% { opacity: 0.85; transform: scaleX(1); } 92.5% { opacity: 0.6; transform: scaleX(0.85); } 95% { opacity: 0.3; transform: scaleX(0.7); } 97.5%, 100% { opacity: 0; transform: scaleX(0.5); } }
@keyframes hh-flash-c { 0%, 89.5833% { opacity: 0; transform: scaleX(0.5); } 91.6667% { opacity: 0.85; transform: scaleX(1); } 93.75% { opacity: 0.6; transform: scaleX(0.85); } 95.8333% { opacity: 0.3; transform: scaleX(0.7); } 97.9167%, 100% { opacity: 0; transform: scaleX(0.5); } }
/* The aurora's light drifts to and fro, leans and breathes (each glow is a gradient that fades out inside its box: no
   edges), slowly enough to read as light, not as a moving shape. */
#hero .hh-aurora { animation-name: hh-aurora; animation-direction: alternate; }
#hero .hh-a-tall .hh-aurora { animation-name: hh-aurora-t; }
@keyframes hh-aurora { from { opacity: 0.35; transform: translateX(-16%) skewX(-4deg); } to { opacity: 1; transform: translateX(16%) skewX(4deg); } }
@keyframes hh-aurora-t { from { opacity: 0.35; transform: translateX(-10%) skewX(-4deg); } to { opacity: 1; transform: translateX(10%) skewX(4deg); } }
/* The Milky Way breathes along its band (the band's angle is set by hero.js). */
#hero .hh-milky { border-radius: 50%; background: radial-gradient(closest-side, rgba(215, 205, 255, 1), rgba(200, 190, 245, 0.6) 30%, rgba(190, 180, 240, 0.28) 60%, rgba(190, 180, 240, 0.08) 85%, rgba(190, 180, 240, 0)); opacity: 0.04; animation: hh-breathe 9s steps(144) infinite alternate; } /* 144 steps: the shared beat of hero.js */
@keyframes hh-breathe { from { opacity: 0.04; } to { opacity: 0.2; } }
/* Shooting stars: hero.js points the path (rotation), moves it between flights and starts each flight (one second,
   smooth; nothing runs between two). The streak's head is its right end. */
#hero .hh-mpath { width: 0; height: 0; }
#hero .hh-meteor { top: -0.75px; height: 1.5px; border-radius: 1px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(214, 226, 255, 0.35) 55%, #fff); transform-origin: 100% 50%; opacity: 0; }
/* longhands, not the shorthand: the shorthand would set the play state too and outrank the pause rules above */
#hero .hh-alive .hh-meteor.hh-fly { animation-name: hh-meteor; animation-duration: 1s; animation-timing-function: linear; animation-iteration-count: 1; animation-fill-mode: both; }
@keyframes hh-meteor { 0% { opacity: 0; transform: translateX(0) scaleX(0.3); } 12% { opacity: 1; } 75% { opacity: 0.9; transform: translateX(120%) scaleX(1); } 100% { opacity: 0; transform: translateX(150%) scaleX(0.6); } }
/* Clouds drift slowly left to right across the whole picture, behind the two big ships: the band they move in is the
   sky above the horizon with each big ship's outline cut out (read from the ships in the still, a few pixels of room
   around them). */
#hero .hh-band { inset: 0; }
#hero .hh-a-wide .hh-band { clip-path: polygon(0 0, 100% 0, 100% 50%, 76.66% 50%, 76.66% 45.37%, 76.08% 45.23%, 76.04% 43.14%, 75.66% 43.14%, 75.62% 45.27%, 72.87% 45.48%, 72.83% 44.65%, 72.75% 44.55%, 72% 43.93%, 71.04% 43.57%, 70.95% 43.33%, 70.91% 42.49%, 70.75% 42.28%, 70.12% 41.77%, 69.75% 41.67%, 69.7% 41.23%, 69.62% 41.16%, 68.91% 41.09%, 68.83% 41.05%, 68.79% 40.8%, 68.54% 40.59%, 67.83% 40.41%, 67.79% 39.07%, 67.75% 39.07%, 67.7% 38.61%, 67.54% 38.28%, 67.33% 38.17%, 67.29% 37.31%, 67% 37.31%, 66.95% 36.23%, 66.91% 36.23%, 66.87% 35.62%, 66.66% 35.55%, 66.54% 34.43%, 66.25% 34.43%, 66.12% 34.97%, 66.08% 34.97%, 65.95% 36.12%, 65.75% 36.12%, 65.7% 39.36%, 65.29% 39.36%, 65.12% 39.54%, 65.08% 39.87%, 65.04% 39.87%, 65% 41.16%, 64.7% 41.49%, 64.33% 42.33%, 64.16% 43.11%, 64.04% 43.25%, 64% 43.5%, 63.79% 43.93%, 63.75% 44.62%, 63.62% 44.91%, 63.58% 45.19%, 62.87% 45.77%, 62.83% 46.35%, 62.79% 46.35%, 62.75% 47.79%, 62.45% 47.89%, 62.41% 48.4%, 62.29% 48.54%, 62.25% 49.67%, 61.58% 49.67%, 61.58% 50%, 38.43% 50%, 38.43% 47.89%, 38.05% 47.67%, 37.93% 47%, 37.76% 47%, 37.72% 45.89%, 37.64% 45.89%, 37.43% 45.44%, 37.14% 45.44%, 37.05% 45.33%, 36.93% 44.78%, 36.8% 44.56%, 36.39% 44.44%, 36.26% 44.22%, 36.18% 44.22%, 36.14% 38.44%, 35.89% 38.44%, 35.76% 42.33%, 35.68% 44%, 35.64% 44.11%, 35.39% 43.44%, 35.34% 43%, 34.97% 43%, 34.8% 42.78%, 34.76% 39.11%, 34.72% 38.89%, 34.59% 38.67%, 34.09% 38.22%, 33.22% 38.22%, 33.09% 38.44%, 32.89% 41.56%, 32.64% 41.44%, 32.3% 40.78%, 32.14% 40.78%, 31.84% 40.56%, 31.8% 37%, 31.51% 37%, 31.43% 38.33%, 31.22% 38.56%, 31.18% 40.22%, 30.09% 40.11%, 29.84% 40.33%, 29.22% 40.33%, 29.01% 40.67%, 28.93% 41.78%, 28.89% 41.89%, 28.22% 42%, 28.14% 42.11%, 28.05% 41.89%, 27.68% 41.89%, 27.59% 42.11%, 27.55% 45.33%, 27.09% 45.33%, 26.97% 45%, 26.68% 45%, 26.59% 45.22%, 26.39% 45.22%, 26.18% 45%, 25.93% 45%, 25.84% 45.11%, 25.8% 45%, 25.14% 44.89%, 25.09% 44.78%, 24.47% 44.78%, 24.43% 44.67%, 23.55% 44.67%, 23.51% 44.78%, 23.34% 44.78%, 23.34% 50%, 0 50%); }
#hero .hh-a-tall .hh-band { clip-path: polygon(0 0, 100% 0, 100% 46.28%, 81.15% 46.28%, 81.15% 43.14%, 80.48% 43.14%, 80.31% 42.07%, 79.15% 42.07%, 78.98% 43.14%, 74.15% 43.21%, 73.98% 42.78%, 73.65% 42.6%, 70.48% 42.18%, 70.31% 41.59%, 69.81% 41.43%, 68.31% 41.34%, 68.15% 41.08%, 66.65% 41.03%, 66.31% 40.74%, 65.98% 40.66%, 64.65% 40.58%, 64.48% 39.82%, 63.65% 39.59%, 63.15% 38.62%, 62.98% 38.62%, 62.81% 38.28%, 62.65% 38.28%, 62.15% 37.72%, 60.98% 37.72%, 60.65% 37.84%, 60.48% 38.56%, 59.98% 38.56%, 59.81% 40.18%, 58.65% 40.27%, 58.48% 41.08%, 57.98% 41.12%, 57.31% 41.43%, 56.65% 41.98%, 56.48% 42.33%, 56.31% 42.33%, 55.81% 43.08%, 54.65% 43.32%, 54.48% 43.62%, 54.32% 43.62%, 54.15% 44.3%, 53.65% 44.43%, 53.48% 44.72%, 53.31% 44.72%, 53.15% 45.47%, 52.15% 45.47%, 52.15% 46.28%, 47.92% 46.28%, 47.92% 44.46%, 47.42% 44.46%, 47.31% 44.15%, 46.97% 43.99%, 46.86% 43.76%, 46.53% 43.76%, 46.31% 43.14%, 45.42% 43.06%, 44.64% 42.52%, 43.53% 42.44%, 43.31% 40.58%, 42.42% 40.58%, 42.2% 42.13%, 42.09% 41.82%, 41.31% 41.82%, 40.97% 41.67%, 40.86% 39.81%, 40.53% 39.57%, 39.31% 39.34%, 37.31% 39.42%, 36.86% 40.97%, 36.2% 40.66%, 35.31% 40.58%, 35.09% 39.34%, 34.2% 39.34%, 33.75% 39.5%, 33.53% 40.43%, 32.64% 40.27%, 31.64% 40.27%, 31.31% 40.43%, 29.86% 40.43%, 29.31% 41.2%, 26.97% 41.28%, 26.86% 42.52%, 26.64% 42.91%, 24.86% 42.91%, 24.42% 42.75%, 22.2% 42.67%, 18.59% 42.67%, 18.59% 46.28%, 0 46.28%); }
/* Real clouds cut from the day picture (cloud-a/b/c.webp, mirrored, transparent around them); hero.js sets each one's
   height so it keeps its shape. Every cloud box is as wide as the start line left of the picture, so one movement
   carries each across: (100 + w) / w */
#hero .hh-cloud { background: center / 100% 100% no-repeat; opacity: 0.92; }
#hero .hh-cloud.hh-ca { background-image: url("cloud-a.webp"); }
#hero .hh-cloud.hh-cb { background-image: url("cloud-b.webp"); }
#hero .hh-cloud.hh-cc { background-image: url("cloud-c.webp"); }
#hero .hh-a-wide .hh-cloud { left: -16%; width: 16%; animation-name: hh-drift-w; }
#hero .hh-a-tall .hh-cloud { left: -34%; width: 34%; animation-name: hh-drift-t; }
@keyframes hh-drift-w { from { transform: translateX(0); } to { transform: translateX(725%); } }
@keyframes hh-drift-t { from { transform: translateX(0); } to { transform: translateX(394.12%); } }
/* The faint high wisps drift a short way beside the words (never into them), fading in and out. */
#hero .hh-wisp { width: 9%; height: 2.2%; opacity: 0; animation-name: hh-wisp; }
@keyframes hh-wisp { 0% { opacity: 0; transform: translateX(0); } 20% { opacity: 1; transform: translateX(30%); } 40% { opacity: 1; transform: translateX(60%); } 60% { opacity: 1; transform: translateX(90%); } 80% { opacity: 1; transform: translateX(120%); } 100% { opacity: 0; transform: translateX(150%); } }
