/* ==========================================================
   ELWIND – viewer one-pager
   ========================================================== */
:root {
  --navy: #29235c;
  --navy-hover: #3a3380;
  --teal: #1aa99c;
  --white: #fff;
  --text: #111;
  --tile: #cfcfcf;

  --hero-h: min(100svh, max(560px, 54.6vw));
  --panel-w: 252px;
  --panel-h: 495px;
  --font: "Helvetica Neue", Arial, Helvetica, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
}
img { max-width: 100%; }
button { font: inherit; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  height: var(--hero-h);
  overflow: hidden;
  background: #000;
  isolation: isolate;
}

/* draggable area */
.viewer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;          /* horizontal swipes look around, vertical swipes still scroll the page */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  outline: none;
}
.viewer.is-dragging { cursor: grabbing; }
.viewer:focus-visible { box-shadow: inset 0 0 0 3px var(--teal); }

.viewer__stack { position: absolute; inset: 0; }

.pano {
  position: absolute;
  top: 0; left: 0;
  max-width: none;
  transform-origin: 0 0;
  will-change: transform;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.pano.is-visible { opacity: 1; }

/* loading spinner */
.viewer__loader {
  position: absolute;
  top: 50%; left: 50%;
  width: 38px; height: 38px;
  margin: -19px 0 0 -19px;
  border: 3px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .2s;
  animation: spin .9s linear infinite;
  pointer-events: none;
  z-index: 3;
}
.hero.is-loading .viewer__loader { opacity: 1; transition-delay: .25s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* binocular frame */
.binoc-mask {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none !important;   /* clicks & drags go straight through to the image */
  user-select: none;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity .45s ease, transform .6s var(--ease);
  z-index: 2;
}
.binoc-mask * { pointer-events: none !important; }
.hero.is-binoc .binoc-mask { opacity: 1; transform: none; }

/* ---------- brand panel (logo + locations) ---------- */
.brand-panel {
  position: absolute;
  top: 0; left: 0;
  width: var(--panel-w);
  height: var(--panel-h);
  z-index: 20;                   /* always above the binocular frame and the image */
  pointer-events: none;
}
.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--white);
  clip-path: polygon(0 0, 100% 0, 13% 90%, 0 100%);
}
.brand-panel > * { pointer-events: auto; position: relative; z-index: 1; }
.locations__btn { pointer-events: auto; touch-action: manipulation; }

.brand-panel__logo {
  display: block;
  width: 150px;
  margin: 30px 0 0 18px;
}
.brand-panel__logo img { display: block; width: 100%; height: auto; }

.locations {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 16px;
  padding-left: 22px;
}
.locations__btn {
  position: relative;
  max-width: 168px;           /* long names wrap onto a second line inside the white panel */
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 32px 8px 23px;
  color: var(--navy);
  font-weight: 700;
  font-size: 17px;
  line-height: 20px;
  cursor: pointer;
  white-space: normal;
  z-index: 0;
}
.locations__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--navy);
  clip-path: polygon(0 0, 100% 0, 92% 100%, 2% 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.locations__btn:hover { color: var(--navy-hover); text-decoration: underline; text-underline-offset: 3px; }
.locations__btn.is-active { color: var(--white); text-decoration: none; }
.locations__btn.is-active::before { transform: none; }
.locations__btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* numbered viewpoints next to the selected location */
.locations__item { display: flex; align-items: center; gap: 8px; }
.viewpoints { display: flex; gap: 5px; animation: vpIn .3s var(--ease); }
.viewpoints[hidden] { display: none !important; }
.viewpoints__btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid var(--navy);
  border-radius: 4px;
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: background-color .2s, color .2s, transform .15s;
}
.viewpoints__btn:hover { background: #e9e8f3; }
.viewpoints__btn:active { transform: translateY(1px); }
.viewpoints__btn.is-active { background: var(--navy); color: var(--white); }
.viewpoints__btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
@keyframes vpIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* ---------- weather buttons ---------- */
.weather {
  position: absolute;
  top: 39px;
  right: 36px;
  display: flex;
  gap: 18px;
  z-index: 5;
}
.weather__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px 0 13px;
  border: 1.5px solid rgba(255,255,255,.95);
  border-radius: 7px;
  background: rgba(0,0,0,.08);
  color: var(--white);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .01em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: background-color .2s, border-color .2s, transform .15s;
}
.weather__btn svg { width: 22px; height: 22px; flex: none; }
.weather__btn:hover { background: rgba(41,35,92,.55); }
.weather__btn:active { transform: translateY(1px); }
.weather__btn.is-active { background: var(--navy); border-color: var(--navy); text-shadow: none; }
.weather__btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

/* ---------- binocular toggle ---------- */
.binoc-toggle {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 88px;
  height: 74px;
  margin-left: -44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  cursor: pointer;
  z-index: 5;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.35));
  transition: transform .2s var(--ease);
}
.binoc-toggle svg { width: 100%; height: 100%; overflow: visible; }
.binoc-toggle:hover { transform: scale(1.06); }
.binoc-toggle:active { transform: scale(.97); }
.binoc-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; border-radius: 8px; }
.binoc-toggle__slash {
  stroke: var(--navy);
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  transition: stroke-dashoffset .35s var(--ease);
}
.hero.is-binoc .binoc-toggle__slash { stroke-dashoffset: 0; }

/* ---------- map with viewing angle ---------- */
.minimap {
  position: absolute;
  right: 22px;
  bottom: 26px;
  width: clamp(220px, 21vw, 380px);
  margin: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .4s ease, transform .5s var(--ease);
}
.hero.is-binoc .minimap,
.hero.map-always .minimap { opacity: 1; transform: none; }
.minimap__zoom {
  margin: 0 0 10px;
  text-align: right;
  color: var(--white);
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.minimap__zoom strong { font-size: 1.55em; vertical-align: -.08em; }
.minimap__frame { position: relative; line-height: 0; box-shadow: 0 4px 18px rgba(0,0,0,.35); }
.minimap__img { display: block; width: 100%; height: auto; }
.minimap__overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }
.minimap__cone {
  fill: #e9f5a0;
  fill-opacity: .6;
}
.minimap__origin { fill: #fff; stroke: var(--navy); stroke-width: 3; }

/* ---------- loading: blurred preview + progress pill ---------- */
.pano.is-preview { filter: blur(3px); }
.loadbar {
  position: absolute; left: 50%; bottom: 150px; z-index: 6;
  display: grid; grid-template-columns: 1fr auto; column-gap: 10px; row-gap: 7px; align-items: center;
  width: min(340px, calc(100% - 32px)); padding: 10px 16px 12px;
  border-radius: 12px; background: rgba(20,18,50,.62);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: #fff; font-size: 13px; font-weight: 600;
  transform: translate(-50%, 8px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
}
.hero.is-fetching .loadbar { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .3s ease, transform .3s ease; }
.loadbar__pct { font-variant-numeric: tabular-nums; }
.loadbar__track { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.22); overflow: hidden; }
.loadbar__fill { display: block; height: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(.02); transition: transform .2s linear; }
.loadbar.is-indeterminate .loadbar__fill { width: 35%; transform: none; animation: lb-slide 1.2s ease-in-out infinite; }
@keyframes lb-slide { from { margin-left: -35%; } to { margin-left: 100%; } }

/* ---------- drag hint ---------- */
.drag-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20,18,50,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  pointer-events: none;
  z-index: 4;
  transition: opacity .6s ease;
}
.drag-hint svg { width: 24px; height: 24px; animation: nudge 1.6s ease-in-out infinite; }
.drag-hint.is-hidden, .hero.is-binoc .drag-hint { opacity: 0; }
@keyframes nudge { 0%,100% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }

/* ---------- CONTENT ---------- */
.content { padding: 112px 24px 140px; }
.content__inner {
  max-width: 1488px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.content__text { max-width: 800px; padding-left: 108px; }
.content__text p { margin: 0 0 1.1em; }
.content__gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 21px;
  max-width: 583px;
  padding-top: 3px;
}
.content__tile { aspect-ratio: 1; background: var(--tile); }

/* ---------- calculation write-up ---------- */
.method { font-size: 17px; line-height: 1.62; color: var(--text); }
.method__eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.method h2 { margin: 0 0 18px; font-size: 32px; line-height: 1.15; color: var(--navy); text-wrap: balance; }
.method h3 { margin: 2.1em 0 .6em; font-size: 20px; color: var(--navy); }
.method__lead { font-size: 19px; }
.method__notice {
  margin: 0 0 28px; padding: 12px 16px;
  border-left: 4px solid var(--teal); background: #eef8f7;
  font-size: 16px; line-height: 1.45; color: var(--navy);
}
.method a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.method a:hover { color: var(--teal); }
.method ul, .method ol { margin: 0 0 1.4em; padding-left: 1.3em; }
.method li { margin-bottom: .7em; }
.method li strong { color: var(--navy); }
.method .formula {
  margin: 0 0 1.2em; padding: 12px 16px;
  background: #f2f4f9; border-left: 3px solid var(--navy);
  font-family: "Cambria Math", "Times New Roman", serif; font-size: 18px; overflow-x: auto; white-space: nowrap;
}
.table-wrap { overflow-x: auto; margin: 26px 0 8px; }
.method table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; min-width: 520px; }
.method th, .method td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #dfe2ec; vertical-align: top; }
.method thead th { background: var(--navy); color: #fff; font-weight: 700; border-bottom: 0; }
.method tbody th { font-weight: 600; color: var(--navy); white-space: nowrap; }
.method td { white-space: nowrap; }
.content__gallery { position: sticky; top: 24px; }
.content__tile { position: relative; margin: 0; overflow: hidden; }
.content__tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.content__tile figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font-size: 13px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(20,18,50,.65)); }
.content__map { grid-column: 1 / -1; margin: 0; }
.content__map img { display: block; width: 100%; height: auto; }
.content__note { grid-column: 1 / -1; margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: #5b5f73; }
.content__inner > * { min-width: 0; }
/* one column: text flows around the map */
.content__inner--single { display: block; max-width: 1080px; }
.content__inner--single .content__text { max-width: none; padding-left: 0; }
.content__map--float { float: right; width: 48%; margin: 6px 0 24px 48px; }
.method::after { content: ""; display: block; clear: both; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1400px) {
  .weather { gap: 12px; right: 24px; }
  .weather__btn { font-size: 15px; height: 38px; padding: 0 12px 0 10px; }
  .content__text { padding-left: 40px; }
}

@media (max-width: 1100px) {
  :root { --panel-w: 200px; --panel-h: 420px; }
  .brand-panel__logo { width: 128px; margin: 24px 0 0 44px; }
  .locations__btn { font-size: 15px; padding: 7px 26px 7px 18px; }
  .weather__btn span { display: none; }       /* icon-only */
  .weather__btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .content__inner { gap: 48px; }
  .content__text { padding-left: 0; }
}

@media (max-width: 860px) {
  .content { padding: 64px 20px 88px; }
  .content__map--float { float: none; width: 100%; margin: 0 0 24px; }
  .content__inner { grid-template-columns: 1fr; }
  .content__gallery { max-width: none; position: static; }
}

/* phones: weather becomes a bottom bar with labels */
@media (max-width: 640px) {
  :root {
    --hero-h: max(520px, 82svh);
    --panel-w: 222px;
    --panel-h: 350px;
  }
  .brand-panel__logo { width: 104px; margin: 18px 0 0 22px; }
  .locations { margin-top: 10px; padding-left: 8px; gap: 2px; }
  .locations__btn { font-size: 14px; line-height: 18px; padding: 6px 22px 6px 14px; }
  .viewpoints__btn { width: 26px; height: 26px; font-size: 13px; }
  .locations__btn { max-width: 132px; }
  .locations__item { gap: 6px; }

  .weather {
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
    gap: 6px;
    display: grid;                                   /* 7 buttons: two rows of four */
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .weather__btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: 48px;
    flex-direction: column;
    gap: 3px;
    padding: 0 2px;
    font-size: 10px;
    line-height: 1.1;
    letter-spacing: .02em;
    white-space: normal;
    text-align: center;
  }
  .weather__btn span { display: block; }
  .weather__btn svg { width: 20px; height: 20px; }

  .binoc-toggle { width: 58px; height: 49px; margin-left: -29px; bottom: 128px; }
  .drag-hint { font-size: 13px; padding: 8px 14px; top: 46%; }
  .loadbar { bottom: 196px; }
  .minimap { top: 14px; right: 12px; bottom: auto; width: 150px; }
  .minimap__zoom { font-size: 12px; margin-bottom: 6px; }
  .method { font-size: 16px; }
  .method h2 { font-size: 26px; }
  .content__gallery { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
