/* Thalassophile — the home page is a descent: surface, shallows, mid-water, deep, seabed.
   Inner pages start in the shallows and end on the same seabed. */

:root {
  --ocean: #0594F9;      /* brand ocean blue */
  --navy: #0A1A2B;       /* brand deep navy */
  --white: #FFFFFF;
  --shallow: #D6ECFD;    /* sunlit water, navy text */
  --mid: #0A5A94;        /* mid-water, white text */
  --seabed: #050E18;
  --muted: #3D5872;      /* secondary text on light backgrounds */
  --line: #C9D8E4;
  --tile: #EEF4F8;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Poppins", "Segoe UI", system-ui, sans-serif;

  --measure: 36rem;
  --wide: 74rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.2rem);
  line-height: 1.6;
  font-optical-sizing: auto;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0 0 1rem;
}
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); }
h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1.1em; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--ocean); outline-offset: 4px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--navy); color: var(--white);
  padding: .6rem 1rem; font-family: var(--sans);
}
.skip:focus { top: 1rem; }

.inner { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

.note { font-family: var(--sans); font-size: .95rem; color: var(--muted); }

.sample-note {
  margin: 0;
  background: #FFF3D1;
  color: var(--navy);
  text-align: center;
  font-family: var(--sans);
  font-size: .8rem;
  padding: .45rem var(--gutter);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  background: var(--navy);
  color: var(--white);
  padding: .9rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.btn:hover { background: var(--ocean); color: var(--navy); }
.btn--light { background: var(--white); color: var(--navy); }
.btn--light:hover { background: var(--ocean); color: var(--navy); }

.textlink {
  font-family: var(--sans);
  font-weight: 600;
  text-underline-offset: .25em;
  text-decoration-thickness: 2px;
}

/* ---------- Navigation ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem var(--gutter);
  font-family: var(--sans);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav--home {
  position: absolute;
  left: 0; right: 0; top: auto;
  background: transparent;
  border-bottom: 0;
}
.nav__home { display: block; padding: .25rem 0; }
.nav__home img { width: 64px; height: auto; }
.nav ul { display: flex; gap: clamp(.9rem, 3vw, 2rem); list-style: none; margin: 0; padding: 0; }
.nav ul a {
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: .35rem 0;
  border-bottom: 2px solid transparent;
}
.nav ul a:hover { border-bottom-color: var(--ocean); }
.nav ul a[aria-current="page"] { border-bottom-color: var(--navy); }

.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Home: surface ---------- */

.surface {
  min-height: 92vh;
  min-height: 92svh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2rem;
  padding: 6rem var(--gutter) 2rem;
  text-align: center;
}
.surface__logo { margin: 0; width: min(32rem, 80vw); }
.surface__intro {
  max-width: 30rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, .95rem + .5vw, 1.3rem);
}

.waterline {
  display: block; width: 100%;
  height: clamp(60px, 9vw, 120px);
  margin-bottom: -1px; overflow: hidden;
}
.waterline path { transform-box: view-box; }
.waterline__back  { fill: #B9DEFB; animation: swell 14s linear infinite; }
.waterline__front { fill: var(--shallow); animation: swell 9s linear infinite reverse; }
@keyframes swell { from { transform: translateX(0); } to { transform: translateX(-720px); } }

/* ---------- Bands ---------- */

.band { padding: clamp(3rem, 8vw, 6rem) 0; }
.band--shallow { background: var(--shallow); color: var(--navy); }
.band--mid     { background: var(--mid);     color: var(--white); }
.band--deep    { background: var(--navy);    color: var(--white); }

.band__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .5rem 2rem; margin-bottom: 2rem;
}
.band__head h2 { margin: 0; }
.band__head p { margin: 0; max-width: 32rem; }

.fade { height: clamp(7rem, 18vh, 12rem); }
.fade--to-mid  { background: linear-gradient(var(--shallow), var(--mid)); }
.fade--to-deep { background: linear-gradient(var(--mid), var(--navy)); }
.fade--descend { background: linear-gradient(var(--white), var(--shallow) 25%, var(--mid) 70%, var(--navy)); }

/* ---------- Artwork grid and cards ---------- */

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr));
  gap: 2.5rem 1.5rem;
}

.card__link { display: block; text-decoration: none; }
.card__img {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 6px;
  background: var(--tile);
  margin-bottom: .9rem;
}
.card__img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.card__link:hover .card__img img { transform: scale(1.04); }
.card__title { margin: 0 0 .2rem; }
.card__link:hover .card__title { text-decoration: underline; text-underline-offset: .2em; }
.card__meta {
  display: flex; justify-content: space-between; gap: 1rem;
  margin: 0; font-size: .95rem; color: var(--muted);
}
.band--mid .card__meta, .band--deep .card__meta { color: #C4D6E6; }

.badge {
  position: absolute; left: .75rem; top: .75rem;
  font-family: var(--sans); font-weight: 600; font-size: .75rem;
  letter-spacing: .04em; text-transform: uppercase;
  padding: .3rem .6rem; border-radius: 4px;
  background: var(--navy); color: var(--white);
}
.badge--made-to-order { background: var(--white); color: var(--navy); }

/* ---------- Artist cards ---------- */

.artists {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 2.5rem 2rem;
}
.artist-card a { display: block; text-decoration: none; }
.artist-card img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 6px; margin-bottom: 1rem;
}
.artist-card h3 { font-size: 1.4rem; font-weight: 700; margin: 0 0 .2rem; }
.artist-card p { margin: 0; }
.artist-card__count { font-family: var(--sans); font-size: .85rem; margin-top: .4rem !important; opacity: .8; }
.artist-card a:hover h3 { text-decoration: underline; text-underline-offset: .2em; }

/* ---------- Steps (how buying works) ---------- */

.steps {
  list-style: none; margin: 0 0 2.5rem; padding: 0;
  counter-reset: step;
  display: grid; gap: 1.5rem;
}
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 2.75rem 1fr; gap: 1rem;
  align-items: start;
}
.steps li::before {
  content: counter(step);
  font-family: var(--sans); font-weight: 700;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid currentColor;
  font-size: .95rem;
}
.steps strong { font-family: var(--sans); display: block; }

.mail {
  font-family: var(--sans); font-weight: 600;
  font-size: clamp(1.1rem, .9rem + 1vw, 1.5rem);
  color: var(--ocean);
  text-decoration-thickness: 2px; text-underline-offset: .25em;
  word-break: break-word;
}
.mail:hover { color: var(--white); }

/* ---------- Inner page header ---------- */

.page-head { background: var(--shallow); padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); }
.page-head h1 { margin-bottom: .5rem; }
.page-head p { max-width: 38rem; margin: 0; color: var(--muted); }

.page-body { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 8vw, 5rem); }

/* ---------- Gallery filters ---------- */

.filters {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 1rem 2rem;
  margin-bottom: 2.5rem;
  font-family: var(--sans);
}
.filters__group { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; border: 0; margin: 0; padding: 0; }
.filters__label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: .25rem; }
.chip {
  font: inherit; font-size: .9rem; font-weight: 500;
  color: var(--navy); background: var(--white);
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: .4rem .95rem; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.chip:hover { border-color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.toggle { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.toggle input { width: 1.1rem; height: 1.1rem; accent-color: var(--navy); }
.filters__count { margin-left: auto; font-size: .9rem; color: var(--muted); }

/* ---------- Piece page ---------- */

.crumbs {
  font-family: var(--sans); font-size: .85rem;
  padding-top: 1.5rem; padding-bottom: 1rem;
  display: flex; gap: .6rem; color: var(--muted);
}
.crumbs a { text-underline-offset: .2em; }

.piece { display: grid; gap: 2.5rem; padding-bottom: 3rem; }
@media (min-width: 860px) {
  .piece { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 4rem; align-items: start; }
  .details { position: sticky; top: 6rem; }
}

.viewer__main { border-radius: 6px; overflow: hidden; background: var(--tile); }
.viewer__main img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.viewer__thumbs { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; gap: .75rem; flex-wrap: wrap; }
.viewer__thumbs button {
  padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden;
  background: none; cursor: pointer; width: 5rem;
}
.viewer__thumbs button[aria-current="true"] { border-color: var(--navy); }
.viewer__thumbs img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.details__type {
  font-family: var(--sans); font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: var(--mid);
  margin-bottom: .5rem;
}
.details__type a { text-underline-offset: .2em; }
.details h1 { margin-bottom: .25rem; }
.details__by { font-size: 1.1rem; margin-bottom: 1.5rem; }
.details__price { font-family: var(--sans); font-weight: 600; font-size: 1.5rem; margin: 0; }
.details__status { font-family: var(--sans); font-size: .9rem; color: var(--muted); margin-bottom: 1.5rem; }
.details__status--available::before {
  content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%;
  background: #1FA36B; margin-right: .45rem; vertical-align: middle;
}
.details__help { font-size: .9rem; color: var(--muted); margin-top: 1rem; }

.specs {
  display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem;
  margin: 0 0 2rem; padding: 1.25rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: .98rem;
}
.specs dt { font-family: var(--sans); font-weight: 600; font-size: .85rem; padding-top: .15rem; }
.specs dd { margin: 0; }

.more { padding-top: 1rem; padding-bottom: clamp(3rem, 8vw, 5rem); }
.more h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); margin-bottom: 1.75rem; }

/* ---------- Artist page ---------- */

.artist-head { background: var(--shallow); padding: clamp(2.5rem, 6vw, 4.5rem) 0; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.artist-head__grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 760px) { .artist-head__grid { grid-template-columns: minmax(12rem, 20rem) minmax(0, 38rem); gap: 3.5rem; } }
.artist-head img { border-radius: 6px; width: 100%; max-width: 20rem; aspect-ratio: 1; object-fit: cover; }
.artist-head__tag { font-family: var(--sans); font-weight: 500; color: var(--mid); margin-top: -.5rem; }
.links { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-family: var(--sans); font-size: .95rem; }

/* ---------- About page ---------- */

.prose h2 { margin-top: 3rem; }
.entry { margin: 0 0 .25rem; }
.entry__word {
  display: block; font-style: normal; font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.4rem, 1.2rem + 6vw, 4.5rem); line-height: 1; letter-spacing: -0.02em;
}
.entry__say { display: block; margin-top: .75rem; color: var(--muted); }
.entry__def { font-size: clamp(1.3rem, 1rem + 1.2vw, 1.75rem); line-height: 1.3; margin: 1rem 0 .5rem; }
.entry__origin { color: var(--muted); }

/* ---------- Seabed footer ---------- */

.seabed {
  background: linear-gradient(var(--navy), var(--seabed));
  color: #9FB3C8;
  text-align: center;
  padding: clamp(3.5rem, 9vw, 6rem) var(--gutter) 2.5rem;
  font-family: var(--sans);
  font-size: .85rem;
}
.seabed img { width: 170px; margin: 0 auto 1.75rem; }
.seabed ul { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem 1.75rem; }
.seabed ul a { color: var(--white); text-decoration: none; font-weight: 600; font-size: .95rem; }
.seabed ul a:hover { color: var(--ocean); }
.seabed p { margin: 0 0 .4rem; }
.seabed .seabed__mail { color: var(--ocean); }

/* ---------- Depth gauge (home only) ---------- */

.gauge {
  position: fixed; right: clamp(.75rem, 2vw, 1.75rem); top: 50%;
  transform: translateY(-50%); height: 60vh;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
  font-family: var(--sans); font-weight: 600; color: var(--ocean);
  pointer-events: none; z-index: 5;
}
.gauge__track { position: relative; flex: 1; width: 2px; background: currentColor; opacity: .9; }
.gauge__tick { position: absolute; top: calc(var(--at) * 100%); right: 6px; transform: translateY(-50%); font-size: .7rem; line-height: 1; }
.gauge__tick::after { content: ""; position: absolute; left: calc(100% + 1px); top: 50%; width: 7px; height: 2px; background: currentColor; }
.gauge__marker {
  position: absolute; left: 50%; top: calc(var(--depth, 0) * 100%);
  width: 12px; height: 12px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 3px rgba(5, 148, 249, .25); transform: translate(-50%, -50%);
}
.gauge__readout { font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .surface { min-height: 80svh; }
  .gauge { top: auto; bottom: .75rem; right: .75rem; transform: none; height: auto; }
  .gauge__track { display: none; }
  .gauge__readout { background: rgba(10, 26, 43, .8); color: var(--white); padding: .3rem .6rem; border-radius: 999px; font-size: .75rem; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .has-gauge .wrap, .has-gauge .inner { padding-right: 4.5rem; }
}

/* ---------- Logo animation ---------- */

.logo { display: block; width: 100%; height: auto; overflow: visible; }
.logo__wave, .logo__word, .logo__tag { transform-box: view-box; }
.logo__wave {
  transform-origin: 1100px 330px;
  animation:
    roll-in 1.6s cubic-bezier(.22, .8, .24, 1) both,
    swell-mark 7s ease-in-out 1.6s infinite;
}
.logo__word { animation: settle .9s ease-out .9s both; }
.logo__tag  { animation: settle .9s ease-out 1.25s both; }
.surface__intro, .surface__cta { animation: settle .9s ease-out 1.6s both; }

@keyframes roll-in {
  from { clip-path: inset(0 100% 0 0); transform: translateX(-90px) rotate(-4deg); }
  60%  { clip-path: inset(0 0 0 0); }
  to   { clip-path: inset(0 0 0 0); transform: none; }
}
@keyframes swell-mark {
  0%, 100% { transform: none; }
  30%      { transform: translate(6px, -9px) rotate(-1.6deg); }
  65%      { transform: translate(-3px, 4px) rotate(.8deg); }
}
@keyframes settle { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.surface__logo { cursor: pointer; -webkit-tap-highlight-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  .waterline path, .logo__wave, .logo__word, .logo__tag,
  .surface__intro, .surface__cta { animation: none; }
  .card__img img { transition: none; }
}

/* ---------- 404 ---------- */

.lost {
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  background: linear-gradient(var(--mid), var(--navy) 60%, var(--seabed));
  color: var(--white); padding: 2rem var(--gutter);
}
.lost img { width: min(16rem, 60vw); margin: 0 auto 2.5rem; }
.lost a { font-family: var(--sans); font-weight: 600; color: var(--white); text-underline-offset: .25em; }

/* ---------- Phones: two-up grids ---------- */
@media (max-width: 560px) {
  .grid, .artists { grid-template-columns: 1fr 1fr; gap: 2rem 1rem; }
  .card__title { font-size: .95rem; }
  .card__meta { flex-direction: column; gap: 0; font-size: .85rem; }
  .artist-card h3 { font-size: 1.15rem; }
  .badge { left: .5rem; top: .5rem; font-size: .65rem; }
  .filters__count { width: 100%; margin-left: 0 !important; }
}
