/* squatgnat — palette taken from the sticky notes he draws on.
   One loud thing: the hand-drawn curls (hero + gate). Everything else stays quiet. */
:root {
  --periwinkle: #aeb5dc;
  --lilac: #ebe8f3;       /* pale paper the drawings sit on */
  --peach: #f5c6a0;
  --rose: #e48a8a;
  --ink: #25213d;         /* fineliner, slightly violet */
  --ink-2: #4a4568;       /* secondary text on light papers */
  --white-pencil: #fbfaff;

  --display: "Shrikhand", "Cooper Black", Georgia, serif;
  --text: "Hanken Grotesk", system-ui, sans-serif;

  /* type scale, 1.25 ratio from an 18px base */
  --s-1: .8rem;
  --s0: 1rem;
  --s1: 1.25rem;
  --s2: 1.563rem;
  --s3: clamp(2.2rem, 4.6vw, 3.4rem);
  --s4: clamp(4.6rem, 15vw, 11.5rem);

  --wrap: 1180px;
  --gutter: max(16px, calc((100vw - var(--wrap)) / 2));
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 18px; scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--lilac);
  color: var(--ink);
  font: 400 var(--s0)/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h2 { font: var(--s3)/1 var(--display); margin-bottom: .45em; }
h3 { font: var(--s2)/1.1 var(--display); margin-bottom: .4em; }
.lead { font-size: var(--s1); line-height: 1.45; max-width: 34ch; }
.small { font-size: var(--s-1); color: var(--ink-2); max-width: 70ch; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; }
section { padding: clamp(64px, 10vw, 128px) 16px; }
.paper-lilac { background: var(--lilac); }
.paper-peach { background: var(--peach); }
.paper-rose { background: var(--rose); }
.paper-periwinkle { background: var(--periwinkle); }
.paper-peach .small, .paper-rose .small, .paper-periwinkle .small { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-block; font: 700 var(--s0)/1 var(--text); text-decoration: none; cursor: pointer;
  padding: .85em 1.35em; border-radius: 999px; border: 2px solid var(--ink);
}
.btn-ink { background: var(--ink); color: var(--white-pencil); }
.btn-ink:hover { background: #3a3460; border-color: #3a3460; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: rgba(37,33,61,.08); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: .7rem var(--gutter);
  background: var(--periwinkle);
}
.mark { font: 1.3rem/1 var(--display); text-decoration: none; white-space: nowrap; margin: 0; display: inline-block; padding: .75rem 0; }
.top nav { display: flex; gap: 1.4rem; overflow-x: auto; scrollbar-width: none; }
.top nav a { font-weight: 600; text-decoration: none; white-space: nowrap; padding: .7rem 0; }
.top nav a:hover { text-decoration: underline; }
@media (max-width: 800px) {
  .top { gap: .6rem; padding: 0 0 0 16px; }
  .mark { flex: none; font-size: 1.1rem; }
  /* one compact row: the nav swipes sideways, the fade hints there's more */
  .top nav {
    flex: 1; min-width: 0; gap: 0; padding-right: 16px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 32px), transparent);
            mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 32px), transparent);
  }
  .top nav a { padding: .8rem .55rem; }
  html { scroll-padding-top: 60px; }
}

/* The curls — drawn in by app.js */
.curls { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.curls path { fill: none; stroke: var(--ink); stroke-width: 1.15; stroke-linecap: round; opacity: .55; }
.curls.drawing path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .9s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: var(--periwinkle);
  display: grid; grid-template-columns: 1.25fr 1fr; align-items: end; gap: clamp(24px, 5vw, 80px);
  padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(56px, 8vw, 112px);
}
.hero .curls {
  /* thin the curls out behind the name so it stays readable */
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 22% 45%, transparent 35%, #000 85%);
          mask-image: radial-gradient(ellipse 60% 70% at 22% 45%, transparent 35%, #000 85%);
}
.hero-inner { position: relative; }
.hero h1 { font: var(--s4)/.86 var(--display); letter-spacing: -.01em; margin: 0 0 .12em -.04em; }
.hero-sub { font-size: var(--s1); line-height: 1.45; max-width: 30ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.hero-art { position: relative; margin: 0; }
.hero-art img { width: 100%; }
.hero-art figcaption { font-size: var(--s-1); margin-top: .6rem; }
@media (max-width: 800px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: clamp(3.4rem, 21vw, 7rem); }
  .hero-art { max-width: 440px; }
  .hero .curls {
    -webkit-mask-image: linear-gradient(#000 0, transparent 30%, transparent 55%, #000 100%);
            mask-image: linear-gradient(#000 0, transparent 30%, transparent 55%, #000 100%);
  }
}

/* Gallery */
.head { max-width: 62ch; margin-bottom: 1.6rem; }
.head p { color: var(--ink-2); font-size: var(--s1); line-height: 1.45; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.2rem; }
.chip {
  font: 600 var(--s-1)/1 var(--text); padding: .7em 1.1em; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink); min-height: 44px;
}
.chip.is-on { background: var(--ink); color: var(--white-pencil); }
.grid {
  list-style: none; margin: 0; padding: 0; display: grid;
  gap: clamp(28px, 4vw, 56px) clamp(20px, 3vw, 40px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.tile button { all: unset; display: block; width: 100%; cursor: pointer; }
.tile .frame { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--periwinkle); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .cap { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-top: .75rem; }
.tile .t { font: var(--s1)/1.2 var(--display); }
.tile .p { font-weight: 600; white-space: nowrap; }
.tile button:hover .t, .tile button:focus-visible .t { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.badge {
  position: absolute; top: 12px; left: 12px; font: 700 var(--s-1)/1 var(--text);
  background: var(--ink); color: var(--white-pencil); padding: .45em .75em; border-radius: 999px;
}
.veil-label {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 1rem;
}
.veil-label b { font: var(--s2)/1 var(--display); font-weight: 400; }
.veil-label small { font-size: var(--s-1); font-weight: 600; margin-top: .5rem; }
.mature-note { margin: 3rem 0 0; max-width: 60ch; font-size: var(--s1); line-height: 1.45; }

/* Ways to own one */
.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 64px); margin: 1.2rem 0 2.4rem; }
.way p { max-width: 36ch; }
@media (max-width: 800px) { .ways { grid-template-columns: minmax(0, 1fr); } }

/* Commissions */
.commission, .trade, .contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
@media (max-width: 800px) { .commission, .trade, .contact { grid-template-columns: minmax(0, 1fr); } }
.tiers { margin: 2rem 0 0; }
.tiers > div { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: 1.1rem 0; border-top: 1.5px solid var(--ink); }
.tiers dt { font: var(--s1)/1.2 var(--display); }
.tiers .price { grid-column: 2; grid-row: 1; margin: 0; font-weight: 700; }
.tiers dd { grid-column: 1 / -1; margin: 0; color: var(--ink-2); max-width: 52ch; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 2rem; }
.steps li { counter-increment: s; position: relative; padding: 0 0 1.5rem 3.6rem; max-width: 48ch; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -.3rem;
  font: 2rem/1 var(--display); color: var(--ink);
}

/* Trade */
.trade .lead { margin-bottom: 1.6rem; }
.trade-list { list-style: none; margin: 0; padding: 0; }
.trade-list li { padding: 1rem 0; border-top: 1.5px solid var(--ink); }
.trade-list li:last-child { border-bottom: 1.5px solid var(--ink); }

/* About */
.about { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.about p { max-width: 60ch; font-size: 1.06rem; }
@media (max-width: 800px) { .about { grid-template-columns: minmax(0, 1fr); } .about img { width: 100%; max-width: 400px; } }

/* Form */
.form { display: grid; gap: 1.1rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 560px) { .form .row { grid-template-columns: minmax(0, 1fr); } }
.form label { display: grid; gap: .35rem; font-weight: 600; font-size: var(--s-1); }
.form label em { font-style: normal; font-weight: 400; }
.form input, .form select, .form textarea {
  font: 400 var(--s0) var(--text); color: var(--ink); background: var(--white-pencil);
  border: 1.5px solid var(--ink); border-radius: 10px; padding: .7em .85em; width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 3px solid var(--ink); outline-offset: 1px; }
.form .check { display: flex; align-items: center; gap: .6rem; font-weight: 400; font-size: var(--s0); min-height: 44px; cursor: pointer; }
.form .check input { width: 1.1rem; height: 1.1rem; accent-color: var(--ink); }
.form .btn { justify-self: start; }

/* Footer */
.foot { background: var(--ink); color: var(--periwinkle); padding: 3rem 16px calc(3rem + env(safe-area-inset-bottom)); }
.foot-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem 3rem; align-items: baseline; }
.foot p { margin: 0; font-size: var(--s-1); }
.foot .mark { font-size: 1.6rem; color: var(--white-pencil); }
.foot-links a { margin-left: 1.2rem; font-weight: 600; display: inline-block; padding: .7rem .2rem; min-width: 44px; text-align: center; }
.contact .small a { display: inline-block; padding: .7rem 0; }
@media (max-width: 800px) { .foot-inner { grid-template-columns: 1fr; } .foot-links a { margin: 0 1.2rem 0 0; } }

/* Viewer */
.viewer {
  border: 0; padding: 0; width: min(1080px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  background: var(--lilac); color: var(--ink); border-radius: 14px;
}
.viewer[open] { animation: rise .22s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.viewer::backdrop { background: rgba(37,33,61,.8); }
.viewer-body { display: grid; grid-template-columns: 1.15fr 1fr; }
.viewer-img img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.viewer-info { padding: 2.2rem 2rem; overflow-y: auto; }
.viewer-info h3 { font-size: var(--s3); line-height: 1; }
.viewer-close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--ink); color: var(--white-pencil); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.meta { color: var(--ink-2); }
.buy-block { border-top: 1.5px solid var(--ink); padding-top: 1.1rem; margin-top: 1.3rem; }
.buy-block .label { font-weight: 700; margin-bottom: .3rem; }
.buy-block .big { font: var(--s2)/1 var(--display); margin-bottom: .9rem; }
.buy-block .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.buy-block .btn { font-size: var(--s-1); }
.buy-block .small { margin: .8rem 0 0; }
.print-opts { display: grid; gap: .4rem; margin: .6rem 0 1rem; }
.print-opts label {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; cursor: pointer;
  padding: .55rem .8rem; border: 1.5px solid rgba(37,33,61,.3); border-radius: 10px;
}
.print-opts label:has(input:checked) { border-color: var(--ink); background: var(--white-pencil); }
.print-opts input { accent-color: var(--ink); margin: 0 .6rem 0 0; }
@media (max-width: 800px) {
  .viewer { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .viewer-body { display: block; height: 100%; overflow-y: auto; overscroll-behavior: contain; }
  .viewer-info { padding: 1.4rem 16px calc(2rem + env(safe-area-inset-bottom)); }
  .viewer-info h3 { font-size: clamp(2rem, 11vw, 3rem); }
  .viewer-close { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; }
}

/* Age gate */
.gate {
  position: fixed; inset: 0; z-index: 100; display: flex; padding: 16px;
  background: var(--periwinkle); overflow-x: hidden; overflow-y: auto;
}
.gate[hidden] { display: none; }
.gate .curls {
  -webkit-mask-image: radial-gradient(ellipse 45% 45% at 50% 50%, transparent 40%, #000 90%);
          mask-image: radial-gradient(ellipse 45% 45% at 50% 50%, transparent 40%, #000 90%);
}
.gate-card { position: relative; max-width: 30rem; text-align: center; margin: auto; }
.gate-name { font: clamp(2.6rem, 9vw, 4.4rem)/.95 var(--display); margin-bottom: .5em; }
.gate-card h2 { font: 700 var(--s1)/1.3 var(--text); margin-bottom: .5em; }
.gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.5rem; }
body.gated { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .curls.drawing path { animation: none; stroke-dashoffset: 0; }
  .viewer[open] { animation: none; }
}

/* Phones: two drawings per row so the gallery doesn't become an endless scroll */
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 24px 14px; }
  .tile .cap { flex-direction: column; gap: .15rem; }
  .tile .t { font-size: var(--s0); }
  .tile .p { font-size: var(--s-1); }
  .veil-label b { font-size: var(--s1); }
  .veil-label small { display: none; }
}
