/* Hallmark · macrostructure: full-bleed live habitat + ivory editorial letter · genre: atmospheric · inspiration: Awwwards SOTD (brand/INSPO.md) */
/* FISHTANK: a living tank under a quiet ivory editorial page. */
:root {
  --deep: #10241f; --water: #1f4a40; --light: #6f9a7e; --sand: #c8b48e;
  --cream: #ede6d6; --paper: #f3ece4; --ink: #1d2620; --ember: #d9683a; --slate: #3a4448; --moss: #4f6b34;
  --serif: 'Newsreader', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --expo: cubic-bezier(0.19, 1, 0.22, 1);
  --pad: clamp(16px, 2.2vw, 40px);
  --ink-soft: #39453d; --stone: #8c8577;
  --scrim: rgba(16, 36, 31, .66); --scrim-0: rgba(16, 36, 31, 0); --scrim-strong: rgba(16, 36, 31, .82);
  --cream-wash: rgba(237, 230, 214, .12); --cream-dim: rgba(237, 230, 214, .84);
  --paper-glass: rgba(243, 236, 228, .88); --rule: rgba(29, 38, 32, .14);
  --shadow: 0 32px 64px -32px rgba(16, 36, 31, .6);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s14: 56px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--water); }
body { margin: 0; color: var(--cream); font: 400 15px/1.5 var(--sans); background: var(--water); overflow-x: hidden; }
body.exploring { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; transition: none; }

#tank { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; touch-action: pan-y; }
body.exploring #tank { touch-action: none; cursor: grab; }

/* ---------- header: no bar, cream over the water ---------- */
.top { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s5) var(--pad); pointer-events: none; transition: color .6s var(--expo), background-color .6s var(--expo); }
.top > * { pointer-events: auto; }
.top.on-paper { color: var(--ink); background: var(--paper-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.brand { display: inline-flex; align-items: center; gap: var(--s3); text-decoration: none; font: 300 27px/1 var(--serif); letter-spacing: .06em; }
.brand img { width: 72px; height: 72px; margin: calc(var(--s3) * -1) 0; }
.top.on-paper .brand img, .brand.dark img { filter: brightness(.22) sepia(.3); }
.tools { display: flex; align-items: center; gap: var(--s3); }
.icon { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 2px; transition: transform .4s var(--expo), background-color .4s var(--expo); }
.icon:hover { transform: translateY(-2px); background: var(--cream-wash); }
.icon:active { transform: translateY(0); }
.icon svg { width: 18px; height: 18px; }
.ca { height: 36px; padding: 0 var(--s3); border: 1px solid currentColor; border-radius: 2px; background: transparent; font: 400 13px/1 var(--sans); white-space: nowrap; transition: background-color .4s var(--expo); }
.ca:hover:not(:disabled) { background: var(--cream-wash); }
.ca:active:not(:disabled) { transform: translateY(1px); }
.ca:disabled { cursor: default; border-style: dashed; }
.ca.copied { background: var(--cream); color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 var(--s5); border: 1px solid var(--cream); border-radius: 2px; background: var(--cream); color: var(--ink); font: 500 14px/1 var(--sans); text-decoration: none; white-space: nowrap; transition: transform .4s var(--expo), background-color .4s var(--expo), color .4s var(--expo); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.top.on-paper .btn:not(.ghost), .paper .btn:not(.ghost) { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pair { display: inline-flex; gap: var(--s1); }
.arrow { width: 40px; height: 40px; display: inline-grid; place-items: center; background: var(--cream); color: var(--ink); border: 0; border-radius: 2px; transition: transform .4s var(--expo); }
.arrow svg { width: 18px; height: 18px; }
.pair:hover .arrow { transform: translateX(4px); }
.arrow:active { transform: translateX(0); }

/* ---------- hero over the live tank ---------- */
main { position: relative; z-index: 2; pointer-events: none; }
.paper, .card, .explore-bar { pointer-events: auto; }
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; pointer-events: none; }
.hero-in { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 var(--pad) clamp(32px, 6vh, 72px); will-change: transform; }
.hero-in::before { content: ''; position: absolute; inset: 34% 0 0 0; background: linear-gradient(to top, var(--scrim), var(--scrim-0)); z-index: -1; }
.title { margin: 0; font: 200 clamp(56px, 9.6vw, 196px)/.92 var(--serif); text-transform: uppercase; letter-spacing: -.01em; color: var(--cream); }
.title .line { display: block; white-space: nowrap; will-change: transform; }
.title .l2 { padding-left: 1.05em; }
.hero-copy { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s5) var(--s10); margin-top: clamp(16px, 3vh, 36px); pointer-events: auto; }
.lede { margin: 0; max-width: 30ch; font: 300 clamp(20px, 1.7vw, 30px)/1.25 var(--serif); }
.census-line { margin: 0; max-width: 42ch; font-size: 14px; color: var(--cream-dim); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
body.exploring .hero-in, body.exploring .paper { opacity: 0; pointer-events: none; }
body.exploring .hero-copy { pointer-events: none; }
.hero-in, .paper { transition: opacity .9s var(--expo); }

.explore-bar { position: fixed; z-index: 15; left: var(--pad); right: var(--pad); bottom: var(--s6); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }
.explore-bar p { margin: 0; max-width: 46ch; font: 300 19px/1.3 var(--serif); text-shadow: 0 1px 12px var(--scrim); }

/* ---------- fish card ---------- */
.card { position: fixed; z-index: 25; right: var(--pad); top: 96px; width: min(340px, calc(100vw - 2 * var(--pad))); padding: var(--s6) var(--s6) var(--s5); background: var(--paper); color: var(--ink); border-radius: 2px; box-shadow: var(--shadow); animation: card-in .9s var(--expo); }
@keyframes card-in { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } }
.card .close { position: absolute; top: var(--s2); right: var(--s3); width: 32px; height: 32px; border: 0; background: none; font-size: 22px; line-height: 1; }
.card .close:hover { color: var(--ember); }
.card .close:active { transform: translateY(1px); }
.card-kind { margin: 0 0 var(--s1); font: 300 30px/1.05 var(--serif); }
.card-wallet { margin: 0 0 var(--s4); font-size: 14px; color: var(--slate); }
.card dl { margin: 0 0 var(--s4); display: grid; gap: var(--s2); }
.card dl div { display: flex; justify-content: space-between; gap: var(--s3); border-bottom: 1px solid var(--rule); padding-bottom: var(--s2); }
.card dt { color: var(--slate); font-size: 14px; }
.card dd { margin: 0; font-size: 14px; font-weight: 500; text-align: right; }
.link { font-size: 14px; color: var(--ink); text-underline-offset: 3px; }
.link:hover { color: var(--moss); }
.link:active { color: var(--ember); }

/* ---------- ivory editorial ---------- */
.paper { position: relative; background: var(--paper); color: var(--ink); padding: clamp(80px, 12vw, 200px) var(--pad) var(--s10); }
.paper section + section { margin-top: clamp(112px, 13vw, 220px); }
.big { margin: 0; max-width: 24em; font: 300 clamp(26px, 2.6vw, 46px)/1.18 var(--serif); }
.big em { font-style: italic; color: var(--moss); }
h2 { margin: 0 0 var(--s4); font: 200 clamp(44px, 5.4vw, 104px)/.95 var(--serif); }
.sub { margin: 0 0 clamp(32px, 4vw, 56px); max-width: 38em; font: 300 clamp(19px, 1.45vw, 24px)/1.35 var(--serif); color: var(--ink-soft); }

.whale-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s4); }
.whale { margin: 0; }
.whale .frame { position: relative; aspect-ratio: 3 / 4.2; overflow: hidden; background: var(--water); }
.whale .frame canvas { position: absolute; inset: -6% 0; width: 100%; height: 112%; object-fit: cover; transform: scale(1.12); transition: transform 2s var(--expo); will-change: transform; }
.whale:hover .frame canvas { transform: scale(1.16); }
.whale figcaption { margin-top: var(--s3); font: 300 22px/1.2 var(--serif); }
.whale figcaption small { display: block; margin-top: var(--s1); font: 400 14px/1.4 var(--sans); color: var(--slate); }
.whale button.frame-btn { all: unset; display: block; width: 100%; cursor: pointer; }
.whale button.frame-btn:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
.whale button.frame-btn:active .frame { opacity: .9; }

.marquee { overflow: hidden; margin: 0 calc(-1 * var(--pad)); padding: var(--s2) 0; }
.track { display: flex; gap: var(--s14); width: max-content; animation: marquee 120s linear infinite; }
.marquee:hover .track, .marquee:focus-within .track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.move { display: flex; align-items: baseline; gap: var(--s3); white-space: nowrap; font: 300 clamp(24px, 2.2vw, 38px)/1.2 var(--serif); }
.move b { font-weight: 400; }
.move .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--slate); align-self: center; }
.move.in .dot { background: var(--moss); } .move.out .dot { background: var(--stone); } .move.whale .dot { background: var(--ember); }
.move time { font: 400 14px/1 var(--sans); color: var(--slate); }

.mine-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.mine-text .actions + .actions { margin-top: var(--s3); }
.share { margin: 0; }
.share canvas { width: 100%; height: auto; display: block; box-shadow: var(--shadow); }

.foot { margin-top: clamp(120px, 14vw, 240px); padding-top: var(--s8); border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4) var(--s8); font-size: 14px; color: var(--slate); }
.foot p { margin: 0; }
.foot .brand { color: var(--ink); font-size: 22px; }
.foot .brand img { width: 32px; height: 32px; }
.foot-links { display: flex; gap: var(--s5); }
.foot a:hover { color: var(--moss); }
.foot a:active { color: var(--ember); }

/* ---------- reveals: blur + rise, staggered ---------- */
[data-reveal] { opacity: 0; filter: blur(10px); transform: translateY(28px); transition: opacity 1.6s var(--expo), filter 1.6s var(--expo), transform 1.6s var(--expo); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; filter: none; transform: none; }
.title [data-reveal].in { transform: translateX(var(--slide, 0px)); }

.fps { position: fixed; z-index: 40; left: var(--s3); bottom: var(--s3); padding: var(--s2); background: var(--scrim-strong); color: var(--cream); font: 400 12px/1.3 var(--sans); border-radius: 2px; white-space: pre; }
.fps[hidden] { display: none; }

@media (max-width: 1100px) {
  .whale-row { grid-template-columns: repeat(5, minmax(200px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad) var(--s2); }
  .whale { scroll-snap-align: start; }
}
@media (max-width: 760px) {
  .top { flex-wrap: wrap; justify-content: flex-start; gap: var(--s3) var(--s2); padding: var(--s3) var(--pad); }
  .top::after { content: ''; order: 1; flex-basis: 100%; }
  .tools { display: contents; }
  .brand { order: 0; flex: 1; }
  #connect { order: 1; }
  .icon, .ca, #buy { order: 2; }
  #buy { margin-left: auto; }
  .brand { font-size: 22px; } .brand img { width: 52px; height: 52px; margin: calc(var(--s2) * -1) 0; }
  .tools .btn { height: 36px; padding: 0 var(--s3); font-size: 13px; }
  .ca { height: 36px; font-size: 12px; }
  .icon { width: 32px; height: 32px; }
  .title { font-size: clamp(36px, 11.4vw, 80px); }
  .title .l2 { padding-left: .5em; }
  .hero-copy { flex-direction: column; align-items: flex-start; }
  .mine-grid { grid-template-columns: minmax(0, 1fr); }
  .card { top: auto; bottom: var(--s4); }
  .whale-row { grid-template-columns: repeat(5, 72vw); }
}
@media (max-width: 440px) {
  #buy .long { display: none; }
}
@media (max-width: 360px) {
  .top { gap: var(--s2) var(--s1); }
  .tools .btn { padding: 0 var(--s2); font-size: 12px; }
  .ca { font-size: 11px; padding: 0 var(--s2); }
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; filter: none; transform: none; transition: none; }
  .title [data-reveal].in { transform: none; }
  .btn, .icon, .arrow, .ca, .top, .hero-in, .paper, .whale .frame canvas { transition: none; }
  .btn:hover, .icon:hover, .pair:hover .arrow, .whale:hover .frame canvas { transform: none; }
  .card { animation: none; }
  .track { animation: none; flex-wrap: wrap; width: auto; row-gap: var(--s3); }
  .whale .frame canvas { transform: none; inset: 0; height: 100%; }
}
@media (min-width: 2200px) {
  .top, .hero-copy, .card, .explore-bar { zoom: 1.3; }
}
