/* The ship that carries the bio. It sails in from the right as you scroll
   and docks mid-screen; js/sea.js sets its transform every frame. */
.ship {
  --wood: #b97a43;
  --wood-dark: #7a4a26;
  --sailcloth: #fff8e6;
  --accent: var(--tide);
  --focus: var(--ink);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin-inline: auto;
  width: min(1040px, 92vw);
  transform-origin: 50% 100%;
  will-change: transform;
  color: var(--ink);
}
/* parked off-screen until sea.js takes over */
.js .ship { transform: translateX(120vw); }

.ship__rig {
  display: grid;
  grid-template-columns: minmax(0, 0.5fr) minmax(0, 1.5fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: end;
  padding: 44px 5% 16px;
}

/* a mast: the pole runs behind the sail and down into the hull */
.ship__mast {
  position: relative;
  isolation: isolate;
}
.ship__mast::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -36px;
  bottom: -64px; /* runs down behind the hull, which is drawn over it */
  width: 12px;
  margin-left: -6px;
  background: var(--wood-dark);
  border-radius: 6px 6px 0 0;
  z-index: -1;
}

.ship__flag {
  position: absolute;
  left: 50%;
  top: -36px;
  margin-left: 6px;
  padding: 1px 18px 1px 8px;
  background: var(--sun);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.5;
  clip-path: polygon(0 0, 100% 0, 82% 50%, 100% 100%, 0 100%);
}

/* square-rigged sail: a yard across the top, a belly along the bottom */
.ship__sail {
  position: relative;
  margin: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 119px, rgba(11, 37, 69, 0.05) 119px 120px),
    var(--sailcloth);
  border-radius: 6px 6px 50% 50% / 6px 6px 24px 24px;
}
.ship__sail::before {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  top: -5px;
  height: 10px;
  border-radius: 5px;
  background: var(--wood);
}

.ship__sail--photo { padding: 14px 12px 30px; }
.ship__sail--photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
}

.ship__sail--copy {
  padding: clamp(22px, 3vw, 32px) clamp(18px, 3vw, 36px) clamp(36px, 4vw, 48px);
}

.bio__heading {
  font-size: var(--step-2);
  margin-bottom: 10px;
}

.bio__text {
  margin: 0;
  max-width: 62ch;
}
.bio__text + .bio__text { margin-top: 10px; }

.bio__links {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.bio__links a:hover { color: var(--tide); }

.ship__hull {
  position: relative;
  z-index: 1;
  display: block;
  width: 108%;
  height: auto;
  margin-left: -4%;
}
.ship__hull .hull { fill: var(--wood-dark); }
.ship__hull .rail { fill: var(--wood); }
.ship__hull .porthole { fill: var(--chalk-yellow); stroke: #5c3618; stroke-width: 5; }

/* ---- reduced motion: the ship fades in where it docks ---- */
.scene__stage.is-static .ship {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.scene__stage.is-static.is-docked .ship {
  opacity: 1;
  visibility: visible;
}

/* ---- no JavaScript: docked in the flat sea ---- */
html:not(.js) .ship { transform: translateY(calc(var(--sea) * -0.35)); }

/* ---- narrow: one mast, the photo becomes a topsail ---- */
@media (max-width: 760px) {
  .ship__rig {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 30px 3% 14px;
  }
  .ship__mast--fore {
    width: 112px;
    margin: 0 auto;
  }
  .ship__mast--fore { z-index: 1; }
  .ship__mast--fore::before { display: none; }
  .ship__mast--main::before { top: -190px; }
  .ship__flag { top: -190px; }
  .ship__sail--photo { padding: 10px 8px 20px; }
  .ship__sail--photo img { aspect-ratio: 1; }
  .ship__sail--copy { font-size: 0.94rem; line-height: 1.5; }
}
