@font-face {
  font-family: "Big Shoulders Display";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("/public/fonts/big-shoulders-display/big-shoulders-display-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/public/fonts/hanken-grotesk/hanken-grotesk-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/public/fonts/ibm-plex-mono/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/public/fonts/ibm-plex-mono/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}
/* Layout: one screen on a ship's bridge. The real vessel photo is the scene, live swell on canvas over it,
   a glass nav bar on top, the mission as headline, a glass instrument dock at the bottom; every section opens as a liquid-glass popup.
   Two watches: Night (blue-hour navy) and Day (clear harbour light). Default follows Cebu local time; the toggle overrides. */
:root {
  /* Night watch (default tokens) */
  --bg: #040b1c;
  --fg: #eaf3fb;
  --fg-2: #a9bdd6;
  --accent: #7eb6e6;
  --brand: #3b55a5;
  --navy: #0c1a3a;
  --signal: #f2b84b;          /* masthead light at night */
  --glass: rgba(170, 205, 245, 0.09);
  --glass-strong: rgba(150, 190, 240, 0.14);
  --glass-end: rgba(120, 170, 230, 0.05);
  --rim: rgba(220, 238, 255, 0.22);
  --rim-soft: rgba(220, 238, 255, 0.08);
  --hi: rgba(255, 255, 255, 0.28);
  --sheen: rgba(255, 255, 255, 0.16);
  --shadow: rgba(0, 6, 20, 0.45);
  --hover: rgba(170, 205, 245, 0.12);
  --tile: rgba(170, 205, 245, 0.07);
  --chip: rgba(6, 16, 40, 0.55);
  --sheet-a: rgba(120, 170, 235, 0.22);
  --sheet-b: rgba(40, 70, 130, 0.2);
  --sheet-c: rgba(10, 24, 56, 0.55);
  --backdrop: rgba(2, 7, 18, 0.45);
  --veil: 4, 11, 28;          /* rgb of the legibility veil over the photo */
  --tint-op: .75;             /* blue-hour color tint over the photo */
  --photo-filter: grayscale(.35) brightness(.62) contrast(1.12);
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 22px;
  color-scheme: dark;
}
:root[data-mode="day"] {
  --bg: #e6f1fa;
  --fg: #0b1f45;
  --fg-2: #3c5277;
  --accent: #1f72b3;
  --signal: #d9432b;          /* buoy red by day */
  --glass: rgba(255, 255, 255, 0.4);
  --glass-strong: rgba(255, 255, 255, 0.68);
  --glass-end: rgba(210, 232, 250, 0.32);
  --rim: rgba(255, 255, 255, 0.8);
  --rim-soft: rgba(11, 31, 69, 0.1);
  --hi: rgba(255, 255, 255, 0.95);
  --sheen: rgba(255, 255, 255, 0.7);
  --shadow: rgba(11, 31, 69, 0.16);
  --hover: rgba(11, 31, 69, 0.07);
  --tile: rgba(255, 255, 255, 0.55);
  --chip: rgba(255, 255, 255, 0.72);
  --sheet-a: rgba(255, 255, 255, 0.86);
  --sheet-b: rgba(242, 249, 255, 0.72);
  --sheet-c: rgba(222, 238, 251, 0.7);
  --backdrop: rgba(200, 222, 240, 0.4);
  --veil: 230, 241, 250;
  --tint-op: 0;
  --photo-filter: saturate(1.05) brightness(1.02);
  color-scheme: light;
}
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg); color: var(--fg);
  font-family: var(--body); font-size: 15px; line-height: 1.55;
  overflow: hidden;
}

/* ---------- Scene ---------- */
.photo-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--bg); }
.photo-bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: 55% 62%; display: block;
  filter: var(--photo-filter);
  animation: drift 40s ease-in-out infinite alternate; transform-origin: 60% 60%;
}
@keyframes drift { from { transform: scale(1.04); } to { transform: scale(1.12) translateX(-1.5%); } }
.photo-bg::before { content: ""; position: absolute; inset: 0; background: #1b3a7a; mix-blend-mode: color; opacity: var(--tint-op); }
.photo-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(var(--veil), .7) 0%, rgba(var(--veil), .2) 35%, rgba(var(--veil), .15) 60%, rgba(var(--veil), .85) 100%);
}
#sea { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(var(--veil), .85) 0%, rgba(var(--veil), .4) 42%, rgba(var(--veil), 0) 68%);
}

.app {
  position: relative; z-index: 2; height: 100%;
  display: grid; grid-template-rows: auto 1fr auto; gap: 16px;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
  padding-block: 18px 20px;
  max-width: 1440px; margin-inline: auto;
  overflow-y: auto;
}

/* ---------- Liquid glass ---------- */
.glass {
  position: relative; isolation: isolate;
  background: linear-gradient(140deg, var(--glass-strong), var(--glass) 45%, var(--glass-end));
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--rim);
  border-radius: var(--r);
  box-shadow: inset 0 1px 1px var(--hi), inset 0 -10px 24px rgba(126,182,230,.07), inset 0 0 0 1px var(--rim-soft), 0 18px 50px var(--shadow);
}
.glass::before { /* specular sheen that follows the pointer */
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(220px circle at var(--mx, 30%) var(--my, 0%), var(--sheen), transparent 60%);
}
.glass::after { /* thin liquid rim refraction */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(160deg, var(--hi), rgba(126,182,230,.08) 35%, rgba(126,182,230,0) 60%, rgba(126,182,230,.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* ---------- Top bar ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 10px 10px 14px; border-radius: 999px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
.mark { width: 40px; height: 40px; flex: none; border-radius: 50%; overflow: hidden; background: var(--brand); box-shadow: 0 0 0 2px var(--rim-soft); }
.mark img { width: 100%; height: 100%; object-fit: cover; object-position: 0 50%; display: block; }
.brand-text { display: grid; line-height: 1.05; min-width: 0; }
.brand-text b { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: .06em; }
.brand-text small { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-end { display: flex; align-items: center; gap: 8px; }

.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav button, .menu-btn {
  font: 500 13.5px/1 var(--body); color: var(--fg);
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  padding: 11px 16px; cursor: pointer; transition: background .25s, border-color .25s;
}
.nav button:hover { background: var(--hover); border-color: var(--rim-soft); }
.nav button.cta, .pill.primary { color: #fff; background: linear-gradient(180deg, #5170c4, var(--brand)); border: 1px solid rgba(255,255,255,.3); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 10px 26px rgba(59,85,165,.35); }
.nav button.cta:hover { background: linear-gradient(180deg, #5d7dd2, #4562b4); }
.menu-btn { display: none; border-color: var(--rim-soft); }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Day / Night watch switch */
.watch { display: flex; padding: 3px; border-radius: 999px; background: var(--hover); border: 1px solid var(--rim-soft); }
.watch button {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 0; cursor: pointer;
  font: 500 11.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-2); background: transparent;
  transition: background .3s, color .3s;
}
.watch button svg { width: 15px; height: 15px; }
.watch button[aria-pressed="true"] { color: var(--fg); background: var(--glass-strong); box-shadow: inset 0 1px 0 var(--hi), 0 2px 8px var(--shadow); }

/* ---------- Hero ---------- */
.hero { align-self: center; display: grid; gap: 22px; max-width: 760px; padding-block: 12px; min-width: 0; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
h1 { margin: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(44px, 7.4vw, 104px); line-height: .9; letter-spacing: .005em; text-wrap: balance; }
h1 em { font-style: normal; color: transparent; -webkit-text-stroke: 1.5px var(--fg); }
.lede { margin: 0; max-width: 56ch; font-size: clamp(15px, 1.25vw, 18px); color: var(--fg-2); }
.lede strong { color: var(--fg); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { font: 600 14px/1 var(--body); color: var(--fg); cursor: pointer; padding: 15px 22px; border-radius: 999px; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; transition: transform .2s; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 12px var(--signal); }
.pill:hover { transform: translateY(-1px); }

/* ---------- Instrument dock ---------- */
.dock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; padding: 6px; }
.gauge {
  padding: 14px 18px; display: grid; gap: 6px; min-width: 0; text-align: left;
  background: none; border: 0; border-right: 1px solid var(--rim-soft); color: inherit; font: inherit; cursor: pointer;
  border-radius: 16px; transition: background .25s;
}
.gauge:hover { background: var(--hover); }
.gauge:last-of-type { border-right: 0; }
.gauge .k { font: 500 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--fg-2); }
.gauge .v { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gauge .s { font-size: 12.5px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock { padding: 12px 18px; display: grid; place-items: center; gap: 4px; border-left: 1px solid var(--rim-soft); color: var(--fg); }
.compass { width: 54px; height: 54px; }
.clock .t { font: 500 12px/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: .06em; }

/* ---------- Popups ---------- */
dialog.panel { border: 0; padding: 0; background: transparent; color: var(--fg); width: min(760px, calc(100vw - 32px)); max-height: min(84vh, 760px); overflow: visible; }
dialog.panel::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet { --r: 28px; max-height: inherit; overflow: auto; padding: 30px 32px 32px; background: linear-gradient(150deg, var(--sheet-a), var(--sheet-b) 50%, var(--sheet-c)); transform-origin: var(--ox, 50%) var(--oy, 50%); }
dialog.panel[open] .sheet { animation: pour .55s cubic-bezier(.2,.9,.25,1.15) both; }
dialog.panel.closing .sheet { animation: drain .28s ease-in both; }
dialog.panel[open]::backdrop { animation: fade .4s both; }
@keyframes pour { 0% { opacity: 0; transform: scale(.55); filter: blur(14px); border-radius: 60px; } 60% { opacity: 1; filter: blur(0); } 100% { opacity: 1; transform: scale(1); border-radius: 28px; } }
@keyframes drain { to { opacity: 0; transform: scale(.85) translateY(10px); filter: blur(10px); } }
@keyframes fade { from { opacity: 0; } }

.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.sheet h2 { margin: 6px 0 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(32px, 5vw, 46px); line-height: .95; letter-spacing: .01em; text-wrap: balance; }
.x { flex: none; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; color: var(--fg); background: var(--hover); border: 1px solid var(--rim); font-size: 20px; line-height: 1; }
.sheet p { margin: 0 0 12px; max-width: 64ch; color: var(--fg-2); }
.sheet p strong { color: var(--fg); font-weight: 600; }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 20px; }
.fact, .zero, .list li { padding: 16px; border-radius: 16px; background: var(--tile); border: 1px solid var(--rim-soft); }
.fact { display: grid; gap: 6px; align-content: start; }
.fact b { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: .02em; line-height: 1.05; }
.fact span { font-size: 12.5px; color: var(--fg-2); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.duo .fact b { font-size: 15px; font-family: var(--body); font-weight: 500; letter-spacing: 0; line-height: 1.45; }
.label { font: 500 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.zeros { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.zero { display: grid; gap: 4px; }
.zero b { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; color: var(--accent); letter-spacing: .04em; }
.zero span { font-size: 13.5px; }
.list { display: grid; gap: 10px; margin: 6px 0 0; padding: 0; list-style: none; }
.list li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.list svg { width: 34px; height: 34px; stroke: var(--accent); }
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.types .fact svg { width: 100%; height: 64px; }

.photo { position: relative; margin: 16px 0 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--rim); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { position: absolute; left: 12px; bottom: 12px; padding: 7px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 600; background: var(--chip); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--rim-soft); }
.pair { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; margin-bottom: 20px; }
.pair .photo { margin: 0; aspect-ratio: 4 / 3.2; max-width: 100%; }
.pair .photo:last-child img { object-position: 30% 40%; }
.zoom { margin-top: 14px; border-radius: 18px; border: 1px solid var(--rim); background: #fff; max-height: 56vh; overflow: auto; cursor: zoom-in; }
.zoom img { display: block; width: 100%; height: auto; }
.zoom.z { cursor: zoom-out; }
.zoom.z img { width: 240%; max-width: none; }
.hint { font: 500 11.5px/1 var(--mono); color: var(--fg-2); letter-spacing: .06em; margin-top: 10px; display: block; }
.addr { font-size: 16px; line-height: 1.6; margin: 0; font-style: normal; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.coord { font: 500 13px/1 var(--mono); color: var(--accent); letter-spacing: .06em; }
.copy-ok { font: 500 12px/1 var(--mono); color: var(--signal); }

/* Circular "tide" reveal when switching watch */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Mobile ---------- */
@media (max-width: 1020px) { .watch button span { display: none; } .watch button { padding: 8px; } }
@media (max-width: 900px) {
  .nav { display: none; }
  .nav.open { display: grid; position: absolute; top: calc(100% + 10px); right: 0; left: 0; padding: 8px; border-radius: 22px; gap: 2px;
    background: linear-gradient(150deg, var(--sheet-a), var(--sheet-c));
    -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); border: 1px solid var(--rim); }
  .nav.open button { text-align: left; padding: 14px 16px; }
  .bar { position: relative; }
  .menu-btn { display: inline-block; }
  .dock { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .gauge:nth-of-type(2) { border-right: 0; }
  .gauge:nth-of-type(1), .gauge:nth-of-type(2) { border-bottom: 1px solid var(--rim-soft); border-radius: 16px 16px 0 0; }
  .clock { display: none; }
  .vignette { background: linear-gradient(180deg, rgba(var(--veil), .5) 0%, rgba(var(--veil), .25) 50%, rgba(var(--veil), .6) 100%); }
  .pair { grid-template-columns: 1fr 1fr; }
  .facts, .duo, .types { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .app { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 12px 14px; gap: 12px; }
  .brand-text small { display: none; }
  .brand-text b { font-size: 18px; }
  .menu-btn { padding: 11px 12px; }
  .gauge { padding: 12px; }
  .gauge .v { font-size: 20px; }
  .gauge .s { display: none; }
  .sheet { padding: 22px 20px 24px; }
  .pill { padding: 13px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-bg img, dialog.panel[open] .sheet, dialog.panel.closing .sheet, dialog.panel[open]::backdrop { animation: none; }
  .pill { transition: none; }
}

[hidden] { display: none !important; }
.photo-bg picture { position: absolute; inset: 0; display: block; }
.photo picture { display: block; width: 100%; height: 100%; }
.logout-pill {
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--rim-soft);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.logout-pill:hover { background: var(--hover); }
#login-dialog {
  box-sizing: border-box;
  width: min(440px, calc(100vw - 32px));
  max-height: min(90vh, 680px);
  overflow: auto;
  padding: 28px 28px 22px;
  border: 1px solid var(--rim);
  border-radius: 28px;
  color: var(--fg);
  background: linear-gradient(150deg, var(--sheet-a), var(--sheet-b) 50%, var(--sheet-c));
  box-shadow: 0 18px 50px var(--shadow);
}
#login-dialog::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
#login-dialog .kicker { margin: 0 0 8px; padding-right: 72px; font: 500 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
#login-dialog h2 { margin: 0 0 8px; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 40px; line-height: .95; }
.login-lead { margin: 0 0 16px; color: var(--fg-2); }
#login-dialog label { display: block; margin: 12px 0 6px; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); }
#login-dialog input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--rim-soft); background: var(--tile); color: var(--fg); font: 16px/1.3 var(--body);
}
.login-submit, .login-switch, .login-close { font: 600 14px/1 var(--body); cursor: pointer; border-radius: 999px; }
.login-submit {
  width: 100%; margin-top: 16px; padding: 14px 18px; color: #fff;
  background: linear-gradient(180deg, #5170c4, var(--brand)); border: 1px solid rgba(255,255,255,.3);
}
.login-switch {
  width: 100%; margin-top: 8px; padding: 12px 18px; color: var(--fg);
  background: transparent; border: 1px solid var(--rim-soft);
}
.login-close {
  position: absolute; top: 16px; right: 16px; padding: 8px 12px; color: var(--fg);
  background: var(--hover); border: 1px solid var(--rim);
}
.login-error { min-height: 1.2em; margin: 12px 0 0; color: var(--signal); font-weight: 600; }
@media (max-width: 520px) {
  .logout-pill { padding: 8px 10px; }
}
