/* ============================================================================
   minimal.css — the pared-back Chase Mastey site.

   Monochrome, no rules, no ornament. Structure comes from space and an
   asymmetric grid, never from borders. The wordmark is the only loud thing
   on the page; everything else stays quiet on purpose.
   ========================================================================== */

/* ---- the display faces -------------------------------------------------- */
/* Mario, by Visual Folder. Licensed for personal use; a Logomark license
   applies if the mark goes commercial. */
@font-face {
  font-family: "Mario";
  src: url("brand/fonts/Mario-Regular.woff2") format("woff2"),
       url("brand/fonts/Mario-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Coconat, by Collletttivo. SIL Open Font License 1.1 — free to embed and
   self-host (see brand/fonts/Coconat-LICENSE.txt). The secondary face: it
   carries every display moment the wordmark doesn't. Demi is the only cut
   shipped, mapped to 400 so it reads as the normal weight. */
@font-face {
  font-family: "Coconat";
  src: url("brand/fonts/Coconat-Demi.woff2") format("woff2"),
       url("brand/fonts/Coconat-Demi.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Fudd, by Matthew Welch. MIT licensed. An even-stroke, no-contrast face the
   designer built for body text — it carries the reading copy and the labels. */
@font-face {
  font-family: "Fudd";
  src: url("brand/fonts/Fudd-Regular.woff2") format("woff2"),
       url("brand/fonts/Fudd-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fudd";
  src: url("brand/fonts/Fudd-Italic.woff2") format("woff2"),
       url("brand/fonts/Fudd-Italic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---- tokens ------------------------------------------------------------- */
/* The site is light, deliberately, for every visitor. There is no dark palette
   and no OS-preference switch: the monochrome depends on ink on warm paper,
   and inverting it changes what the page is. */
:root {
  color-scheme: light;
  --paper:  #f7f7f5;   /* warm near-white, not clinical #fff */
  --ink:    #101010;   /* body + wordmark */
  --muted:  #6b6b68;   /* secondary text, labels */
  --faint:  #a8a8a3;   /* the quietest tier: metadata */
  --hair:   #e2e2dd;   /* used almost nowhere, by design */

  /* Serif: Coconat Demi, the secondary face — every display moment that
     isn't the wordmark.
     Body + labels: Fudd, an even-stroke face built for reading. */
  --serif: "Coconat", "Instrument Serif", "Iowan Old Style", Palatino, Georgia, serif;
  --display: "Mario", "Coconat", Georgia, serif;   /* the wordmark + CM mark */
  --sans:  "Fudd", "Instrument Sans", ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  "Fudd", "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 34rem;    /* readable line length for prose */
  --gutter: clamp(1.5rem, 5vw, 6rem);
}

/* ---- loader ------------------------------------------------------------- */
/* The CM wipes in, a rule draws under it, then the panel lifts away.
   Total: about 1.5s. JS removes the node when it's done. */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  display: grid;
  place-items: center;
  /* the lift-away at the end */
  transition: transform 620ms cubic-bezier(0.7, 0, 0.2, 1), opacity 400ms ease 180ms;
}
.loader.done {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.loader-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.loader-cm {
  font-family: var(--display);
  font-size: clamp(3.5rem, 12vw, 7rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--ink);
  /* Reveal by sliding a mask across the letterforms, so the mark appears to
     be drawn rather than faded in. */
  -webkit-mask-image: linear-gradient(90deg, #000 0 33%, transparent 66%);
          mask-image: linear-gradient(90deg, #000 0 33%, transparent 66%);
  -webkit-mask-size: 300% 100%;
          mask-size: 300% 100%;
  -webkit-mask-position: 100% 0;
          mask-position: 100% 0;
  animation: cm-wipe 760ms cubic-bezier(0.65, 0, 0.35, 1) 120ms forwards;
}
@keyframes cm-wipe {
  to { -webkit-mask-position: 0 0; mask-position: 0 0; }
}

/* A hairline that draws out from the centre once the letters have landed. */
.loader-rule {
  display: block;
  height: 2px;
  width: clamp(3.5rem, 12vw, 7rem);
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: 50% 50%;
  animation: cm-rule 520ms cubic-bezier(0.65, 0, 0.35, 1) 700ms forwards;
}
@keyframes cm-rule {
  to { transform: scaleX(1); }
}

/* Reduced motion: show the mark, skip the choreography. */
@media (prefers-reduced-motion: reduce) {
  .loader-cm {
    -webkit-mask-image: none; mask-image: none;
    animation: none;
  }
  .loader-rule { transform: scaleX(1); animation: none; }
  .loader { transition: opacity 200ms ease; }
  .loader.done { transform: none; opacity: 0; }
}

/* ---- reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---- layout shell ------------------------------------------------------- */
.wrap {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Sections are separated by space alone. No dividers anywhere. */
section { padding-block: clamp(4rem, 11vh, 9rem); }

/* ---- the signature: the wordmark ---------------------------------------- */
/* Set enormous and tight. This is the one thing allowed to shout. */
.hero { padding-top: clamp(5rem, 18vh, 12rem); }

.wordmark {
  font-family: var(--display);
  font-weight: 400;
  /* Mario is wider than the serif was, so it needs a smaller cap to fit the
     same measure. */
  font-size: clamp(2.4rem, 10.5vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin: 0;
  /* optical: pull the C off the left edge so it aligns visually, not metrically */
  margin-left: -0.02em;
}
.wordmark .last { display: block; }

/* The one-liner. Sits close under the name, deliberately small against it. */
.spine {
  margin: clamp(1.5rem, 4vh, 2.75rem) 0 0;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: var(--measure);
  text-wrap: balance;
}

/* ---- asymmetric two-column grid ----------------------------------------- */
/* Label left, content right. The offset is the structure. */
.row {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: clamp(0.75rem, 4vw, 4rem);
  align-items: start;
}
.row + .row { margin-top: clamp(2.5rem, 6vh, 4.5rem); }

.label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding-top: 0.5em;   /* optical align to first line of body text */
}

.body-col { max-width: var(--measure); }
.body-col p { margin: 0 0 1.1em; }
.body-col p:last-child { margin-bottom: 0; }

/* ---- prose -------------------------------------------------------------- */
.lede {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.45;
  margin: 0;
  /* keeps a lone orphan word off the last line */
  text-wrap: pretty;
}

/* ---- links -------------------------------------------------------------- */
/* Underline is the affordance. It thickens on hover; nothing moves. */
.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--faint);
  transition: text-decoration-color 140ms ease, text-decoration-thickness 140ms ease;
}
.link:hover {
  text-decoration-color: var(--ink);
  text-decoration-thickness: 2px;
}

/* Placeholder copy: same size as body text, one tier quieter. */
.pending { color: var(--muted); }

/* Capability list. No bullets, no numbers: these are not a sequence. */
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { margin-bottom: 0.5em; }
.plain li:last-child { margin-bottom: 0; }

/* Social list: a plain stack, no bullets, no icons. */
.links { list-style: none; margin: 0; padding: 0; }
.links li { margin-bottom: 0.55em; }
.links li:last-child { margin-bottom: 0; }
.host {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--faint);
  margin-left: 0.6em;
}

.more {
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--faint);
}

/* ---- footer ------------------------------------------------------------- */
footer {
  padding-block: clamp(3rem, 8vh, 6rem);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

/* ---- accessibility floor ------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---- contact ------------------------------------------------------------ */
/* The only form on the site. Inputs are underlines, not boxes — the page has
   no borders anywhere else and a form shouldn't be the exception. */
.contact { margin: 0; max-width: var(--measure); }

.field { margin: 0 0 1.4rem; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.45em;
}
.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hair);
  border-radius: 0;
  padding: 0.35em 0;
  transition: border-color 150ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 5.5em; line-height: 1.5; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
}
/* Only flag a bad value once there's something in the field to be wrong. */
.field input:not(:placeholder-shown):invalid,
.field textarea:not(:placeholder-shown):invalid { border-bottom-color: var(--muted); }

.field-actions {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 1.6rem 0 0;
}
.send {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  padding: 0.75em 1.6em;
  cursor: pointer;
  transition: opacity 150ms ease;
}
.send:hover, .send:focus-visible { opacity: 0.82; }
.send[disabled] { opacity: 0.45; cursor: default; }

.form-note {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.or {
  margin: 1.6rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---- one album ---------------------------------------------------------- */
/* Opened from a cover in the crate. Sits above the crate, dismissed the same
   three ways. The cover does the work; everything else stays out of its way. */
.album {
  position: fixed;
  inset: 0;
  height: 100dvh;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  display: grid;
  place-items: center;
  padding: clamp(1rem, 5vw, 3rem);
  animation: fade 160ms ease;
}
.album[hidden] { display: none; }

.album-panel {
  position: relative;
  width: min(30rem, 100%);
  max-height: 88dvh;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--hair);
  box-shadow: 0 24px 70px rgba(0,0,0,0.16);
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

/* The cover is capped so the title and the link stay above the fold. */
.album-art {
  width: 100%;
  max-height: min(42dvh, 22rem);
  aspect-ratio: 1;
  object-fit: contain;
  object-position: left center;
  background: transparent;
  margin-bottom: clamp(1rem, 3vw, 1.4rem);
}

.album-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 0.2em;
}
.album-artist {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0;
}

.album-link {
  display: inline-block;
  margin-top: clamp(1rem, 3vw, 1.4rem);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--hair);
  padding-bottom: 0.15em;
  transition: color 140ms ease, border-color 140ms ease;
}
.album-link:hover, .album-link:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
}

.album-close {
  position: absolute;
  top: 0.5rem; right: 0.6rem;
  background: none;
  border: 0;
  padding: 0.35rem 0.5rem;
  font-size: 1rem;
  line-height: 1;
  color: var(--faint);
  cursor: pointer;
  z-index: 1;
}
.album-close:hover { color: var(--ink); }

/* ---- interior pages ----------------------------------------------------- */
/* Pages below the landing page. The wordmark doesn't shout here — it shrinks
   to a way back — so the page title carries the top of the page instead. */
.page-head { padding-top: clamp(2.5rem, 8vh, 4.5rem); }

.back {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  text-decoration: none;
  transition: color 140ms ease;
}
.back:hover, .back:focus-visible { color: var(--ink); }

.page-intro { padding-block: clamp(3rem, 9vh, 6rem) clamp(2rem, 5vh, 3.5rem); }

.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 clamp(1.25rem, 3vh, 2rem);
}

/* Short enough to want its own line — the reading measure is for paragraphs. */
.page-intro .lede { max-width: 44rem; margin-bottom: 0.75em; }
.page-intro .pending { max-width: var(--measure); margin: 0; }

/* A section's framing line: sits above its list, quieter than the entries. */
.note {
  color: var(--muted);
  max-width: var(--measure);
  margin: 0 0 1.1em;
}

/* The tile grid. Same instinct as the crate: let the marks do the talking,
   dense and square, with the words arriving on hover. A site's own icon is
   its cover; where there isn't a usable one, its initials stand in set in
   the display face, so every tile reads as designed rather than broken. */
.body-col.wide { max-width: none; }

.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: clamp(0.4rem, 1vw, 0.7rem);
}

.tile {
  display: block;
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  text-decoration: none;
  background: color-mix(in srgb, var(--ink) 4%, var(--paper));
  transition: background 180ms ease, transform 180ms ease;
}
.tile:hover, .tile:focus-visible {
  background: color-mix(in srgb, var(--ink) 7%, var(--paper));
}

/* The mark itself, centered and generously inset. */
.tile-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 180ms ease, transform 200ms ease;
}
.tile-face img {
  width: 46%;
  height: 46%;
  object-fit: contain;
}
/* A few sites have no square mark, only a wide wordmark. Those need more of
   the tile's width to stay legible. */
.tile-face.wordmark-face img {
  width: 78%;
  height: auto;
}
/* Initials for the sites with no usable icon. */
.mono-mark {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  line-height: 1;
  color: var(--muted);
  letter-spacing: -0.02em;
}

/* The words. Hidden until hover, then they cover the tile completely —
   the note is the point, so it gets the whole face rather than a strip. */
.tile-meta {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.2em;
  padding: 0.7rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  transition: opacity 160ms ease;
}
.tile:hover .tile-meta,
.tile:focus-visible .tile-meta { opacity: 1; }
.tile:hover .tile-face,
.tile:focus-visible .tile-face { opacity: 0; }

.tile-meta b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.tile-note {
  font-size: 0.68rem;
  line-height: 1.3;
  color: color-mix(in srgb, var(--paper) 72%, var(--ink));
  /* Long notes get clamped rather than overflowing the square. */
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-dom {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--paper) 52%, var(--ink));
  margin-top: 0.15em;
}

/* Touch devices have no hover, so the words are always up. */
@media (hover: none) {
  .tile-meta { opacity: 1; background: color-mix(in srgb, var(--ink) 92%, transparent); }
  .tile-face { opacity: 0; }
}

/* ---- mobile ------------------------------------------------------------- */
@media (max-width: 40rem) {
  /* Stack the grid: the label sits above its content, still mono + tiny. */
  .row { grid-template-columns: 1fr; gap: 0.4rem; }
  .label { padding-top: 0; }

  /* Labels head their section on mobile, so give them room to breathe. */
  .row + .row { margin-top: clamp(2.75rem, 7vh, 4rem); }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
}

/* ---- the crate page ----------------------------------------------------- */
/* Same wall as the overlay, but on paper: it runs the full width of the page
   and the covers carry it. Wider tiles than the overlay since there's room. */
.crate-page {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: clamp(0.5rem, 1.2vw, 0.9rem);
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}
.crate-page button {
  display: block;
  position: relative;
  aspect-ratio: 1;
  background: var(--hair);
  overflow: hidden;
  padding: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
}
.crate-page img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity 180ms ease;
}
.crate-page button:hover img,
.crate-page button:focus-visible img { opacity: 0.85; }

/* Caption rides over the art on hover, same as the overlay. */
.crate-page .cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.5rem 0.55rem;
  font-size: 0.7rem;
  line-height: 1.25;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.82), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity 180ms ease;
}
.crate-page button:hover .cap,
.crate-page button:focus-visible .cap { opacity: 1; }
.crate-page .cap b { font-weight: 600; display: block; }
.crate-page .cap span { color: #d8d8d4; }

/* Touch has no hover, so the caption would never show. Give it a permanent
   one under the art instead of hiding the titles entirely. */
@media (hover: none) {
  .crate-page .cap {
    position: static;
    opacity: 1;
    background: none;
    color: var(--muted);
    padding: 0.35rem 0 0;
    font-size: 0.65rem;
  }
  .crate-page .cap span { color: var(--faint); }
  .crate-page button { aspect-ratio: auto; background: none; }
  .crate-page button img { aspect-ratio: 1; }
}
