/* ==========================================================================
   Khaleb Herrington — portfolio
   Black ground, bone text, one cold lilac reserved for "for sale" marks.
   ========================================================================== */

:root {
  --void: #000;
  --soot: #0b0b0b;
  --line: #222120;
  --bone: #d9d5ca;
  --ash: #8a8880;
  --mist: #b4b0d6;
  --mist-dim: #6f6c8e;

  --display: 'IM Fell English', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1480px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  background: var(--void);
  color: var(--bone);
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
  -webkit-text-size-adjust: 100%;
}
html.lock { overflow: hidden; }

body {
  font-family: var(--body);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.65;
  min-height: 100vh;
  background: var(--void);
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--mist); outline-offset: 3px; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--bone); color: var(--void); padding: .6rem 1rem; z-index: 100;
}
.skip:focus { top: .75rem; }

/* ---------- Header ---------- */

.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.1rem var(--gutter);
  transition: background .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.bar.solid {
  background: rgba(0, 0, 0, .88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom-color: var(--line);
}
.mark {
  font-family: var(--display);
  font-size: 1.2rem;
  text-decoration: none;
  letter-spacing: .01em;
}
.bar nav { display: flex; gap: clamp(.85rem, 3vw, 2.2rem); white-space: nowrap; }
@media (max-width: 520px) { .bar { padding-block: .9rem; gap: .75rem; } .mark { font-size: 1rem; white-space: nowrap; } .bar nav a { font-size: .85rem; } }
.bar nav a {
  font-size: .95rem; text-decoration: none; color: var(--ash);
  padding: .25rem 0; border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.bar nav a:hover { color: var(--bone); border-bottom-color: var(--bone); }
.bar nav a[href="#mints"] { color: var(--mist); }
.bar nav a[href="#mints"]:hover { border-bottom-color: var(--mist); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: 7rem var(--gutter) clamp(2.5rem, 7vh, 5rem);
  overflow: hidden;
}
#ink {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.hero-copy { position: relative; max-width: var(--max); width: 100%; margin: 0 auto; }

.name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.4rem, 15.5vw, 13rem);
  line-height: .86;
  letter-spacing: -.02em;
  filter: url(#bleed);
}
.name .ln {
  display: block;
  animation: soak 2.4s cubic-bezier(.2, .7, .2, 1) both;
}
.name .ln:nth-child(2) { animation-delay: .45s; padding-left: clamp(.5rem, 6vw, 6rem); }

@keyframes soak {
  from { opacity: 0; filter: blur(18px); transform: translateY(.04em) scale(1.015); }
  to   { opacity: 1; filter: blur(0);    transform: none; }
}

.lede {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  max-width: 34ch;
  color: var(--ash);
  font-size: 1.1rem;
  animation: lede-in 1.2s ease 1.6s both;
}
@keyframes lede-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Sections ---------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) var(--gutter) 0;
}
.section h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1;
}
.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1.25rem 2rem;
}

.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters button {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: .4rem 1.05rem; cursor: pointer; font-size: .92rem; color: var(--ash);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.filters button:hover { color: var(--bone); border-color: var(--ash); }
.filters button[aria-pressed="true"] { color: var(--void); background: var(--bone); border-color: var(--bone); }
.filters button[data-filter="sale"][aria-pressed="true"] { background: var(--mist); border-color: var(--mist); }

.count { margin-top: 1rem; color: var(--ash); font-size: .95rem; min-height: 1.65em; }

/* ---------- Grid ---------- */

.grid { margin-top: 1.75rem; column-count: 3; column-gap: clamp(1.25rem, 2.5vw, 2.5rem); }
@media (max-width: 980px) { .grid { column-count: 2; } }
@media (max-width: 560px) { .grid { column-count: 1; } }

.card {
  break-inside: avoid;
  margin-bottom: clamp(1.75rem, 3vw, 3rem);
}
.card button {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: none; border: 0; padding: 0;
}
.thumb {
  position: relative; overflow: hidden; background: var(--soot);
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: transform 1.1s cubic-bezier(.2, .7, .2, 1), filter .5s ease;
}
.card button:hover .thumb img,
.card button:focus-visible .thumb img { transform: scale(1.035); filter: grayscale(.6) contrast(1.1); }

.badge {
  position: absolute; left: .75rem; bottom: .75rem;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .75rem .3rem .55rem;
  background: rgba(0, 0, 0, .82);
  border: 1px solid var(--mist-dim);
  border-radius: 999px;
  font-size: .82rem; color: var(--mist);
}
.badge svg { width: .9rem; height: .9rem; flex: none; }
.badge[data-status="sold"] { color: var(--ash); border-color: var(--line); }

.card-meta { padding-top: .85rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.card-title { font-family: var(--display); font-size: 1.35rem; line-height: 1.15; }
.card-sub { color: var(--ash); font-size: .9rem; white-space: nowrap; }

.empty { margin-top: 2rem; color: var(--ash); }

/* ---------- Mints ---------- */

.mints-note { margin-top: 1.25rem; max-width: 56ch; color: var(--ash); }
.mint-list {
  margin-top: 2.5rem;
  display: grid; gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.mint-item { border-top: 1px solid var(--mist-dim); padding-top: 1.25rem; display: grid; gap: 1rem; align-content: start; }
.mint-item .thumb { aspect-ratio: 4 / 3; }
.mint-item h3 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1.1; }
.mint-item h3 button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.mint-item h3 button:hover { color: var(--mist); }
.mint-line { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; color: var(--ash); font-size: .95rem; }
.mint-line strong { color: var(--bone); font-weight: 400; }

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  padding: .7rem 1.4rem; border: 1px solid var(--bone); background: none; color: var(--bone);
  font-size: .98rem; transition: background .2s ease, color .2s ease;
}
.btn:hover { background: var(--bone); color: var(--void); }
.btn.mint { border-color: var(--mist); color: var(--mist); }
.btn.mint:hover { background: var(--mist); color: var(--void); }
.textlink { color: var(--ash); text-underline-offset: .3em; }
.textlink:hover { color: var(--bone); }

/* ---------- About / Contact ---------- */

.about-body { margin-top: 2rem; max-width: 62ch; display: grid; gap: 1.25rem; }
.about-body p { font-size: 1.15rem; line-height: 1.75; }

.contact-body { margin-top: 2rem; display: grid; gap: 1.5rem; }
.booking { max-width: 46ch; font-size: 1.15rem; }
.contact-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem 2rem; }
.contact-links a {
  font-family: var(--display); font-size: 1.6rem; text-decoration: none;
  border-bottom: 1px solid var(--ash); padding-bottom: .1rem;
  transition: border-color .2s ease, color .2s ease;
}
.contact-links a:hover { border-color: var(--bone); }

.foot {
  max-width: var(--max); margin: clamp(5rem, 12vw, 9rem) auto 0;
  padding: 1.75rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--ash); font-size: .92rem;
}
.foot a { text-underline-offset: .3em; }

/* ---------- Piece detail ---------- */

dialog.piece {
  position: fixed; inset: 0; width: 100%; height: 100%;
  max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--void); color: var(--bone);
  overflow: auto;
}
dialog.piece::backdrop { background: #000; }
dialog.piece[open] { animation: open .35s ease both; }
@keyframes open { from { opacity: 0; } to { opacity: 1; } }

.close {
  position: fixed; top: 1rem; right: var(--gutter); z-index: 5;
  background: rgba(0, 0, 0, .85); border: 1px solid var(--ash); color: var(--bone);
  padding: .45rem 1.1rem; cursor: pointer; font-size: .95rem;
  transition: background .2s ease, color .2s ease;
}
.close:hover { background: var(--bone); color: var(--void); }

.sheet { display: grid; grid-template-columns: 1fr; min-height: 100%; }
.media {
  display: flex; align-items: center; justify-content: center;
  padding: 4.5rem var(--gutter) 1.5rem;
  background: var(--void);
}
.media img { max-width: 100%; max-height: 80svh; width: auto; height: auto; filter: grayscale(1) contrast(1.05); }
.text { padding: 1.5rem var(--gutter) 4rem; max-width: 46rem; }

@media (min-width: 900px) {
  dialog.piece { overflow: hidden; }
  .sheet { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); height: 100%; }
  .media { padding: 4.5rem 2rem 2.5rem var(--gutter); overflow: auto; }
  .media img { max-height: calc(100svh - 8rem); }
  .text { overflow: auto; padding: 5rem var(--gutter) 4rem 2rem; max-width: none; border-left: 1px solid var(--line); }
}

.kind { color: var(--ash); font-size: .95rem; }
#pTitle { font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1.02; margin-top: .4rem; }

.facts { margin-top: 1.75rem; display: grid; gap: .5rem; max-width: 30rem; }
.facts div { display: flex; justify-content: space-between; gap: 1.5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--ash); }
.facts dd { text-align: right; }

.text h4 { font-family: var(--display); font-weight: 400; font-size: 1.7rem; margin: 2.75rem 0 1rem; }
.thoughts { display: grid; gap: 1rem; max-width: 56ch; }

.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 1.75rem; max-width: 56ch; }
.steps li { counter-increment: step; padding-left: 3rem; position: relative; }
.steps li::before {
  content: counter(step, upper-roman);
  position: absolute; left: 0; top: .05rem;
  font-family: var(--display); font-size: 1.2rem; color: var(--ash);
}
.steps h5 { font-family: var(--display); font-weight: 400; font-size: 1.25rem; line-height: 1.2; margin-bottom: .25rem; }
.steps p { color: var(--bone); opacity: .85; }
.steps img { margin-top: 1rem; width: 100%; max-width: 22rem; filter: grayscale(1); }

.mintbox {
  margin-top: 2rem; padding: 1.4rem; max-width: 30rem;
  border: 1px solid var(--mist-dim);
  display: grid; gap: 1rem;
}
.mintbox h4 { margin: 0; font-size: 1.4rem; color: var(--mist); }
.mintbox dl { display: grid; gap: .3rem; }
.mintbox dl div { display: flex; justify-content: space-between; gap: 1rem; }
.mintbox dt { color: var(--ash); }
.mintbox p { color: var(--ash); font-size: .95rem; }
.mintbox .btn { justify-self: start; }
.mintbox[data-status="sold"] { border-color: var(--line); }
.mintbox[data-status="sold"] h4 { color: var(--ash); }

#pEnquire { margin-top: 2.5rem; }

.pager {
  margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 1rem;
}
.pager button { background: none; border: 0; cursor: pointer; color: var(--ash); padding: .25rem 0; text-underline-offset: .3em; }
.pager button:hover { color: var(--bone); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .name .ln, .lede, dialog.piece[open] { animation: none; }
  .thumb img { transition: none; }
}
