/* Shellby: design system. Tokens, type, layout, the shared chrome and the
   components every page uses. Page-specific styles live in their own file. */

@font-face { font-family: 'Pixelify Sans'; src: url('fonts/PixelifySans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('fonts/AtkinsonHyperlegible-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('fonts/AtkinsonHyperlegible-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Martian Mono'; src: url('fonts/MartianMono.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  /* the sea, darkest to lightest */
  --abyss: #081214;
  --deep: #0d1c1d;
  --reef: #132827;
  --kelp: #1b3835;
  --tide: #24504b;
  --sea: #3fb8a3;
  --glass: #7fd6c2;
  --foam: #a8ecd9;
  /* the crab */
  --coral: #ff7a5c;
  --coral-hi: #ff9b7d;
  --ember: #c9482f;
  /* the beach */
  --sand: #ead9b6;
  --sand-lo: #b3a892;
  --paper: #fff4e4;
  --sun: #ffd166;
  --ink: #141225;
  --berry: #ff5c8a;

  --text: #fff4e4;
  --text-2: rgba(255, 244, 228, .74);
  --text-3: rgba(255, 244, 228, .56);
  --line: rgba(168, 236, 217, .12);
  --line-2: rgba(168, 236, 217, .22);
  --panel: rgba(19, 40, 39, .72);

  --f-pixel: 'Pixelify Sans', ui-monospace, monospace;
  --f-body: 'Atkinson Hyperlegible', system-ui, 'Segoe UI', sans-serif;
  --f-mono: 'Martian Mono', ui-monospace, 'Cascadia Code', monospace;

  --step--1: clamp(.84rem, .82rem + .1vw, .9rem);
  --step-0: clamp(1rem, .97rem + .15vw, 1.09rem);
  --step-1: clamp(1.18rem, 1.1rem + .4vw, 1.38rem);
  --step-2: clamp(1.45rem, 1.28rem + .85vw, 1.95rem);
  --step-3: clamp(1.9rem, 1.55rem + 1.75vw, 2.95rem);
  --step-4: clamp(2.4rem, 1.8rem + 3vw, 4.4rem);
  --step-5: clamp(2.9rem, 1.9rem + 5vw, 6.6rem);

  --wrap: 1200px;
  --gutter: clamp(1.1rem, .6rem + 2.4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 60px -24px rgba(0, 0, 0, .7);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}

/* ------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; min-height: 100vh; background: var(--abyss); color: var(--text);
  font: 400 var(--step-0)/1.62 var(--f-body); text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--foam); text-decoration-color: rgba(168, 236, 217, .4); text-underline-offset: .2em; }
a:hover { color: var(--paper); text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--coral); color: var(--ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.08; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
code, kbd, pre { font-family: var(--f-mono); font-size: .86em; }
kbd {
  display: inline-block; padding: .08em .45em; border-radius: 5px; border: 1px solid var(--line-2);
  border-bottom-width: 3px; background: var(--reef); color: var(--paper); font-size: .78em; line-height: 1.5;
}
.px, .px img, img.px { image-rendering: pixelated; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -60px; z-index: 100; padding: .6rem 1rem; background: var(--sun); color: var(--ink); border-radius: 8px; font-weight: 700; }
.skip:focus { top: 1rem; }

/* ------------------------------------------------------------ layout */
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap.narrow { --wrap: 820px; }
.section { padding-block: clamp(4.5rem, 3rem + 7vw, 9rem); position: relative; }
.section.tight { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }
.stack > * + * { margin-top: var(--stack, 1rem); }
.grid { display: grid; gap: var(--gap, clamp(1rem, .6rem + 1.5vw, 1.75rem)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.split > *, .page-hero .wrap > * { min-width: 0; }
.split { display: grid; gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .split.flip > :first-child { order: 2; }
}

/* ------------------------------------------------------------ type */
.display { font-family: var(--f-pixel); font-weight: 700; letter-spacing: -.005em; line-height: .98; }
.h1 { font-size: var(--step-5); }
.h2 { font-size: var(--step-4); }
.h3 { font-size: var(--step-3); }
.h4 { font-size: var(--step-2); }
.lede { font-size: var(--step-1); color: var(--text-2); max-width: 62ch; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem; font: 600 .74rem/1 var(--f-mono);
  letter-spacing: .14em; text-transform: uppercase; color: var(--glass);
}
.eyebrow::before { content: ''; width: 8px; height: 8px; background: var(--coral); box-shadow: 8px 0 0 var(--coral-hi); margin-right: 8px; }
.accent { color: var(--coral); }
.accent-2 { color: var(--glass); }
.prose { max-width: 70ch; }
.prose > * + * { margin-top: 1rem; }
.prose h2 { font: 700 var(--step-2)/1.15 var(--f-pixel); margin-top: 2.6rem; }
.prose h3 { font-size: var(--step-1); margin-top: 1.8rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: .4rem; }
.prose li::marker { color: var(--coral); }
.prose code { background: var(--reef); padding: .1em .4em; border-radius: 5px; color: var(--foam); }

/* ------------------------------------------------------------ buttons */
.btn {
  --bg: var(--reef); --fg: var(--paper); --bd: var(--line-2);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: .75rem 1.3rem; border-radius: 12px; border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); font: 700 1rem/1 var(--f-body); text-decoration: none;
  cursor: pointer; transition: transform .25s var(--ease-out), background-color .2s, border-color .2s, box-shadow .25s;
  white-space: nowrap;
}
.btn:hover { color: var(--fg); border-color: var(--glass); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary {
  --bg: var(--coral); --fg: var(--ink); --bd: transparent;
  box-shadow: 0 0 0 0 rgba(255, 122, 92, 0), 0 10px 30px -10px rgba(255, 122, 92, .7), inset 0 -3px 0 rgba(0, 0, 0, .18);
}
.btn.primary:hover { --bg: var(--coral-hi); box-shadow: 0 0 0 6px rgba(255, 122, 92, .16), 0 16px 40px -12px rgba(255, 122, 92, .85), inset 0 -3px 0 rgba(0, 0, 0, .18); }
.btn.ghost { --bg: transparent; }
.btn.big { min-height: 58px; padding: 1rem 1.6rem; font-size: 1.08rem; border-radius: 14px; }
.btn.small { min-height: 38px; padding: .5rem .9rem; font-size: .9rem; border-radius: 10px; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn .meta { font: 500 .72rem/1 var(--f-mono); opacity: .7; letter-spacing: .02em; }
.btn.primary .meta { opacity: 1; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.link-arrow { font-weight: 700; text-decoration: none; display: inline-flex; gap: .4rem; align-items: center; }
.link-arrow::after { content: '→'; transition: transform .25s var(--ease-out); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ------------------------------------------------------------ header */
.site-head {
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  background: linear-gradient(rgba(8, 18, 20, .82), rgba(8, 18, 20, .6)); border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.site-head.scrolled { border-bottom-color: var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--paper); text-decoration: none; font: 700 1.35rem/1 var(--f-pixel); }
.brand:hover { color: var(--paper); }
.brand .mark { width: 38px; height: 26px; }
.brand:hover .mark .part-claw { animation: snap-wave .5s var(--ease-out) 2; }
.nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.nav a:not(.btn) {
  position: relative; padding: .55rem .8rem; border-radius: 9px; color: var(--text-2); text-decoration: none;
  font-weight: 700; font-size: .96rem; transition: color .2s, background-color .2s;
}
.nav a:not(.btn):hover { color: var(--paper); background: rgba(168, 236, 217, .06); }
.nav a[aria-current='page'] { color: var(--paper); }
.nav a[aria-current='page']::after { content: ''; position: absolute; left: .8rem; right: .8rem; bottom: .2rem; height: 3px; background: var(--coral); border-radius: 2px; }
.nav .btn { margin-left: .5rem; }
.nav-toggle { display: none; margin-left: auto; width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--reef); color: var(--paper); cursor: pointer; }
.nav-toggle svg { margin: auto; }
@media (max-width: 960px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: .25rem;
    padding: 1rem var(--gutter) 1.5rem; background: rgba(8, 18, 20, .97); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s var(--ease-out), visibility .25s;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a:not(.btn) { padding: .85rem .6rem; font-size: 1.08rem; }
  .nav a[aria-current='page']::after { left: .6rem; right: auto; width: 24px; }
  .nav .btn { margin: .6rem 0 0; }
}

/* ------------------------------------------------------------ footer */
.site-foot { position: relative; margin-top: 2rem; border-top: 1px solid var(--line); background: linear-gradient(var(--abyss), #050c0d); overflow: hidden; }
.site-foot .sand-edge { height: 28px; background: repeating-linear-gradient(90deg, var(--sand) 0 12px, #dccb9f 12px 24px); opacity: .95; mask: linear-gradient(transparent, #000 40%); }
.foot-grid { display: grid; gap: 2.5rem; padding-block: 3.5rem 2.5rem; grid-template-columns: 1.4fr repeat(4, 1fr); }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }
.foot-grid h2 { font: 600 .74rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--glass); margin-bottom: 1rem; }
.foot-grid ul { list-style: none; display: grid; gap: .55rem; }
.foot-grid a:not(.btn) { color: var(--text-2); text-decoration: none; }
.foot-grid a:not(.btn):hover { color: var(--paper); }
.foot-about p { color: var(--text-2); max-width: 38ch; margin-top: 1rem; }
.foot-base { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; padding-block: 1.5rem 2.25rem; border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--text-3); }
.foot-base a { color: var(--text-2); }
.foot-legal { max-width: 70ch; }
.harbor { display: inline-flex; align-items: center; gap: .5rem; color: var(--text-2); text-decoration: none; font-weight: 700; white-space: nowrap; }
.harbor:hover { color: var(--paper); }
.harbor svg { width: 18px; height: 18px; color: var(--glass); }

/* ------------------------------------------------------------ surfaces */
.card {
  position: relative; padding: clamp(1.25rem, 1rem + 1vw, 1.9rem); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(36, 80, 75, .32), rgba(19, 40, 39, .5)); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
a.card { display: block; color: inherit; text-decoration: none; transition: transform .35s var(--ease-out), border-color .3s; }
a.card:hover { transform: translateY(-4px); border-color: var(--line-2); color: inherit; }
.card h3 { font-size: var(--step-1); }
.card p { color: var(--text-2); margin-top: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .65rem; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(19, 40, 39, .6); color: var(--text-2);
  font: 600 .74rem/1.2 var(--f-mono); letter-spacing: .02em;
}
.chip.coral { color: var(--coral-hi); border-color: rgba(255, 122, 92, .4); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sea); box-shadow: 0 0 10px var(--sea); }
.shot {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); background: var(--deep);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(0, 0, 0, .4);
}
.shot img, .shot video { width: 100%; }
figure { margin: 0; }
figcaption { margin-top: .8rem; color: var(--text-3); font-size: var(--step--1); }
.terminal {
  border-radius: var(--radius); border: 1px solid var(--line-2); background: #061011; overflow: hidden; box-shadow: var(--shadow);
}
.terminal .bar { display: flex; gap: 6px; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.terminal .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--tide); }
.terminal .bar span { margin-left: auto; font: 500 .72rem/1 var(--f-mono); color: var(--text-3); }
.terminal pre { margin: 0; padding: 1.1rem 1.2rem; overflow-x: auto; color: var(--foam); line-height: 1.85; font-size: .84rem; }
.terminal .prompt { color: var(--coral); user-select: none; }
.terminal .cm { color: var(--text-3); }
.copy-btn { margin-left: auto; padding: .3rem .6rem; border-radius: 6px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: 600 .7rem/1 var(--f-mono); cursor: pointer; }
.copy-btn:hover { color: var(--paper); border-color: var(--glass); }
.copy-btn.done { color: var(--ink); background: var(--glass); border-color: var(--glass); }

/* the feature list used everywhere: icon square + title + text */
.feats { list-style: none; display: grid; gap: 1.4rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.feat { display: grid; grid-template-columns: 44px 1fr; gap: .9rem; align-items: start; }
.feat .ico { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 122, 92, .12); border: 1px solid rgba(255, 122, 92, .28); font-size: 1.3rem; }
.feat .ico.sea { background: rgba(63, 184, 163, .12); border-color: rgba(63, 184, 163, .3); }
.feat h3 { font-size: 1.06rem; line-height: 1.3; }
.feat p { color: var(--text-2); margin-top: .25rem; font-size: .98rem; }

.section-head { display: grid; gap: 1rem; margin-bottom: clamp(2.2rem, 1.5rem + 3vw, 4rem); max-width: 760px; }
.section-head.center { margin-inline: auto; text-align: center; justify-items: center; }

/* page hero for inner pages */
.page-hero { position: relative; padding-block: clamp(4rem, 2.5rem + 6vw, 8rem) clamp(2.5rem, 2rem + 3vw, 4.5rem); overflow: hidden; }
.page-hero .wrap { position: relative; z-index: 1; display: grid; gap: 1.3rem; }
.page-hero h1 { font-size: var(--step-5); max-width: 15ch; }
.page-hero .lede { max-width: 58ch; }
.page-hero::before {
  content: ''; position: absolute; inset: -40% -10% auto; height: 120%; pointer-events: none;
  background: radial-gradient(50% 50% at 20% 40%, rgba(63, 184, 163, .16), transparent 70%), radial-gradient(40% 40% at 85% 20%, rgba(255, 122, 92, .12), transparent 70%);
}
.crumbs { display: flex; gap: .5rem; font: 600 .76rem/1 var(--f-mono); color: var(--text-3); letter-spacing: .04em; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--paper); }

/* the closing call to action on every page */
.cta-band { position: relative; overflow: hidden; border-radius: 24px; padding: clamp(2.2rem, 1.5rem + 4vw, 4.5rem); border: 1px solid var(--line-2);
  background: radial-gradient(70% 120% at 100% 100%, rgba(255, 122, 92, .22), transparent 60%), radial-gradient(60% 100% at 0% 0%, rgba(63, 184, 163, .2), transparent 60%), var(--reef); }
.cta-band h2 { font-size: var(--step-4); max-width: 16ch; }
.cta-band p { margin-top: 1rem; color: var(--text-2); max-width: 52ch; font-size: var(--step-1); }
.cta-band .btn-row { margin-top: 2rem; }
.cta-band .cta-crab { position: absolute; right: clamp(1rem, 4vw, 4rem); bottom: 0; width: clamp(140px, 18vw, 240px); pointer-events: none; }
@media (max-width: 720px) { .cta-band .cta-crab { position: static; display: block; margin: 2rem 0 -2.5rem auto; } .cta-band .btn { white-space: normal; text-align: center; } }

/* pixel crabs drawn by js/crab.js */
.crab-svg { overflow: visible; image-rendering: pixelated; }
.crab-img { image-rendering: pixelated; width: 100%; height: 100%; object-fit: contain; }
.nav .btn.primary { color: var(--ink); }
.crab-svg .part { transform-box: view-box; }
.crab-live .part-legs-a { animation: leg .9s steps(2) infinite; }
.crab-live .part-legs-b { animation: leg .9s steps(2) infinite .45s; }
.crab-live .part-eyes { animation: blink 5s infinite; }
.crab-live { animation: breathe 2.6s ease-in-out infinite; }
.crab-walk .part-legs-a { animation: leg .22s steps(2) infinite; }
.crab-walk .part-legs-b { animation: leg .22s steps(2) infinite .11s; }
.crab-wave .part-claw { animation: snap-wave .9s var(--ease-out) infinite; }
@keyframes leg { 0% { transform: translateY(0); } 50%, 100% { transform: translateY(-1px) translateX(1px); } }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5%); } }
@keyframes snap-wave { 0%, 100% { transform: none; } 50% { transform: rotate(-22deg); } }

/* scroll reveals (js/site.js adds .in) */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--d, 0s); }
  .js .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* the drifting light on the water, used behind sections */
.caustics { position: absolute; inset: 0; pointer-events: none; opacity: .5; overflow: hidden; }
.caustics::before, .caustics::after {
  content: ''; position: absolute; inset: -50%; background:
    radial-gradient(closest-side, rgba(127, 214, 194, .09), transparent) 0 0 / 220px 160px,
    radial-gradient(closest-side, rgba(127, 214, 194, .06), transparent) 110px 80px / 260px 200px;
}
@media (prefers-reduced-motion: no-preference) {
  .caustics::before { animation: drift 38s linear infinite; }
  .caustics::after { animation: drift 54s linear infinite reverse; }
}
@keyframes drift { to { transform: translate(220px, 160px); } }

.disclaimer { font-size: var(--step--1); color: var(--text-3); }
.badge-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.stat { padding: 1.1rem 1.2rem; border-radius: 12px; border: 1px solid var(--line); background: rgba(19, 40, 39, .45); }
.stat b { display: block; font: 700 var(--step-3)/1 var(--f-pixel); color: var(--paper); }
.stat span { display: block; margin-top: .45rem; color: var(--text-2); font-size: .92rem; }
hr.wave { border: 0; height: 12px; margin: 0; background: radial-gradient(circle at 6px -2px, transparent 7px, var(--line-2) 7.5px, var(--line-2) 8.5px, transparent 9px) 0 0 / 24px 12px repeat-x; opacity: .7; }

/* Tables on phones: each row a card, each cell labelled with its column
   (js/site.js copies the header into data-label). */
@media (max-width: 699px) {
  table.stack, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; width: 100%; min-width: 0 !important; }
  table.stack { min-width: 0 !important; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tr { padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
  table.stack tbody th, table.stack td { padding: .2rem 0 !important; border: 0 !important; white-space: normal !important; }
  table.stack tbody th { font-size: 1.02rem; margin-bottom: .2rem; }
  table.stack td[data-label]::before { content: attr(data-label) ': '; font: 600 .7rem/1.6 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--glass); }
  table.stack td:empty { display: none; }
}
