/* ---------------------------------------------------------------- fonts */
@font-face {
  font-family: 'Gambetta';
  src: url('/assets/fonts/gambetta-400.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Gambetta';
  src: url('/assets/fonts/gambetta-500.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'Gambetta';
  src: url('/assets/fonts/gambetta-700.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-500.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}

/* ---------------------------------------------------------------- tokens */
:root {
  --ink: #10191f;
  --deep: #0c1319;
  --bone: #ede4d3;
  --bone-dim: rgba(237, 228, 211, 0.75);
  --gold: #c98a2e;
  --serif: 'Gambetta', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* hand-drawn wave edges, one per plane — never the same curve twice.
     Each is a shallow strip; pair it with a solid fill below (see .masked-*) so
     the curve keeps real amplitude at any plane height. */
  --wave-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='%23000' d='M0,74 C180,38 340,96 560,62 C780,28 940,88 1180,54 C1300,36 1380,60 1440,46 L1440,120 L0,120 Z'/%3E%3C/svg%3E");
  --wave-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='%23000' d='M0,48 C220,86 420,26 640,64 C860,100 1060,34 1250,72 C1330,88 1400,64 1440,74 L1440,120 L0,120 Z'/%3E%3C/svg%3E");
  --wave-c: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='%23000' d='M0,88 C160,42 380,102 600,58 C800,20 980,84 1200,44 C1320,26 1390,62 1440,52 L1440,120 L0,120 Z'/%3E%3C/svg%3E");
  --fill: linear-gradient(#000, #000);
  /* same idea, filled above the curve — for bottom edges */
  --wave-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='%23000' d='M0,48 C220,86 420,26 640,64 C860,100 1060,34 1250,72 C1330,88 1400,64 1440,74 L1440,0 L0,0 Z'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }

a { color: inherit; }
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

::selection { background: var(--gold); color: var(--ink); }

/* type voices: serif = the human voice, mono = the machine voice */
.line-big {
  font-size: clamp(1.9rem, 4.6vw, 3.6rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 21ch;
  text-wrap: balance;
}
.line-small {
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.7vw, 0.92rem);
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: var(--bone-dim);
  max-width: 52ch;
}

/* ---------------------------------------------------------------- weave */
.weave {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.07;
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 60;
}

/* ---------------------------------------------------------------- loader */
.loader { display: none; }
.js .loader {
  display: grid;
  place-items: center;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(100vh + 8vh); /* wave edge starts below the viewport, shows as it lifts */
  z-index: 100;
  background: var(--bone);
  mask-image: var(--wave-down), var(--fill);
  mask-size: 100% 8vh, 100% calc(100% - 8vh + 1px);
  mask-position: bottom, top;
  mask-repeat: no-repeat;
  -webkit-mask-image: var(--wave-down), var(--fill);
  -webkit-mask-size: 100% 8vh, 100% calc(100% - 8vh + 1px);
  -webkit-mask-position: bottom, top;
  -webkit-mask-repeat: no-repeat;
  padding-bottom: 8vh;
}
.loader-line {
  display: block;
  width: min(38vw, 320px);
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------------------------------------------------------------- top bar */
.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: clamp(1rem, 2.5vw, 1.6rem) clamp(1.1rem, 3vw, 2.2rem);
  z-index: 50;
  mix-blend-mode: normal;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(12, 19, 25, 0.65), 0 1px 14px rgba(12, 19, 25, 0.45);
}
.top-nav { display: flex; gap: clamp(1.1rem, 3vw, 2rem); }
.top-nav a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(237, 228, 211, 0.88);
  text-shadow: 0 1px 3px rgba(12, 19, 25, 0.65), 0 1px 12px rgba(12, 19, 25, 0.5);
  text-decoration: none;
  transition: color 0.25s;
}
.top-nav a:hover { color: var(--gold); }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: clip;
  background: var(--ink);
}
.plane {
  position: absolute;
  left: 0; right: 0;
  pointer-events: none;
}
.plane img, .plane picture { width: 100%; height: 100%; }
.plane-sky { inset: 0; }
.plane-sky img { object-position: center 82%; }
/* the sun itself — the painted gold band sits below the crop at wide aspects */
.plane-sky::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(58% 30% at 50% 53%, rgba(214, 158, 66, 0.34), rgba(214, 158, 66, 0) 70%);
}
.plane-far, .plane-mid, .plane-front {
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: top, bottom;
  -webkit-mask-position: top, bottom;
}
.plane-far {
  bottom: 0; height: 52%;
  mask-image: var(--wave-a), var(--fill);
  -webkit-mask-image: var(--wave-a), var(--fill);
  mask-size: 100% 90px, 100% calc(100% - 89px);
  -webkit-mask-size: 100% 90px, 100% calc(100% - 89px);
}
.plane-mid {
  bottom: 0; height: 36%;
  mask-image: var(--wave-b), var(--fill);
  -webkit-mask-image: var(--wave-b), var(--fill);
  mask-size: 100% 110px, 100% calc(100% - 109px);
  -webkit-mask-size: 100% 110px, 100% calc(100% - 109px);
}
.plane-front {
  bottom: -2%; height: 27%;
  mask-image: var(--wave-c), var(--fill);
  -webkit-mask-image: var(--wave-c), var(--fill);
  mask-size: 100% 120px, 100% calc(100% - 119px);
  -webkit-mask-size: 100% 120px, 100% calc(100% - 119px);
  filter: brightness(0.82) saturate(1.05);
}
.plane-front img { object-position: center top; }
/* the title lives inside the scene: in front of the far water, behind the breaker */
.hero-title {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 28svh;
  text-align: center;
}
.hero-title h1 {
  font-size: clamp(4.6rem, 17vw, 15rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-shadow: 0 3px 40px rgba(12, 19, 25, 0.35);
}
.define {
  margin-top: clamp(0.9rem, 2vw, 1.4rem);
  padding: 0 1.2rem;
  font-family: var(--mono);
  font-size: clamp(0.76rem, 1.7vw, 0.9rem);
  letter-spacing: 0.05em;
  color: rgba(12, 19, 25, 0.95);
  text-shadow: 0 1px 14px rgba(237, 228, 211, 0.55), 0 0 2px rgba(237, 228, 211, 0.35);
}
.define-word { font-weight: 500; }
.define-ipa { color: rgba(12, 19, 25, 0.6); }

/* tide cue: a line that breathes like the water line */
.tide-cue {
  position: absolute;
  bottom: 4svh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}
.tide-cue span {
  display: block;
  width: 2px;
  height: 44px;
  background: var(--bone);
  opacity: 0.7;
}
@media (prefers-reduced-motion: no-preference) {
  .js .tide-cue span { animation: tide 3.2s ease-in-out infinite; transform-origin: top; }
}
@keyframes tide {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

/* painterly gulls, drifting */
.gulls {
  position: absolute;
  width: clamp(150px, 22vw, 280px);
  fill: none;
  stroke: var(--bone-dim);
  stroke-width: 2.4;
  stroke-linecap: round;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .js .gulls { animation: drift 70s linear infinite; }
}
@keyframes drift {
  from { transform: translateX(-6vw); }
  to { transform: translateX(106vw); }
}

/* ---------------------------------------------------------------- mission */
/* still at sea: the same water, deep in shadow, not a flat panel */
.mission {
  position: relative;
  background-image:
    linear-gradient(rgba(12, 19, 25, 0.8), rgba(12, 19, 25, 0.88)),
    url('/assets/sea-far.webp');
  background-size: cover;
  background-position: center;
  padding: clamp(12rem, 30vh, 19rem) clamp(1.4rem, 6vw, 4rem) clamp(13rem, 30vh, 20rem);
  overflow: clip;
}
/* the sea behind: a swell band above, its trough holds the line */
.mission::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: clamp(6rem, 15vh, 10rem);
  background-image: url('/assets/sea-mid.webp');
  background-size: cover;
  background-position: center 30%;
  filter: brightness(0.32) saturate(0.8);
  mask-image: var(--fill), var(--wave-down);
  -webkit-mask-image: var(--fill), var(--wave-down);
  mask-size: 100% calc(100% - 79px), 100% 80px;
  -webkit-mask-size: 100% calc(100% - 79px), 100% 80px;
  mask-position: top, bottom;
  -webkit-mask-position: top, bottom;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
}
.mission .gulls { top: clamp(7rem, 19vh, 12rem); left: 0; }
.gulls-hero {
  top: 16%;
  left: 0;
  width: clamp(110px, 15vw, 190px);
  z-index: 2;
  opacity: 0.8;
}
@media (prefers-reduced-motion: no-preference) {
  .js .gulls-hero { animation-duration: 95s; animation-delay: -25s; }
}
.mission-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.mission .line-big { font-size: clamp(2.1rem, 5.4vw, 4.4rem); }
/* a dark band of the same water crosses the bottom — the set continues */
.mission::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: clamp(7rem, 18vh, 12rem);
  background-image: url('/assets/sea-far.webp');
  background-size: cover;
  background-position: center 60%;
  filter: brightness(0.38) saturate(0.85);
  mask-image: var(--wave-b), var(--fill);
  -webkit-mask-image: var(--wave-b), var(--fill);
  mask-size: 100% 100px, 100% calc(100% - 99px);
  -webkit-mask-size: 100% 100px, 100% calc(100% - 99px);
  mask-position: top, bottom;
  -webkit-mask-position: top, bottom;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
}

/* ---------------------------------------------------------------- beckett */
/* out on the water: the painting is the scene, the words sit on the sea */
.beckett {
  position: relative;
  min-height: 96svh;
  display: grid;
  align-items: center;
  overflow: clip;
  mask-image: var(--wave-a), var(--fill), var(--wave-down);
  -webkit-mask-image: var(--wave-a), var(--fill), var(--wave-down);
  mask-size: 100% 90px, 100% calc(100% - 178px), 100% 90px;
  -webkit-mask-size: 100% 90px, 100% calc(100% - 178px), 100% 90px;
  mask-position: top, center, bottom;
  -webkit-mask-position: top, center, bottom;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
}
.beckett-sea {
  position: absolute;
  inset: 0;
}
.beckett-sea img { object-position: 68% center; }
.beckett-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(1.1rem, 2.5vw, 1.7rem);
  padding: clamp(5rem, 12vh, 8rem) clamp(1.4rem, 6vw, 4rem);
  max-width: 620px;
  margin-left: clamp(0rem, 6vw, 6rem);
  color: rgba(12, 19, 25, 0.96);
  text-shadow: 0 1px 16px rgba(237, 228, 211, 0.5);
}
/* morning haze on the water so the words always have a pale patch to sit on */
.beckett-copy::before {
  content: '';
  position: absolute;
  inset: 2rem -3rem 2rem -4rem;
  background: radial-gradient(65% 60% at 42% 50%, rgba(237, 228, 211, 0.4), rgba(237, 228, 211, 0) 72%);
  pointer-events: none;
  z-index: -1;
}
.beckett-copy .line-small { color: rgba(12, 19, 25, 0.8); }
.beckett-copy .links a { border-color: rgba(12, 19, 25, 0.45); }
.beckett-copy .links a:hover { color: var(--gold); border-color: var(--gold); }
.links {
  display: flex;
  gap: 2rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.links a {
  text-decoration: none;
  border-bottom: 1px solid var(--bone-dim);
  padding-bottom: 3px;
  transition: color 0.25s, border-color 0.25s;
}
.links a:hover { color: var(--gold); border-color: var(--gold); }

/* ---------------------------------------------------------------- about (ashore) */
.page-light { background: var(--bone); color: var(--ink); }
.page-light .top-nav a { color: rgba(16, 25, 31, 0.6); }
.page-light .wordmark,
.page-light .top-nav a { text-shadow: 0 1px 14px rgba(237, 228, 211, 0.65); }
.page-light .top-nav a:hover { color: var(--gold); }

.about-hero {
  height: min(62svh, 620px);
  min-height: 320px;
  mask-image: var(--fill), var(--wave-down);
  -webkit-mask-image: var(--fill), var(--wave-down);
  mask-size: 100% calc(100% - 79px), 100% 80px;
  -webkit-mask-size: 100% calc(100% - 79px), 100% 80px;
  mask-position: top, bottom;
  -webkit-mask-position: top, bottom;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
}

.about-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(4rem, 9vh, 7rem) clamp(1.4rem, 6vw, 4rem) clamp(6rem, 13vh, 9rem);
}
.about-inner { display: grid; gap: clamp(1.2rem, 3vw, 2rem); }
.page-light .line-small { color: rgba(16, 25, 31, 0.78); }
.page-light .links a { border-color: rgba(16, 25, 31, 0.35); }
.page-light .links a:hover { color: var(--gold); border-color: var(--gold); }
.hand {
  font-style: italic;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  color: rgba(16, 25, 31, 0.85);
}
/* the page ends on the painting: the keeper, out on the point */
.about-close {
  height: min(70svh, 640px);
  min-height: 300px;
  mask-image: var(--wave-b), var(--fill);
  -webkit-mask-image: var(--wave-b), var(--fill);
  mask-size: 100% 90px, 100% calc(100% - 89px);
  -webkit-mask-size: 100% 90px, 100% calc(100% - 89px);
  mask-position: top, bottom;
  -webkit-mask-position: top, bottom;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
}

/* ---------------------------------------------------------------- ask */
.ask {
  position: relative;
  overflow: clip;
  mask-image: var(--wave-c), var(--fill);
  -webkit-mask-image: var(--wave-c), var(--fill);
  mask-size: 100% 90px, 100% calc(100% - 89px);
  -webkit-mask-size: 100% 90px, 100% calc(100% - 89px);
  mask-position: top, bottom;
  -webkit-mask-position: top, bottom;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  padding: clamp(8rem, 22vh, 15rem) clamp(1.4rem, 6vw, 4rem);
  display: grid;
  place-items: center;
  text-align: center;
}
.ask-sea {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.ask-sea::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(12, 19, 25, 0.64), rgba(12, 19, 25, 0.8));
}
.ask-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(1.4rem, 3.5vw, 2.4rem);
  justify-items: center;
}
.ask-mail {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(1.3rem, 4.4vw, 2.4rem);
  letter-spacing: 0.01em;
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.35em;
  transition: color 0.25s;
}
.ask-mail:hover { color: var(--gold); }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 760px) {
  .about-body { grid-template-columns: 1fr; }
  .links { gap: 1.4rem; flex-wrap: wrap; }
  .plane-far { height: 46%; }
  .hero-title { padding-bottom: 16svh; }
  .beckett-sea img { object-position: 62% center; }
  .beckett-copy { align-self: start; padding-top: clamp(6rem, 14vh, 9rem); }
}

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .loader { display: none; }
  .tide-cue span { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
