/* Font faces are inlined here rather than @import-ed from a separate file.
   An @import costs a second, serial round trip before any text can render,
   and that separate file would carry no cache fingerprint of its own. */

/* Self-hosted from Google Fonts (SIL Open Font License 1.1).
   League Gothic — The League of Moveable Type.  Source Code Pro — Adobe.
   Latin + Latin-Extended subsets only. */

@font-face {
  font-family: 'League Gothic';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/league-gothic-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'League Gothic';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/league-gothic-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/assets/fonts/source-code-pro-300-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/assets/fonts/source-code-pro-300-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/source-code-pro-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/source-code-pro-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/source-code-pro-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/source-code-pro-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Klœsh — design tokens
   Values mirror the original Squarespace theme so the rebuild matches 1:1.
   Change a value here and it updates everywhere on the site.
   ========================================================================== */

:root {
  --bg: #000;
  --fg: #fff;
  --accent: #a5889e;          /* the mauve used for nav, links and buttons */
  --field-bg: #fafafa;
  --field-fg: #111;           /* was #fff on the old site — invisible text */

  --font-body: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-display: 'League Gothic', 'Arial Narrow', sans-serif;

  --text: 1rem;               /* 16px */
  --text-sm: 0.9rem;
  --text-lg: 1.5rem;
  --leading: 1.7;

  --page-pad: 3vw;
  --max-page: 2200px;
  --header-pad: 1.8vw;
  --logo-h: 60px;
}

@media (max-width: 767px) {
  :root {
    --page-pad: 6vw;
    --header-pad: 6vw;
    --logo-h: 30px;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.26;
  margin: 0 0 0.5em;
}

h1 { font-size: 2.85rem; }
h2 { font-size: 2.47rem; }
h3, h4 { font-size: 1.52rem; }

a { color: var(--accent); }

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

/* Visible only to screen readers, until focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.75em 1.25em;
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.skip-link:focus { left: var(--page-pad); top: var(--page-pad); }

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

/* ==========================================================================
   Header — transparent, fixed, hides on scroll down / returns on scroll up
   (the original theme calls this "Scroll Back")
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: var(--header-pad) var(--page-pad);
  transition: transform 300ms ease;
}

.site-header[data-hidden='true'] { transform: translateY(-105%); }

.site-header__logo { justify-self: start; }
.site-header__logo img {
  height: var(--logo-h);
  width: auto;
}

.site-nav {
  justify-self: center;
  display: flex;
  gap: 20px;
}

.site-nav a {
  color: var(--accent);
  text-decoration: none;
  padding: 0.1em 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] { border-bottom-color: currentColor; }

.site-social {
  justify-self: end;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.site-social a {
  color: var(--accent);
  display: flex;
  transition: color 150ms ease;
}
.site-social a:hover,
.site-social a:focus-visible { color: var(--fg); }

/* Both marks are drawn on the same 32x32 canvas with the same internal
   padding, so a single size keeps them optically matched. Don't size them
   individually — that is what pulls them out of balance. */
.icon {
  width: 26px;
  height: 26px;
  fill: currentColor;
  display: block;
}

/* Mobile: logo left, menu button right, nav in a full-screen panel.

   The button is three bars rather than an icon swap. Opening the menu slides
   the outer two to the middle and turns them through 45°, while the middle bar
   collapses — so the burger becomes the cross, and reverses on close, instead
   of one glyph replacing another. */
.nav-toggle {
  display: none;
  justify-self: end;
  background: none;
  border: 0;
  padding: 0.5rem;
  color: var(--accent);
  cursor: pointer;
  line-height: 0;
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 26px;
  height: 18px;
}

.nav-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 160ms ease 80ms;
}

.nav-toggle__bars span:nth-child(1) { top: 0; }
.nav-toggle__bars span:nth-child(2) { top: 50%; margin-top: -0.75px; }
.nav-toggle__bars span:nth-child(3) { bottom: 0; }

/* 8.25px is half the gap between the outer bars' centres, so they meet
   exactly on the middle one before rotating. */
.nav-toggle[aria-expanded='true'] .nav-toggle__bars span:nth-child(1) {
  transform: translateY(8.25px) rotate(45deg);
}
.nav-toggle[aria-expanded='true'] .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.4);
  transition-delay: 0s;
}
.nav-toggle[aria-expanded='true'] .nav-toggle__bars span:nth-child(3) {
  transform: translateY(-8.25px) rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle__bars span { transition: none; }
}

/* Mobile menu.
   The panel is the header itself grown to fill the screen, rather than a
   separate `position: fixed` overlay. A fixed child would be trapped inside
   the header the moment the header carries a transform (it becomes the
   containing block), which is exactly what the scroll-back animation does. */
@media (max-width: 767px) {
  .site-header { grid-template-columns: 1fr auto; }
  .nav-toggle { display: block; }

  /* Scoped to the header: the footer keeps its own social row on mobile. */
  .site-header .site-nav,
  .site-header .site-social { display: none; }

  body[data-nav-open='true'] { overflow: hidden; }

  body[data-nav-open='true'] .site-header {
    height: 100dvh;
    background: var(--bg);
    grid-template-rows: auto 1fr auto;
    align-content: start;
  }

  body[data-nav-open='true'] .site-header .site-nav {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    font-size: var(--text-lg);
  }

  body[data-nav-open='true'] .site-header .site-social {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: stretch;   /* overrides the desktop `justify-self: end` */
    justify-content: center;
    gap: 2rem;
    padding-bottom: 12vh;
  }
}

/* ==========================================================================
   Page shell
   ========================================================================== */

main {
  /* clears the fixed header: logo height + padding above and below */
  padding-top: calc(var(--logo-h) + (var(--header-pad) * 2));
}

.section {
  max-width: var(--max-page);
  margin-inline: auto;
  padding: 0 var(--page-pad);
}

.section--flush { padding: 0; }

/* ==========================================================================
   Selected Works — two-column masonry, no gutter
   Laid out by assets/js/site.js at >= 768px. Without JS (or on mobile) the
   figures simply stack in order, which is the correct fallback.
   ========================================================================== */

.masonry {
  padding: var(--page-pad);
  max-width: var(--max-page);
  margin-inline: auto;
  position: relative;
}

.work { margin: 0; }

.work__link {
  display: block;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.work img { width: 100%; }

/* Captions live in the page source for search engines, but the grid stays
   as it always was — bare images. The lightbox is where they're read. */
.work__caption { display: none; }

/* Fade the artwork in as it scrolls into view, as the original did. */
.work[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.work[data-reveal='in'] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .work[data-reveal] { opacity: 1; transform: none; transition: none; }
  .site-header { transition: none; }
}

/* JS masonry mode: items are absolutely positioned into two columns. */
.masonry[data-masonry='on'] .masonry__inner { position: relative; }
.masonry[data-masonry='on'] .work {
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   About
   ========================================================================== */

/* The "Klœsh is…" plate is intentionally low-resolution zalgo typography.
   It is meant to be seen large and rough — do not "fix" the scaling. */
.about-plate {
  width: 100%;
  margin: 0;
}
.about-plate img {
  width: 100%;
  height: auto;
}

/* 42rem keeps the form's content box at ~596px, matching the original. */
.about-body {
  max-width: 42rem;
  margin: 0 auto;
  padding: 4rem var(--page-pad);
}


.rule {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  max-width: var(--max-page);
  margin: 0 auto;
}

/* ==========================================================================
   Contact form
   ========================================================================== */

.form { display: grid; gap: 1.5rem; }

.form__row {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 600px) {
  .form__row { grid-template-columns: 1fr; }
}

.form__group { display: grid; gap: 0.35rem; }

.form legend,
.form__label {
  padding: 0 0 4px;
  font-size: var(--text);
}

.form legend { padding-bottom: 0.6rem; }

.form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.form__hint {
  font-size: var(--text-sm);
  opacity: 0.6;
}

.form input,
.form textarea {
  font: inherit;
  color: var(--field-fg);
  background: var(--field-bg);
  border: 1px solid #000;
  border-radius: 0;
  padding: 10px;
  width: 100%;
}

.form textarea { min-height: 100px; resize: vertical; }

.form input:focus,
.form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form__actions { justify-self: center; padding-top: 0.5rem; }

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.288rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border: 2px solid var(--accent);
  border-radius: 0;
  padding: 1.3rem 2.17rem;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.btn:hover { background: var(--accent); color: var(--bg); }
.btn[disabled] { opacity: 0.5; cursor: progress; }

.form__status {
  text-align: center;
  min-height: 1.7em;
}
.form__status[data-state='error'] { color: #ff8a8a; }
.form__status[data-state='ok'] { color: var(--accent); }

/* Bot trap — real people never see or fill this. */
.form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  background: #000;
  /* flex-start + margin:auto on the child, rather than align-items:center.
     Centred flex items get their overflow clipped at the top once the caption
     makes the content taller than the screen; this way it just scrolls. */
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lightbox[open],
.lightbox[data-open='true'] { display: flex; }

.lightbox__figure {
  margin: auto;
  padding: 3.5rem 1rem 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  max-width: 100%;
}

.lightbox__img {
  max-width: calc(100vw - 8rem);
  max-height: calc(100vh - 8rem);
  width: auto;
  height: auto;
  object-fit: contain;
}

/* With a caption the picture gives up some height so the writing sits with it
   on screen, rather than pushing the reader into a scroll. */
.lightbox[data-has-caption='true'] .lightbox__img { max-height: 58vh; }

.lightbox__caption {
  max-width: 58ch;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.lightbox__caption:empty { display: none; }

.lightbox__caption .work__title {
  font-family: var(--font-display);
  font-size: 1.52rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.26;
  color: var(--fg);
}

.lightbox__caption .work__medium {
  font-size: var(--text-sm);
  color: var(--accent);
}

.lightbox__caption .work__blurb {
  font-size: var(--text-sm);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
}

@media (max-width: 767px) {
  .lightbox__figure { padding: 4.5rem 1rem 5rem; gap: 1.25rem; }
  .lightbox__img { max-width: calc(100vw - 1.5rem); max-height: calc(100vh - 10rem); }
  .lightbox[data-has-caption='true'] .lightbox__img { max-height: 55vh; }
}

.lightbox__btn {
  /* fixed, not absolute — the controls must stay put while a long caption scrolls */
  position: fixed;
  background: none;
  border: 0;
  color: var(--fg);
  cursor: pointer;
  padding: 1rem;
  opacity: 0.7;
  transition: opacity 150ms ease, color 150ms ease;
  line-height: 0;
}
.lightbox__btn:hover { opacity: 1; color: var(--accent); }
.lightbox__btn svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.5; }

.lightbox__close { top: 1rem; right: 1.25rem; }
.lightbox__prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 0.5rem; top: 50%; transform: translateY(-50%); }

/* In the flow at the foot of the figure, so a long caption can never scroll
   underneath it. */
.lightbox__count {
  margin: 0;
  font-size: var(--text-sm);
  opacity: 0.55;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   Footer
   ========================================================================== */

/* Social icons, then the winged clone, then the credit line — all centred.
   The icons and the mark match the original site's footer. */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 4rem var(--page-pad) 3.5rem;
  text-align: center;
  font-size: var(--text-sm);
}

.site-social--footer {
  justify-self: center;
  gap: 0.75rem;
}

.site-footer__mark {
  display: block;
  width: 95px;
}

.site-footer__note {
  margin: 0;
  color: var(--accent);
}

.site-footer a {
  color: var(--accent);
  transition: color 150ms ease;
}
.site-footer a:hover,
.site-footer a:focus-visible { color: var(--fg); }

/* The sprite is a definitions block, never rendered directly. */
.sprite { display: none; }
