/* Inter v4.1, SIL Open Font License; see Inter-LICENSE.txt. */
@font-face {
  font-family: 'Inter';
  src: url('/assets/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  color: #fff4de;
  background: #315c73;
  font-family: 'Inter', sans-serif;
  text-wrap: pretty;
}

body {
  --page-padding-block: 24px;
  --time-ruler-height: 28px;
  --footer-row-height: 28px;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100svh;
  box-sizing: border-box;
  padding: var(--page-padding-block) 28px;
}

.water-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.water-background canvas {
  display: block;
  width: 100%;
  height: 100%;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.site-intro { width: 300px; max-width: 100%; }

@media (prefers-reduced-motion: no-preference) {
  .site-logo, .site-intro, main > .portfolio, body > footer {
    animation: page-reveal 1600ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }
  .site-intro { animation-delay: 240ms; }
  main > .portfolio { animation-delay: 480ms; }
  body > footer { animation-delay: 720ms; }

  /* Reveal focused controls immediately; keep them revealed after focus leaves. */
  .site-intro:is(:focus-within, [data-revealed]),
  main > .portfolio:is(:focus-within, [data-revealed]),
  body > footer:is(:focus-within, [data-revealed]) {
    animation: none;
  }
}

@keyframes page-reveal {
  from { opacity: 0; transform: translateY(8px); }
}

@media (min-width: 768px) {
  main {
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: 48px 1fr;
    column-gap: clamp(32px, 6vw, 100px);
    min-height: 500px;
  }
  .site-logo { grid-column: 1; grid-row: 1; align-self: start; }
  .site-intro { grid-column: 1; grid-row: 2; }
  .portfolio { grid-column: 2; grid-row: 1 / span 2; }
}

h1, h2, h3, h4, h5, h6 { text-wrap: balance; }

h1 { margin: 0; font-size: 24px; }

.site-logo { width: fit-content; }

.site-logo img {
  display: block;
  filter: invert(1) sepia(0.2);
}

.profile-links img { filter: brightness(0) invert(1) sepia(0.2); }

p { font-size: 14px;}

.disclosure summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding-block: 8px;
  font-size: 12px;
  list-style: none;
  text-decoration: underline dotted 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary:focus-visible { outline: 1px dotted; outline-offset: 4px; }
.disclosure__icon {
  position: relative;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.disclosure__icon::before,
.disclosure__icon::after {
  content: '';
  position: absolute;
  top: calc(50% - 0.5px);
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
}

.disclosure__icon::after {
  transform: rotate(90deg);
  transition: opacity 180ms ease-out;
}

.disclosure[data-expanded='true'] .disclosure__icon::after,
.disclosure:not([data-expanded])[open] .disclosure__icon::after {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .disclosure__icon::after { transition: none; }
}

.disclosure__content {
  display: flow-root;
  overflow: hidden;
}

.disclosure__content p { margin: 14px 0 0; }

.disclosure__content > .bandcamp-release { margin-top: 14px; }

a {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.profile-links {
  grid-column: -2;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 0 auto;
  flex-shrink: 0;
  padding: 0;
  list-style: none;
}

/* Keep the rightmost social hint inside the viewport. */
.profile-links li:last-child .tooltip__text {
  left: auto;
  right: 0;
  translate: none;
}

.flowers {
  display: block;
  width: 280px;
  max-width: 100%;
  height: auto;
  margin-top: 24px;
}

.business-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 24px;
  font-size: 12px;
}

/* Keep the player lane inside the footer so scrolling to it reveals its controls. */
body:has(> .player-dock) {
  padding-bottom: calc(var(--page-padding-block) + env(safe-area-inset-bottom, 0px));
}
body:has(> .player-dock) footer { padding-bottom: 72px; }

body:has(> footer .water-time:not([hidden])) {
  --footer-row-height: var(--time-ruler-height);
}

.player-dock {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  width: max-content;
  max-width: calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
}

footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 12px 16px;
  opacity: 0.8;
  margin-top: auto;
  padding-top: 32px;
  font-size: 12px;
  line-height: 1.5;
}

.water-time {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 280px);
  height: var(--time-ruler-height);
}

.water-time[hidden] { display: none; }
.water-time button {
  min-height: 28px;
  padding: 4px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
.water-time button:disabled { opacity: 0.5; text-decoration: none; cursor: default; }
.water-time button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

@media (max-width: 767px) {
  footer { grid-template-columns: 1fr auto; }
  .water-time { grid-column: 1 / -1; grid-row: 1; width: min(100%, 240px); }
}

@media (max-width: 440px) {
  body { --page-padding-block: 20px; padding-inline: 20px; }
  .profile-links { gap: 4px; }
}

@media (max-height: 600px) {
  body { --page-padding-block: 16px; }
  .flowers { width: clamp(180px, 35svh, 280px); }
  .flowers, .business-contact { margin-top: 16px; }
  footer { padding-top: 16px; }
}

@media (min-width: 768px) {
  /* On desktop the reserved player lane sits before, rather than below, the footer. */
  body:has(> .player-dock) main {
    margin-bottom: calc(72px + var(--page-padding-block));
  }
  body:has(> .player-dock) footer { padding-block: 0; }
  .player-dock {
    right: max(28px, env(safe-area-inset-right, 0px));
    /* The visible footer row (ruler or links), plus a 16px gap. */
    bottom: calc(var(--page-padding-block) + var(--footer-row-height) + 16px + env(safe-area-inset-bottom, 0px));
  }
}
