/* ============================================================================
   gallery.css — the master site.

   Design brief: this page's job is to make twelve loud, unrelated design systems
   sit together without fighting. So the gallery itself contributes **no colour of
   its own** — every hue on the page belongs to one of the twelve sites. The chrome
   is achromatic, the type is a single family, and the one memorable device is the
   twelve-ink bar: a strip of all twelve accents in order, which is simultaneously
   the identity of the project and a jump nav.
   ============================================================================ */

:root {
  --ink: #16161A;
  --ink-2: #2C2C33;
  --paper: #FAFAF8;
  --paper-2: #EFEFEC;
  --grey: #6E6E73;
  --rule: #D8D8D3;

  --container: 1180px;
  --pad: clamp(20px, 5vw, 48px);
  --gap: clamp(64px, 8vw, 112px);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans Thai', system-ui, sans-serif;
}

.num, .mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }

.wrap { max-width: var(--container); margin-inline: auto; padding-inline: var(--pad); }

/* -- header ----------------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.header.is-stuck { border-bottom-color: var(--rule); }
.header__inner {
  max-width: var(--container); margin-inline: auto; padding: 14px var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
/* Two lines, so the mark centres against the pair rather than the first line alone. */
.brand__text { display: flex; flex-direction: column; line-height: 1.3; }
.brand__by { font-size: .6875rem; font-weight: 400; color: var(--grey); }
/* Sized to the pair of lines, not to one: align-self overrides the row's align-items, so the
   mark grows with the text block instead of being re-centred against the first line. */
.brand__mark {
  width: 34px; height: auto; min-height: 34px; align-self: stretch; flex: none;
  background:
    linear-gradient(90deg, #C1272D 0 25%, #E8654F 25% 50%, #6B2233 50% 75%, #FF5B25 75% 100%);
}
.header__link { color: var(--grey); text-decoration: none; font-size: .9375rem; }
.header__link:hover { color: var(--ink); }

/* -- hero ------------------------------------------------------------------- */
/* padding-block, never the padding shorthand: .hero and .section are used together with
   .wrap, and a shorthand here resets .wrap's padding-inline to 0 — which only shows up
   below the container width, where the auto margins stop faking the gutter. */
.hero { padding-block: clamp(64px, 10vw, 128px) clamp(40px, 5vw, 64px); }
.hero__eyebrow {
  font-size: .8125rem; letter-spacing: .04em; color: var(--grey);
  text-transform: uppercase;
}
.hero h1 {
  margin: 20px 0 24px;
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  max-width: 20ch;
}
.hero__lead { max-width: 62ch; color: var(--ink-2); font-size: clamp(1.0625rem, 1.6vw, 1.1875rem); }
.hero .pbtn-row { margin-top: 28px; }

.stats { display: flex; flex-wrap: wrap; gap: 0; margin-top: 40px; border-top: 1px solid var(--rule); }
.stats__item { padding: 20px 28px 20px 0; margin-right: 28px; border-right: 1px solid var(--rule); }
.stats__item:last-child { border-right: 0; margin-right: 0; }
.stats__num { display: block; font-size: 1.75rem; font-weight: 500; }
.stats__label { font-size: .875rem; color: var(--grey); }
/* Wrapped, the flex row leaves a divider hanging off the end of the first line and none at
   all on the second. Two by two keeps the rules meaning "next column". */
@media (max-width: 560px) {
  .stats { display: grid; grid-template-columns: 1fr 1fr; }
  .stats__item { margin-right: 0; padding-right: 20px; }
  .stats__item:nth-child(2n), .stats__item:last-child { border-right: 0; }
  .stats__item:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* -- signature: the twelve-ink bar ------------------------------------------ */
/* Twelve equal segments in gallery order. It is the project's identity and a jump nav at
   once — the only place the gallery is allowed to be colourful, because the colour is
   borrowed from the work rather than invented for the wrapper. */
.inkbar {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  height: 56px;
  margin: clamp(40px, 6vw, 72px) 0 0;
  border: 1px solid var(--rule);
}
.inkbar__seg {
  position: relative;
  display: block;
  background: var(--seg);
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
  transform-origin: bottom;
}
.inkbar__seg:hover, .inkbar__seg:focus-visible { transform: scaleY(1.35); z-index: 2; }
.inkbar__seg::after {
  content: attr(data-name);
  position: absolute; left: 50%; bottom: calc(100% + 10px);
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: .75rem;
  padding: 5px 9px;
  background: var(--ink); color: var(--paper);
  opacity: 0; pointer-events: none;
  transition: opacity .18s;
}
/* The end tooltips are centred on segments that sit at the very edge of the page, so half of
   each one lands outside it. opacity:0 does not take an element out of the layout — the two
   invisible labels were enough to give the whole page a horizontal scrollbar. Anchor them to
   the inside edge instead. */
.inkbar__seg:first-child::after { left: 0; transform: none; }
.inkbar__seg:last-child::after { left: auto; right: 0; transform: none; }
.inkbar__seg:hover::after, .inkbar__seg:focus-visible::after { opacity: 1; }
.inkbar__legend {
  display: flex; justify-content: space-between;
  margin-top: 10px; font-size: .75rem; color: var(--grey);
}

@media (max-width: 640px) {
  .inkbar { height: 40px; }
  .inkbar__seg::after { display: none; }
}

/* -- card grid --------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 3.5vw, 44px) clamp(20px, 2.5vw, 32px);
  padding-block: var(--gap);
}
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid { grid-template-columns: 1fr; } }
/* The grid's own bottom padding sits above this row, so the space it still needs is below —
   otherwise the buttons land flush against the next section's rule. */
.grid + .pbtn-row { margin-bottom: var(--gap); }

.card { display: flex; flex-direction: column; text-decoration: none; }
.card__shot {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}
.card__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.card:hover .card__shot img { transform: scale(1.03); }

/* Placeholder shown until a real screenshot exists: the site's own accent, its number,
   and nothing else. Honest about being empty rather than faking a screenshot. */
.card__shot--empty { display: grid; place-items: center; background: var(--seg); }
.card__shot--empty span { font-size: 3rem; font-weight: 700; color: #fff; opacity: .62; }

.card__bar { height: 6px; background: var(--seg); }

.card__body { padding-top: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__meta { display: flex; align-items: baseline; gap: 10px; font-size: .8125rem; color: var(--grey); }
.card__num { color: var(--ink); }
.card__name { font-size: 1.1875rem; font-weight: 600; line-height: 1.35; }
.card:hover .card__name { text-decoration: underline; text-underline-offset: 3px; }
.card__tagline { font-size: .9375rem; color: var(--grey); line-height: 1.7; }
.card__sig {
  margin-top: auto; padding-top: 12px;
  font-size: .8125rem; color: var(--ink-2);
  border-top: 1px solid var(--rule);
}
.card__sig b { font-weight: 500; }

/* -- content sections --------------------------------------------------------- */
.section { padding-block: var(--gap); border-top: 1px solid var(--rule); }
.section h2 { font-size: clamp(1.5rem, 3vw, 2.125rem); margin-bottom: 16px; }
.section p { max-width: 68ch; color: var(--ink-2); }
.section p + p { margin-top: 16px; }

.notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 40px; }
@media (max-width: 860px) { .notes { grid-template-columns: 1fr; gap: 24px; } }
.notes h3 { font-size: 1.0625rem; margin-bottom: 8px; }
.notes p { font-size: .9375rem; }

.deftable { width: 100%; margin-top: 32px; font-size: .9375rem; }
.deftable th, .deftable td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.deftable th { width: 30%; font-weight: 600; }
.deftable td { color: var(--ink-2); }
@media (max-width: 640px) {
  .deftable, .deftable tbody, .deftable tr, .deftable th, .deftable td { display: block; width: auto; }
  .deftable th { border-bottom: 0; padding-bottom: 2px; }
  .deftable td { padding-top: 0; }
}

/* -- footer -------------------------------------------------------------------- */
.footer { background: var(--ink); color: var(--paper); padding: clamp(48px, 6vw, 80px) 0; }
.footer__inner { max-width: var(--container); margin-inline: auto; padding-inline: var(--pad); }
.footer__lead { font-size: 1.0625rem; }
.footer__meta { margin-top: 16px; font-size: .875rem; color: #9A9AA0; line-height: 1.8; }
.footer a { color: inherit; }

:focus-visible { outline-color: var(--ink); }

/* A site with no pages yet is shown, but not as a link — the card says so plainly rather
   than offering a click that 404s. */
.card--pending { opacity: .55; }
.card--pending .card__shot--empty span { opacity: .4; }
.card__pending {
  margin-top: 8px; font-family: 'IBM Plex Mono', monospace; font-size: .75rem;
  color: var(--grey); letter-spacing: .02em;
}
