:root {
  /* DESIGN FONT TOKENS: IBM Plex Mono” (Google Fonts */
  --charcoal: #1D1712;
  --sepia: #B98A5A;
  --sand: #F1DFC0;
  --aqua: #2FB7A8;
  --cyan: #8FE7DC;
  --kelp: #315247;
  --coral: #E36F4B;
  --rail: min(78vw, 920px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Commissioner", Inter, system-ui, sans-serif;
  color: var(--charcoal);
  background: var(--sand);
  overflow-x: hidden;
}

.paper-grain,
.paper-grain::before,
.paper-grain::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.paper-grain {
  opacity: .38;
  background:
    radial-gradient(circle at 20% 30%, rgba(29, 23, 18, .08) 0 1px, transparent 1px 9px),
    linear-gradient(90deg, rgba(185, 138, 90, .11) 1px, transparent 1px 17px),
    linear-gradient(rgba(49, 82, 71, .05) 1px, transparent 1px 5px);
  mix-blend-mode: multiply;
}

.paper-grain::before {
  content: "";
  background: repeating-linear-gradient(0deg, transparent 0 8px, rgba(29, 23, 18, .08) 9px, transparent 10px);
}

.paper-grain::after {
  content: "";
  background-image: radial-gradient(rgba(47, 183, 168, .32) 1px, transparent 1.4px);
  background-size: 12px 12px;
  opacity: .22;
  mix-blend-mode: color-burn;
}

.tide-band {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -18vh;
  height: 42vh;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(143, 231, 220, .22), rgba(47, 183, 168, .44)),
    repeating-linear-gradient(97deg, rgba(255,255,255,.18) 0 2px, transparent 2px 22px);
  clip-path: polygon(0 16%, 8% 12%, 21% 20%, 34% 9%, 48% 17%, 62% 11%, 78% 18%, 91% 10%, 100% 15%, 100% 100%, 0 100%);
  mix-blend-mode: multiply;
  transition: transform .18s linear;
}

.cursor-orb {
  position: fixed;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 0 0 7px rgba(227, 111, 75, .12), 0 0 22px rgba(227, 111, 75, .45);
  left: 7vw;
  top: 26vh;
  z-index: 5;
  animation: blink 1.1s steps(2, end) infinite;
  transition: top .7s ease, left .7s ease, border-radius .7s ease;
}

.pier-story { position: relative; z-index: 3; }

.tide-card {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(70px, 11vh, 130px) 0;
  isolation: isolate;
}

.tide-card::before {
  content: "";
  position: absolute;
  inset: 3.5vw;
  border: 1px solid rgba(49, 82, 71, .25);
  border-radius: 34px 42px 30px 46px;
  z-index: -1;
}

.shoreline { background: linear-gradient(180deg, #F1DFC0 0%, rgba(185, 138, 90, .28) 100%); }
.reef { background: linear-gradient(180deg, rgba(241, 223, 192, 1), rgba(143, 231, 220, .24)); }
.archive { background: rgba(185, 138, 90, .18); }
.console { background: linear-gradient(180deg, rgba(49, 82, 71, .12), rgba(241, 223, 192, 1)); }
.signoff { background: var(--charcoal); color: var(--sand); }

.rail {
  width: var(--rail);
  position: relative;
  transform: translateX(var(--drift, 0));
}

.rail-left { --drift: -4vw; }
.rail-right { --drift: 5vw; }
.rail-center { --drift: 0; text-align: center; max-width: 760px; }
.narrow { max-width: 820px; }

.waterline {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(90deg, transparent 0 30px, rgba(49, 82, 71, .44) 30px 72px, transparent 72px 92px);
  z-index: 0;
}
.waterline-high { top: 32vh; }
.waterline-mid { top: 48vh; }
.waterline-low { top: 64vh; }

.stamp {
  display: inline-block;
  margin: 0 0 22px;
  padding: 8px 13px;
  color: var(--kelp);
  border: 1px solid rgba(185, 138, 90, .72);
  background: rgba(241, 223, 192, .68);
  font: 600 12px/1.1 "IBM Plex Mono", monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  transform: rotate(-1deg);
  box-shadow: 5px 6px 0 rgba(185, 138, 90, .14);
}

.caption-kr { font-family: "Noto Serif KR", serif; letter-spacing: .07em; }

.wordmark {
  min-height: 1.05em;
  margin: -90px 0 24px;
  font-size: clamp(64px, 14vw, 178px);
  line-height: .82;
  letter-spacing: -.085em;
  font-weight: 800;
  color: var(--charcoal);
  text-shadow: 6px 8px 0 rgba(47, 183, 168, .32), -3px -2px 0 rgba(185, 138, 90, .4);
}

.wordmark::after,
.typing-target::after,
.console-line::after {
  content: "";
  display: inline-block;
  width: .6ch;
  height: 1em;
  margin-left: 3px;
  vertical-align: -.14em;
  background: var(--coral);
  animation: blink 1s steps(2, end) infinite;
}

h2 {
  max-width: 780px;
  margin: 0 0 24px;
  font-size: clamp(48px, 8vw, 118px);
  line-height: .9;
  letter-spacing: -.055em;
  font-weight: 800;
}

p {
  max-width: 720px;
  font-size: clamp(21px, 3vw, 34px);
  line-height: 1.18;
  font-weight: 300;
  color: inherit;
}

.lead { max-width: 760px; color: var(--kelp); }

.console-line,
.typing-target {
  min-height: 1.4em;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(14px, 1.7vw, 20px);
  letter-spacing: .02em;
  color: var(--kelp);
}

.signoff .console-line { color: var(--cyan); }

.chapter {
  position: absolute;
  top: -72px;
  right: 3vw;
  font-size: clamp(90px, 16vw, 210px);
  line-height: 1;
  font-weight: 800;
  color: rgba(185, 138, 90, .24);
  letter-spacing: -.08em;
}

.photo-window,
.artifact,
.postcard-stack {
  filter: sepia(.75) contrast(1.08) saturate(.95) hue-rotate(118deg);
  transition: filter 1.2s ease, transform 1.2s ease;
}

.is-active [data-duotone] {
  filter: sepia(.25) contrast(1.12) saturate(1.28) hue-rotate(0deg);
  transform: translateY(-8px) rotate(var(--tilt, 0deg));
}

.hero-photo {
  width: min(760px, 85vw);
  height: clamp(260px, 52vh, 520px);
  border: 12px solid rgba(241, 223, 192, .82);
  border-radius: 34px 28px 48px 24px;
  background:
    radial-gradient(circle at 24% 30%, rgba(227, 111, 75, .7) 0 8%, transparent 8.5%),
    linear-gradient(180deg, rgba(47, 183, 168, .44) 0 38%, rgba(185, 138, 90, .62) 38% 100%),
    repeating-linear-gradient(34deg, rgba(29, 23, 18, .18) 0 2px, transparent 2px 16px);
  box-shadow: 20px 26px 0 rgba(49, 82, 71, .18);
  position: relative;
  overflow: hidden;
  --tilt: -1deg;
}

.hero-photo::after,
.artifact::after,
.postcard::after,
.terminal-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(29, 23, 18, .22) 1px, transparent 1.5px);
  background-size: 9px 9px;
  mix-blend-mode: multiply;
  opacity: .42;
}

.scan-row {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 13px, rgba(143, 231, 220, .18) 14px, transparent 16px);
}

.cable-sketch {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: 20%;
  height: 52px;
  border-top: 10px double var(--charcoal);
  border-radius: 50%;
  transform: rotate(-4deg);
  opacity: .62;
}

.artifact {
  width: min(620px, 76vw);
  height: 225px;
  margin: 0 0 36px auto;
  border-radius: 28px 44px 22px 38px;
  background: rgba(143, 231, 220, .34);
  border: 1px solid rgba(49, 82, 71, .34);
  position: relative;
  overflow: hidden;
  --tilt: 1.6deg;
}

.artifact svg { width: 100%; height: 100%; }
.draw-cable { fill: none; stroke: var(--charcoal); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 620; stroke-dashoffset: 620; transition: stroke-dashoffset 1.8s ease; }
.draw-cable.fine { stroke: var(--aqua); stroke-width: 4; }
.is-active .draw-cable { stroke-dashoffset: 0; }
.fish-row { fill: var(--coral); transform: translate(360px, 72px); opacity: .82; }

.postcard-stack {
  height: 330px;
  margin-bottom: 22px;
  position: relative;
  --tilt: -1.8deg;
}

.postcard {
  position: absolute;
  width: min(520px, 72vw);
  height: 250px;
  border: 10px solid rgba(241, 223, 192, .82);
  box-shadow: 14px 16px 0 rgba(29, 23, 18, .12);
  overflow: hidden;
}

.pearl-card {
  left: 8%;
  top: 8px;
  border-radius: 40px 28px 34px 20px;
  background:
    radial-gradient(circle at 18% 34%, rgba(143, 231, 220, .8) 0 28px, transparent 29px),
    radial-gradient(circle at 36% 46%, rgba(241, 223, 192, .92) 0 22px, transparent 23px),
    repeating-linear-gradient(45deg, rgba(49, 82, 71, .2) 0 4px, transparent 4px 24px),
    var(--sepia);
}

.stamp-card {
  left: 28%;
  top: 72px;
  border-radius: 24px 36px 26px 42px;
  background: linear-gradient(135deg, rgba(47, 183, 168, .64), rgba(185, 138, 90, .74));
  display: grid;
  place-items: center;
  transform: rotate(5deg);
}

.stamp-card span {
  font-family: "Noto Serif KR", serif;
  font-size: 66px;
  font-weight: 700;
  color: rgba(29, 23, 18, .72);
  border: 5px solid rgba(227, 111, 75, .72);
  padding: 16px 22px;
}

.receipt-strip {
  width: min(640px, 86vw);
  padding: 14px 18px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(241, 223, 192, .72);
  border-left: 5px solid var(--coral);
  color: var(--kelp);
  font: 500 13px/1.4 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.terminal-panel {
  max-width: 760px;
  padding: clamp(22px, 4vw, 42px);
  margin: 20px 0 30px;
  position: relative;
  overflow: hidden;
  border-radius: 24px 34px 26px 18px;
  background: rgba(29, 23, 18, .88);
  color: var(--cyan);
  border: 1px solid rgba(143, 231, 220, .38);
  box-shadow: 18px 18px 0 rgba(47, 183, 168, .16);
}

.terminal-panel p {
  margin: 0 0 12px;
  font: 500 clamp(15px, 2vw, 22px)/1.3 "IBM Plex Mono", monospace;
  color: var(--cyan);
}

.terminal-panel span { color: var(--coral); }
.terminal-panel .typing-target { color: var(--sand); }

.horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 44vh;
  height: 18px;
  background: var(--sand);
  opacity: .92;
  box-shadow: 0 0 0 20px rgba(47, 183, 168, .12);
}

.signoff h2 { color: var(--cyan); margin-inline: auto; }
.signoff p { margin-inline: auto; color: rgba(241, 223, 192, .86); }
.signoff .stamp { background: rgba(241, 223, 192, .08); color: var(--sand); }

.seal-row { display: flex; justify-content: center; gap: 18px; margin-top: 36px; }
.seal-row span {
  width: 52px;
  height: 52px;
  border-radius: 38% 62% 46% 54%;
  border: 2px solid var(--coral);
  background: rgba(227, 111, 75, .18);
}

@keyframes blink { 50% { opacity: .18; } }

@media (max-width: 760px) {
  .rail, .rail-left, .rail-right { width: min(86vw, 920px); transform: none; }
  .wordmark { margin-top: -48px; }
  .chapter { right: 0; top: -56px; }
  .tide-card::before { inset: 18px; }
  .artifact { margin-left: 0; }
  .postcard { width: 76vw; }
  .stamp-card { left: 14%; }
}
