.home-page .site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  background: transparent;
  border-bottom: 1px solid #ffffff25;
  color: #fff;
}
.home-page .site-nav a {
  color: #fff;
}
.home-page .brand img {
  filter: invert(1);
}
.ocean-journey {
  height: 350svh;
  position: relative;
  background: #052b38;
}
.ocean-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: linear-gradient(#875877, #ffaf74 47%, #153d4d 48%, #031d30);
}
#ocean-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.ocean-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(#05182635, transparent 35%, #00142330);
}
.ocean-intro {
  position: absolute;
  top: 23%;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff6e9;
  pointer-events: none;
}
.ocean-intro p {
  font-size: 14px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.ocean-instruction {
  display: block;
  margin-top: 16px;
  font-size: 16px;
  opacity: 0.75;
}
.submerged-identity {
  position: absolute;
  top: 32%;
  left: 8%;
  right: 8%;
  text-align: center;
  color: #d9ffff;
  opacity: 0;
  transform: translateY(80px);
  will-change: transform, opacity;
}
.submerged-identity h1 {
  margin: 0;
}
.submerged-identity img {
  width: min(850px, 88%);
  filter: invert(1) drop-shadow(0 0 24px #9feeff55);
  opacity: 0.93;
}
.submerged-identity p {
  font-size: 18px;
  margin: 32px auto 24px;
}
.submerged-identity a {
  display: inline-block;
  color: #e9ffff;
  padding: 12px 0;
  border-bottom: 1px solid #a9e5e6;
  font-size: 16px;
}
.ocean-caption {
  position: absolute;
  bottom: 40px;
  left: 4.2%;
  right: 4.2%;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #d8eff0;
  font-size: 14px;
}
.ocean-caption span:first-child {
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.ocean-motion {
  position: absolute;
  right: 4.2%;
  bottom: 85px;
  background: #082e3d55;
  border: 1px solid #ffffff45;
  color: #fff;
  border-radius: 30px;
  padding: 9px 15px;
  font-size: 14px;
  cursor: pointer;
}
.home-page .home-selected {
  position: relative;
  z-index: 2;
}
.ocean-stage:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #001222;
  opacity: var(--night, 0);
  mix-blend-mode: multiply;
}
@media (max-width: 650px) {
  .ocean-journey {
    height: 350svh;
  }
  .submerged-identity {
    top: 38%;
    left: 3%;
    right: 3%;
  }
  .submerged-identity p {
    font-size: 16px;
    max-width: 260px;
  }
  .ocean-caption {
    bottom: 22px;
    font-size: 12px;
  }
  .ocean-caption span:last-child {
    max-width: 140px;
    text-align: right;
  }
  .ocean-intro {
    top: 25%;
  }
  .ocean-motion {
    bottom: 70px;
  }
  .home-page .site-header {
    padding-inline: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ocean-journey {
    height: 350svh;
  }
}

/* Sunset print palette */
.ocean-stage {
  background: linear-gradient(#9f2430, #ed501f 48%, #231027 49%, #082f3c);
}
.ocean-intro {
  color: #ffe4bb;
  text-shadow: 0 1px 16px #49112488;
}
.ocean-caption {
  color: #ffe4ca;
}
.ocean-motion {
  background: #30112955;
  border-color: #ffc59470;
  color: #ffe6c5;
}
.submerged-identity {
  color: #dcf1df;
}
.submerged-identity img {
  filter: invert(1) sepia(0.2) drop-shadow(0 8px 22px #001e3270);
}
.submerged-identity a {
  color: #eaf4df;
  border-color: #a7d2be;
}

.ocean-journey {
  height: 350svh;
}
.ocean-intro {
  display: none;
}
.home-page .site-header,
.ocean-caption,
.ocean-motion {
  opacity: 0;
}
.ocean-stage {
  background: linear-gradient(#639caf, #e9dac0);
}
@media (max-width: 650px) {
  .ocean-journey {
    height: 350svh;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ocean-journey {
    height: 350svh;
  }
}

.submerged-identity {
  will-change: top, clip-path, transform;
  transform: none;
}
.submerged-identity img {
  filter: invert(1) sepia(0.15) drop-shadow(0 10px 20px #001c2c80);
}
.ocean-journey {
  height: 350svh;
}
@media (max-width: 650px) {
  .ocean-journey {
    height: 350svh;
  }
}

/* Keep the floating wordmark centred independently of shared heading styles. */
.submerged-identity {
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
}
.submerged-identity h1 {
  display: block;
  width: 100%;
  text-align: center;
}
.submerged-identity img {
  display: block;
  margin-inline: auto;
}

@media (max-width: 650px) {
  .ocean-journey {
    height: 320svh;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ocean-journey {
    height: 220svh;
  }
}

/* Navigation emerges beneath the rising surface, above the floating wordmark. */
.home-page .ocean-stage .site-header {
  position: absolute;
  inset: auto 0 auto;
  z-index: 20;
  border-bottom: 0;
  background: transparent;
  will-change: top, opacity;
}

/* Follow the original saved light/dark preference throughout the settled home view. */
.submerged-identity img {
  filter: invert(var(--ocean-logo-invert, 1)) drop-shadow(0 10px 20px #001c2c30);
}
.submerged-identity,
.submerged-identity a,
.home-page .ocean-stage .site-nav a {
  color: var(--ocean-ui-colour, #dcf1df);
}
.home-page .ocean-stage .brand img {
  filter: invert(var(--ocean-logo-invert, 1));
}
.submerged-identity a {
  border-color: currentColor;
}

/* Greeting follows the sun; the scene itself is unchanged. */
.sun-welcome {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30svh;
  text-align: center;
  color: #fff7ec;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6svh;
  line-height: 1.15;
  font-family: inherit;
  font-size: clamp(15px, 2.3svh, 25px);
  font-weight: 400;
}
.sun-welcome strong {
  font-family: inherit;
  font-size: clamp(23px, 3.7svh, 40px);
  font-weight: 500;
  letter-spacing: -0.025em;
}
.sun-welcome .sun-down {
  font-size: clamp(19px, 2.5svh, 28px);
  line-height: 1;
  margin-top: 1svh;
  animation: sun-arrow-bounce 1.8s ease-in-out infinite;
}
@keyframes sun-arrow-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sun-welcome .sun-down {
    animation: none;
  }
}

.sun-welcome,
.sun-welcome strong {
  animation: none;
  transition: none;
}
.sun-welcome {
  will-change: transform, opacity;
}
.sun-welcome .sun-down {
  will-change: transform;
}

/* Preserve the supplied lettering and centre its visible artwork within the sun. */
.sun-welcome {
  width: 26svh;
  gap: 0;
}
.sun-welcome-art {
  width: 26svh;
  height: 11.42svh;
  overflow: hidden;
}
.sun-welcome-art img {
  display: block;
  width: 26svh;
  height: 26svh;
  max-width: none;
  transform: translateY(-6.74svh);
  animation: none;
  transition: none;
}
.sun-welcome .sun-down {
  position: absolute;
  top: calc(100% + 1svh);
  left: 50%;
  margin: 0 0 0 -0.5em;
  width: 1em;
  text-align: center;
}

.sun-welcome-art {
  height: 3.42svh;
}
.sun-welcome-art img {
  transform: translateY(-10.81svh);
}
.sun-welcome .sun-down {
  pointer-events: auto;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}
.sun-welcome .sun-down:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 7px;
}
.sun-welcome .sun-down:disabled {
  pointer-events: none;
}

.sun-welcome .sun-down {
  font-size: clamp(21px, 2.8svh, 31px);
}

/* Centre the visible welcome lettering; place the arrow lower inside the sun. */
.sun-welcome-art img {
  transform: translate(0.325svh, -10.81svh);
}
.sun-welcome .sun-down {
  top: calc(50% + 10svh);
  font-size: clamp(24px, 3.3svh, 36px);
}

.opening-scroll-hint {
  position: absolute;
  right: 4.2%;
  bottom: 85px;
  color: #f7f3ed;
  font-size: 14px;
  pointer-events: none;
}
.sun-scroll-area {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34.9svh;
  height: 34.9svh;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.sun-scroll-area:focus-visible {
  outline: 2px solid #fff7ec;
  outline-offset: 5px;
}
.sun-welcome-art {
  pointer-events: auto;
  cursor: pointer;
  transition: scale 0.25s ease;
  scale: 1;
}
.sun-welcome-art:hover {
  scale: 1.08;
}
.sun-welcome .sun-down {
  font-size: clamp(22px, 3svh, 33px);
}
@media (max-width: 650px) {
  .opening-scroll-hint {
    bottom: 70px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sun-welcome-art {
    transition: none;
  }
}

/* Opening controls share a restrained row at the top right. */
.opening-scroll-hint {
  top: 30px;
  bottom: auto;
  right: calc(4.2% + 170px);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.ocean-motion {
  top: 30px;
  bottom: auto;
  height: 42px;
}
.explore-down {
  pointer-events: auto;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: 28px;
  padding: 5px;
  cursor: pointer;
  animation: sun-arrow-bounce 1.8s ease-in-out infinite;
}
.explore-down:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 3px;
}
.welcome-label {
  font-family: inherit;
  font-size: clamp(22px, 4svh, 42px);
  font-weight: 500;
  letter-spacing: 0.06em;
  display: block;
  transition: transform 0.25s ease;
}
.sun-scroll-area:hover ~ .sun-welcome .welcome-label,
.sun-scroll-area:focus-visible ~ .sun-welcome .welcome-label {
  transform: scale(1.08);
}
@media (max-width: 650px) {
  .opening-scroll-hint {
    top: 22px;
    bottom: auto;
    right: calc(4.2% + 140px);
    font-size: 12px;
    gap: 5px;
  }
  .ocean-motion {
    top: 22px;
    font-size: 12px;
    padding: 9px 12px;
  }
  .explore-down {
    font-size: 25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .explore-down {
    animation: none;
  }
  .welcome-label {
    transition: none;
  }
}

/* Refine only the greeting hover and the two corner controls. */
.sun-welcome {
  top: 50%;
  left: 50%;
  width: auto;
  line-height: 1;
  align-items: center;
  justify-content: center;
}
.welcome-label {
  line-height: 1;
  transform-origin: center;
  transition: transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.sun-scroll-area:hover ~ .sun-welcome .welcome-label,
.sun-scroll-area:focus-visible ~ .sun-welcome .welcome-label {
  transform: scale(1.18);
}
.opening-scroll-hint {
  top: auto;
  bottom: 30px;
  right: 4.2%;
  height: 32px;
  gap: 10px;
}
.explore-down {
  font-size: 22px;
  padding: 0;
  width: 24px;
  text-align: center;
}
.ocean-motion {
  top: 30px;
  bottom: auto;
  right: 4.2%;
}
@media (max-width: 650px) {
  .opening-scroll-hint {
    top: auto;
    bottom: 22px;
    right: 4.2%;
    gap: 8px;
  }
  .ocean-motion {
    top: 22px;
    right: 4.2%;
  }
  .explore-down {
    font-size: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-label {
    transition: none;
  }
}

.home-page .ocean-stage > .opening-scroll-hint {
  position: absolute;
  inset: auto 4.2% 22px auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 32px;
  margin: 0;
  transform: none;
}

/* Larger greeting and a gentle water-like hover on Selected work only. */
.welcome-label {
  font-size: clamp(26px, 4.8svh, 50px);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .home-selected .portfolio-card:hover {
    animation: selected-work-float 2.6s ease-in-out infinite;
    transform-origin: 50% 65%;
  }
}
@keyframes selected-work-float {
  0%,
  100% {
    translate: 0 0;
    rotate: 0deg;
  }
  25% {
    translate: 0 -6px;
    rotate: -0.45deg;
  }
  50% {
    translate: 0 -10px;
    rotate: 0deg;
  }
  75% {
    translate: 0 -5px;
    rotate: 0.45deg;
  }
}

/* Increase the resting greeting size and the existing card buoyancy. */
.welcome-label {
  font-size: clamp(32px, 5.8svh, 60px);
}
@keyframes selected-work-float {
  0%,
  100% {
    translate: 0 0;
    rotate: 0deg;
  }
  25% {
    translate: 0 -10px;
    rotate: -0.8deg;
  }
  50% {
    translate: 0 -16px;
    rotate: 0deg;
  }
  75% {
    translate: 0 -8px;
    rotate: 0.8deg;
  }
}

/* Keep the opening greeting comfortably within the sun, including hover. */
.sun-welcome {
  width: 34.9svh;
  height: 34.9svh;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
}
.welcome-label {
  white-space: nowrap;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .home-selected .portfolio-card:hover {
    animation: none;
  }
  .home-selected .portfolio-card {
    transition:
      translate 0.7s ease,
      rotate 0.7s ease;
  }
}

.welcome-label {
  font-size: clamp(34px, 6.2svh, 64px);
}
.ocean-volume {
  position: absolute;
  right: 4.2%;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ocean-ui-colour, #dcf1df);
  transition:
    opacity 0.3s,
    top 0.3s;
}
.ocean-volume[hidden] {
  display: none;
}
.ocean-volume-symbol {
  border: 0;
  background: none;
  color: inherit;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.ocean-volume input {
  width: 92px;
  height: 4px;
  accent-color: currentColor;
  cursor: pointer;
}

/* Requested audio control styling and position. */
.ocean-volume {
  left: 4.2%;
  right: auto;
  color: #fff;
}
.ocean-volume-symbol {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 3px;
}
.ocean-volume-symbol img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ocean-volume-symbol.is-muted:after {
  content: "";
  position: absolute;
  left: 3px;
  top: 13px;
  width: 24px;
  height: 2px;
  background: #fff;
  transform: rotate(-45deg);
  box-shadow: 0 0 2px #203342;
}
.ocean-volume input {
  appearance: none;
  -webkit-appearance: none;
  width: 92px;
  height: 4px;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  outline-offset: 6px;
}
.ocean-volume input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}
.ocean-volume input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  margin-top: -4px;
}
.ocean-volume input::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}
.ocean-volume input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .home-selected .portfolio-card {
    transition:
      translate 0s,
      rotate 0s;
  }
}

/* Rounded lens typography only while the opening sun is hovered. */
.welcome-lens-letter {
  display: inline-block;
  transform: scaleY(1);
  transform-origin: 50% 50%;
  transition: transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.sun-scroll-area:hover ~ .sun-welcome .welcome-lens-letter,
.sun-scroll-area:focus-visible ~ .sun-welcome .welcome-lens-letter {
  transform: scaleY(var(--lens-height));
}
@media (prefers-reduced-motion: reduce) {
  .welcome-lens-letter {
    transition: none;
  }
}

/* The lens renderer replaces only the WELCOME enlargement. */
.sun-scroll-area:hover ~ .sun-welcome .welcome-label,
.sun-scroll-area:focus-visible ~ .sun-welcome .welcome-label {
  transform: none;
}
.sun-scroll-area:hover ~ .sun-welcome .welcome-lens-letter,
.sun-scroll-area:focus-visible ~ .sun-welcome .welcome-lens-letter {
  transform: none;
}
.welcome-lens-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Larger resting greeting, in navy; all lens geometry stays unchanged. */
.welcome-label {
  font-size: clamp(38px, 6.8svh, 70px);
  color: #102638;
}

/* Refine only the WELCOME lettering. */
.welcome-label {
  color: #174da0;
  font-size: clamp(40px, 7.3svh, 76px);
  font-weight: 700;
  letter-spacing: 0.025em;
}

/* Original WELCOME typography, with a balanced navy blue. */
.welcome-label {
  color: #203e70;
  font-size: clamp(38px, 6.8svh, 70px);
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* Small resting WELCOME with a slightly stronger weight. */
.welcome-label {
  font-size: clamp(22px, 3.6svh, 38px);
  font-weight: 600;
}

/* Serif WELCOME lettering inspired by the supplied wordmark. */
.welcome-label {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

/* Two-line entrance typography and controls revealed on entry only. */
.welcome-label {
  font-family: inherit;
  font-weight: 600;
  line-height: 1.1;
}
.welcome-label > span {
  display: block;
}
html:not([data-ocean-entered]) .opening-scroll-hint,
html:not([data-ocean-entered]) .ocean-volume {
  visibility: hidden;
}

/* Entrance colour and aligned two-line lettering only. */
.welcome-label {
  color: #f4f0ee;
}
.welcome-label > .enter-site-line {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

/* Slightly smaller entrance text at rest only. */
.welcome-label {
  font-size: clamp(20px, 3.2svh, 34px);
}

/* Keep the entrance still until ENTER SITE is activated. */
html:not([data-ocean-entered]):has(body.home-page) {
  overflow: hidden;
  overscroll-behavior: none;
}
html:not([data-ocean-entered]) body.home-page {
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
  touch-action: none;
}

@font-face {
  font-family: "Josefin Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/josefin-sans-600.ttf") format("truetype");
}
.welcome-label {
  font-family: "Josefin Sans", sans-serif;
}
