/* MarineAR cards page. Shared chrome lives in site.css. */

.page-marinear {
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang HK", "Microsoft JhengHei", sans-serif;
}

.page-marinear .nav-link[aria-current="page"] {
  color: #fff;
  font-weight: 600;
}

.mar-hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 4.25rem);
  padding: 2.75rem 0 4.5rem;
  overflow: visible;
}

.mar-hero__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 78% 42%, rgba(56, 132, 255, 0.28), transparent 62%),
    radial-gradient(520px 320px at 18% 18%, rgba(255, 225, 74, 0.08), transparent 60%),
    linear-gradient(to bottom, rgba(7, 10, 16, 0.78), rgba(7, 10, 16, 0.62) 72%, rgba(7, 10, 16, 0));
}

.mar-hero .container {
  position: relative;
  z-index: 1;
}

.mar-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 500px);
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
  row-gap: 1.25rem;
  align-items: center;
}

.mar-copy {
  grid-column: 1;
  grid-row: 1;
}

.mar-stage {
  grid-column: 2;
  grid-row: 1;
}

.mar-kicker {
  letter-spacing: 0.01em;
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffe14a;
}

.mar-kicker__ar {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.mar-hero h1 {
  font-size: clamp(2.35rem, 4.4vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  max-width: 14ch;
}

.mar-lead {
  max-width: 38rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.08rem;
}

.mar-hero .hero-badges .badge {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 24, 39, 0.65) !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

.card-stage {
  perspective: 1500px;
  perspective-origin: 50% 42%;
}

.card-rig {
  position: relative;
  width: min(100%, 500px);
  height: 530px;
  margin-left: auto;
  transform-style: preserve-3d;
}

.card-shadow {
  position: absolute;
  width: 48%;
  height: 36px;
  right: 8%;
  bottom: 28px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), transparent 72%);
  transform-origin: center;
  pointer-events: none;
}

.play-card {
  position: absolute;
  transform-style: preserve-3d;
}

.play-card--rear {
  width: 56%;
  aspect-ratio: 720 / 1024;
  left: 0;
  top: 8px;
  animation: rear-sway 7.5s ease-in-out infinite;
}

.play-card--rear > img {
  position: absolute;
  inset: 0;
}

.play-card--front {
  width: 62%;
  aspect-ratio: 720 / 1024;
  right: 0;
  top: 54px;
  z-index: 2;
}

.play-card__spin {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.play-card__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 1.15rem;
}

.play-card__face--front {
  transform: translateZ(1px);
}

.play-card__face--back {
  transform: rotateY(180deg) translateZ(1px);
}

.play-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.42));
}

.card-now {
  width: min(100%, 500px);
  margin: 0.35rem 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.7rem;
  min-height: 1.8rem;
}

.card-now__zh {
  font-weight: 600;
  font-size: 1.05rem;
}

.card-now__latin {
  color: rgba(255, 255, 255, 0.72);
  font-style: italic;
}

.phylum {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  line-height: 1.4;
}

.phylum--chordata {
  background: #1e8f45;
}

.phylum--arthropoda {
  background: #c4342d;
}

.mar-intro {
  max-width: 46rem;
  color: rgba(255, 255, 255, 0.8);
}

.principle-card h3,
.step-card h3,
.habitat-card h3,
.specimen h3 {
  letter-spacing: -0.01em;
}

.mar-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.9rem;
}

.step-card {
  height: 100%;
}

.step-card__num {
  display: block;
  margin-bottom: 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: #ffe14a;
  font-weight: 700;
}

.poster-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0.8rem;
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.poster-open img {
  display: block;
  width: 100%;
  height: auto;
}

.poster-open__label {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(7, 10, 16, 0.78);
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.habitat-card--mangrove { border-top: 3px solid #8d6a45; }
.habitat-card--boulder { border-top: 3px solid #6e8f62; }
.habitat-card--coral { border-top: 3px solid #b56b8c; }
.habitat-card--deep { border-top: 3px solid #6ea0d8; }

.specimen {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: center;
  padding: 1rem;
}

.specimen__card {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.35));
}

.specimen__code {
  margin-bottom: 0.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.specimen h3 {
  margin-bottom: 0.1rem;
}

.specimen__latin {
  margin-bottom: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  font-style: italic;
}

.specimen--turtle { border-left: 3px solid #ef7a2a; }
.specimen--fiddler { border-left: 3px solid #a56a3a; }
.specimen--spooner { border-left: 3px solid #6d7c74; }

.theme-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.theme-list li {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.theme-list li.is-now {
  border-color: rgba(255, 225, 74, 0.55);
  color: #ffe14a;
}

.poster-dialog {
  border: 0;
  padding: 0;
  margin: auto;
  width: min(1080px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  background: transparent;
  overflow: auto;
  color: #fff;
}

.poster-dialog::backdrop {
  background: rgba(3, 8, 18, 0.86);
}

.poster-dialog__frame {
  position: relative;
}

.poster-dialog img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.85rem;
}

.poster-dialog__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(7, 10, 16, 0.82);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
}

.poster-open:focus-visible,
.poster-dialog__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.feature-board__title {
  margin: 2.25rem 0 1.1rem;
}

.feature-map {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  column-gap: 3.4rem;
  align-items: stretch;
}

.feature-map__notes {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.1rem;
  padding: 0.4rem 0;
}

.feature-map__visual {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.note {
  position: relative;
  max-width: 16.5rem;
  background: rgba(17, 24, 39, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.9rem;
  padding: 0.8rem 0.95rem;
}

.note h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.note p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
}

.note--right {
  margin-left: auto;
  text-align: right;
}

.note--left {
  margin-right: auto;
}

.note--right::after,
.note--left::after {
  content: none;
}

.note--right::after {
  right: -3.4rem;
}

.note--left::after {
  left: -3.4rem;
}

.note--right::before,
.note--left::before {
  content: none;
}

.note--right::before {
  right: -3.55rem;
}

.note--left::before {
  left: -3.55rem;
}

.mock3d,
.mock-phone {
  perspective: 1200px;
}

.mock3d {
  width: min(300px, 34vw);
}

.feature-map--card {
  position: relative;
}

.feature-map--card .feature-map__notes {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.feature-map--card .note {
  position: relative;
  width: min(16.5rem, 100%);
}

.feature-map--card .note--right::before,
.feature-map--card .note--right::after,
.feature-map--card .note--left::before,
.feature-map--card .note--left::after {
  display: none;
}

.wires {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  opacity: 0.5;
}

@media (min-width: 992px) {
  .callout-slot {
    display: none;
  }
}

.wires line {
  stroke: #ffe14a;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.wires line {
  marker-end: none;
}

.mock-phone {
  width: min(600px, 57vw);
}

.mock-spin {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
}

.mock3d .mock-spin {
  animation: mock-yaw 7.5s ease-in-out infinite;
}

.mock-phone .mock-spin {
  animation: mock-yaw-phone 8s ease-in-out infinite;
}

.mock3d img,
.mock-phone img {
  display: block;
  width: 100%;
  height: auto;
}

.mock3d img {
  filter: drop-shadow(16px 28px 22px rgba(0, 0, 0, 0.48));
}

.mock-phone img {
  filter: drop-shadow(-12px 24px 22px rgba(0, 0, 0, 0.45));
}

.hotspot {
  position: absolute;
  z-index: 4;
  width: 12px;
  height: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffe14a;
  box-shadow: 0 0 0 4px rgba(255, 225, 74, 0.28);
  transform: translate(-50%, -50%);
  opacity: 0.7;
  pointer-events: none;
  animation: hotspot-flash 1.35s ease-in-out infinite;
}

.callout-slot {
  width: min(100%, 22rem);
  margin-top: 0.85rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(255, 225, 74, 0.5);
  border-radius: 0.9rem;
  background: rgba(17, 24, 39, 0.92);
  text-align: left;
}

.callout-slot[hidden] {
  display: none;
}

.callout-slot h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.callout-slot p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

@keyframes mock-yaw {
  0%,
  100% {
    transform: rotateY(-30deg) rotateX(10deg);
  }
  50% {
    transform: rotateY(-14deg) rotateX(6deg);
  }
}

@keyframes mock-yaw-phone {
  0%,
  100% {
    transform: rotateY(16deg) rotateX(5deg);
  }
  50% {
    transform: rotateY(-12deg) rotateX(3deg);
  }
}

.partner-note {
  color: rgba(255, 255, 255, 0.68);
  max-width: 52rem;
}

@keyframes rear-sway {
  0%,
  100% {
    transform: translate3d(0, 0, -80px) rotateY(22deg) rotateX(5deg);
  }
  50% {
    transform: translate3d(0, 10px, -110px) rotateY(32deg) rotateX(8deg);
  }
}

@media (max-width: 991.98px) {
  .mar-hero {
    display: block;
    min-height: 0;
    padding-top: 1.75rem;
  }

  .mar-hero h1 {
    max-width: 14ch;
  }

  .mar-hero-grid {
    display: flex;
    flex-direction: column;
  }

  .mar-copy {
    display: contents;
  }

  .mar-title {
    order: 1;
  }

  .mar-stage {
    order: 2;
    width: 100%;
  }

  .mar-actions {
    order: 3;
  }

  .card-rig,
  .card-now {
    margin-left: auto;
    margin-right: auto;
  }

  .card-rig {
    height: 470px;
    margin-top: 0.5rem;
  }

  .mar-steps {
    grid-template-columns: 1fr 1fr;
  }

  .mock3d {
    width: min(280px, 78vw);
  }

  .mock-phone {
    width: min(540px, 100%);
  }

  .feature-map {
    grid-template-columns: 1fr;
    row-gap: 1rem;
  }

  .feature-map__visual {
    order: -1;
    flex-direction: column;
    align-items: center;
  }

  .feature-map__notes,
  .feature-map--card .feature-map__notes {
    display: none;
  }

  .wires {
    display: none;
  }

  .mock3d .mock-spin,
  .mock-phone .mock-spin {
    animation: none;
  }

  .mock3d .mock-spin {
    transform: rotateY(-22deg) rotateX(8deg);
  }

  .mock-phone .mock-spin {
    transform: rotateY(12deg) rotateX(4deg);
  }

  .hotspot {
    pointer-events: auto;
    cursor: pointer;
    touch-action: manipulation;
    width: 44px;
    height: 44px;
    background: transparent;
    box-shadow: none;
    animation: hotspot-flash 1.35s ease-in-out infinite;
  }

  .hotspot::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffe14a;
    box-shadow: 0 0 0 4px rgba(255, 225, 74, 0.35);
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  .hotspot.is-active {
    animation: none;
    opacity: 1;
  }

  .hotspot.is-active::after {
    background: #ff3b30;
    box-shadow: 0 0 0 6px rgba(255, 59, 48, 0.55);
  }

  .hotspot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
  }
}

@media (max-width: 575.98px) {
  .card-rig {
    height: 420px;
  }

  .play-card--front {
    top: 42px;
  }

  .mar-steps {
    grid-template-columns: 1fr;
  }

  .feature-map {
    grid-template-columns: 1fr;
    row-gap: 1rem;
  }

  .feature-map__visual {
    order: -1;
  }

  .note,
  .note--right,
  .note--left {
    max-width: none;
    margin: 0;
    text-align: left;
  }

  .note--right::before,
  .note--right::after,
  .note--left::before,
  .note--left::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .play-card--rear {
    animation: none;
    transform: translate3d(0, 0, -80px) rotateY(26deg) rotateX(6deg);
  }

  .mock-spin,
  .hotspot {
    animation: none;
  }

  .mock3d .mock-spin {
    transform: rotateY(-22deg) rotateX(8deg);
  }

  .mock-phone .mock-spin {
    transform: rotateY(12deg) rotateX(4deg);
  }
}

@keyframes hotspot-flash {
  0%,
  100% {
    opacity: 0.7;
  }

  50% {
    opacity: 0.35;
  }
}

.mar-demo {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.mar-demo video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(78vh, 820px);
}
