/* ------------------------------------------------------------------ *
 * Anete Mūrniece — design tokens
 * Values taken straight from the Claude Design source so the rendered
 * site matches the comps exactly.
 * ------------------------------------------------------------------ */

:root {
  /* The six the admin panel writes to. Everything below is derived from
     these, so changing the ink or the accent moves the whole palette. */
  --paper: #FDFBF7;
  --paper-warm: #F9F4E8;
  --ink: #2B2926;
  --tan: #A08C74;
  --muted: #6B675F;
  --rule: #E9E2D6;

  /* Literal fallbacks first, then the derived value — browsers without
     color-mix() keep the design's original hand-picked shades. */
  --ink-soft: #3B3833;
  --ink-soft: color-mix(in srgb, var(--ink) 92%, var(--paper));
  --ink-body: #4C4842;
  --ink-body: color-mix(in srgb, var(--ink) 82%, var(--paper));
  --faded: #B5AB9A;
  --faded: color-mix(in srgb, var(--tan) 62%, var(--paper));
  --rule-warm: #E5DCC9;
  --rule-warm: color-mix(in srgb, var(--rule) 88%, var(--tan));
  --rule-strong: #DDD5C6;
  --rule-strong: color-mix(in srgb, var(--rule) 80%, var(--tan));
  --divider: #C9BFAC;
  --divider: color-mix(in srgb, var(--rule) 55%, var(--tan));
  --hatch-a: #EFE9DF;
  --hatch-a: color-mix(in srgb, var(--rule) 70%, var(--paper));
  --hatch-b: #E7E0D3;
  --hatch-b: color-mix(in srgb, var(--rule) 92%, var(--tan) 8%);
  --hatch-ink: #9A8F7C;
  --hatch-ink: color-mix(in srgb, var(--tan) 88%, var(--ink));

  /* The wordmark can carry its own face, size and tracking. */
  --masthead-font: 'Playfair Display', Georgia, serif;
  --masthead-style: italic;
  --masthead-weight: 500;
  --masthead-size: 34px;
  --masthead-tracking: 0;

  --tagline-font: Montserrat, system-ui, sans-serif;
  --tagline-size: 10.5px;
  --tagline-tracking: .28em;
  --tagline-transform: uppercase;
  --tagline-weight: 400;

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: Montserrat, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;

  /* Paper texture — the masthead only. The rest of the page stays plain so
     body text has nothing competing behind it. */
  --texture-header: url('/assets/paper-photo.jpg');
  --texture-size: cover;
  --texture-header-opacity: .75;

  --page-max: 1440px;
  --gutter: 80px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ------------------------------------------------------------------ *
 * Base
 * ------------------------------------------------------------------ */

*,
*::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-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-texture='off'] .site-header::before { display: none; }

.page { position: relative; z-index: 1; }

a {
  color: var(--ink);
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

a:hover { color: var(--tan); }

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

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

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Everything fades in once content has loaded, so there is no flash of
   half-rendered template. */
.page[data-state='loading'] main { opacity: 0; }
main { opacity: 1; transition: opacity .3s ease; }

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

.site-header {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 44px 60px 30px;
  border-bottom: 1px solid var(--rule-warm);
  background-color: var(--paper-warm);
  text-align: center;

  /* Photographic paper is a good deal darker than flat colour, so the small
     text in here is pulled toward the ink to hold its contrast. Measured
     against the texture at 75%: menu 4.5:1, tagline 3.0:1, language switch
     2.6:1 — each at or above what the same text managed on plain colour.
     Mixing toward --ink rather than to a fixed value keeps this working when
     the palette is changed, including the dark preset. */
  --header-accent: #675B4E;
  --header-accent: color-mix(in srgb, var(--tan) 50%, var(--ink));
  --header-muted: #46433E;
  --header-muted: color-mix(in srgb, var(--muted) 40%, var(--ink));
  --header-faded: #6D675E;
  --header-faded: color-mix(in srgb, var(--faded) 45%, var(--ink));

  --tagline-colour: var(--header-accent);
}

/* Set in blackletter the tagline is all hairlines, so it is pulled further
   toward the ink — 4.5:1 on the texture rather than the 3.1:1 that tracked
   capitals get away with. */
body[data-tagline='masthead'] .site-header {
  --tagline-colour: #48423A;
  --tagline-colour: color-mix(in srgb, var(--tan) 25%, var(--ink));
}

/* With no texture the header is flat colour again, so the design's original,
   lighter shades read perfectly well. */
body[data-texture='off'] .site-header {
  --header-accent: var(--tan);
  --header-muted: var(--muted);
  --header-faded: var(--faded);
}

/* The sheet of paper the masthead is printed on. Nothing below the header
   carries it. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--texture-header);
  background-size: var(--texture-size);
  background-position: center;
  background-repeat: repeat;
  opacity: var(--texture-header-opacity);
  pointer-events: none;
  z-index: -1;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.brand__name {
  font-family: var(--masthead-font);
  font-style: var(--masthead-style);
  font-weight: var(--masthead-weight);
  font-size: var(--masthead-size);
  letter-spacing: var(--masthead-tracking);
  line-height: 1.15;
}

.brand__tagline {
  font-family: var(--tagline-font);
  font-size: var(--tagline-size);
  font-weight: var(--tagline-weight);
  letter-spacing: var(--tagline-tracking);
  text-transform: var(--tagline-transform);
  color: var(--tagline-colour);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 34px;
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 500;
}

.nav a {
  white-space: nowrap;
  color: var(--header-muted);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}

.nav a:hover { color: var(--ink); }

.nav a[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.lang {
  display: flex;
  gap: 8px;
  margin-left: 12px;
  font-size: 10.5px;
  letter-spacing: .1em;
}

.lang button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  color: var(--header-faded);
}

.lang button[aria-pressed='true'] { color: var(--ink); }
.lang button:hover { color: var(--ink); }
.lang__sep { color: var(--header-faded); }

/* ------------------------------------------------------------------ *
 * Footer
 * ------------------------------------------------------------------ */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--rule);
  padding: 34px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-footer a { color: var(--muted); }
.site-footer__links {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ *
 * Shared pieces
 * ------------------------------------------------------------------ */

.eyebrow {
  font-size: 10.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--tan);
  font-weight: 600;
}

.rule-short {
  width: 44px;
  border-top: 1px solid var(--divider);
}

.btn {
  display: inline-block;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 14px 30px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover,
.btn:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.btn[disabled] {
  opacity: .45;
  cursor: default;
  background: transparent;
  color: var(--ink);
}

.stars {
  font-size: 15px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.stars__on { color: var(--tan); }
.stars__off { color: var(--rule-strong); }

/* Image frame — shows the photo when there is one, and the design's
   hatched placeholder (with its label) when there is not. */
.frame {
  position: relative;
  overflow: hidden;
  background: repeating-linear-gradient(
    45deg,
    var(--hatch-a), var(--hatch-a) 12px,
    var(--hatch-b) 12px, var(--hatch-b) 24px
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame__label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--hatch-ink);
  text-align: center;
  padding: 12px;
  line-height: 1.5;
}

.frame--sm { background-size: 20px 20px; }
.frame--sm .frame__label { font-size: 9px; }

/* ------------------------------------------------------------------ *
 * Home
 * ------------------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 70px;
  align-items: center;
  padding-block: 70px;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 52px;
  line-height: 1.12;
  text-wrap: pretty;
}

.hero__author {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__lede {
  margin: 0;
  font-weight: 300;
  font-size: 15.5px;
  line-height: 1.85;
  letter-spacing: .02em;
  color: var(--ink-body);
  max-width: 420px;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.hero__frame { aspect-ratio: 4 / 3.4; }

.reviews-section {
  padding-block: 30px 80px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  padding-top: 36px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  white-space: nowrap;
}

.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 18px;
  border: 1px solid var(--rule-strong);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.chip:hover { border-color: var(--tan); color: var(--ink); }

.chip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: inherit;
}

.card:hover { color: inherit; }
.card:hover .card__title { color: var(--tan); }
.card__frame { aspect-ratio: 3 / 2; }

.card__genre {
  font-size: 9.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--tan);
  font-weight: 600;
}

.card__title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.25;
  transition: color .18s ease;
}

.card__author {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card__desc {
  margin: 0;
  font-weight: 300;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-body);
}

.card .stars { font-size: 13px; }

.empty-note {
  grid-column: 1 / -1;
  padding: 40px 0;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

/* ------------------------------------------------------------------ *
 * Article
 * ------------------------------------------------------------------ */

.article {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.article__back {
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--tan);
  font-weight: 600;
}

.article__head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  padding-top: 8px;
}

.article__meta {
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--tan);
  font-weight: 600;
}

.article__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 46px;
  line-height: 1.15;
  text-wrap: pretty;
}

.article__sub {
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.article__head .stars { letter-spacing: 3px; }
.article__hero { aspect-ratio: 16 / 9; margin-top: 10px; }

.prose {
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: .015em;
  color: var(--ink-soft);
}

.prose p { margin: 0; }

.prose blockquote {
  margin: 14px 0;
  padding: 6px 0 6px 30px;
  border-left: 2px solid var(--tan);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.5;
  color: var(--ink);
}

.prose figure { margin: 10px 0; }
.prose .frame { aspect-ratio: 16 / 8; }

.prose figcaption {
  margin-top: 10px;
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.article__gallery {
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-top: 1px solid var(--rule);
  padding-top: 36px;
  margin-top: 12px;
}

.article__gallery h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.gallery-grid .frame { aspect-ratio: 1; }

.article__nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--rule);
  padding-top: 28px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 500;
}

.article__nav a { color: var(--muted); }
.article__nav span { visibility: hidden; }

/* ------------------------------------------------------------------ *
 * Articles index
 * ------------------------------------------------------------------ */

.index-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
  padding-block: 64px 12px;
}

.index-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 46px;
  line-height: 1.15;
}

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

.about {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 40px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 80px;
  align-items: start;
}

.about__aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about__portrait { aspect-ratio: 4 / 5; }

.reading-card {
  border: 1px solid var(--rule);
  padding: 22px;
  display: flex;
  gap: 18px;
  align-items: center;
}

.reading-card .frame {
  width: 54px;
  aspect-ratio: 2 / 3;
  flex: none;
  background-size: 16px 16px;
}

.reading-card__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.reading-card__label {
  font-size: 9.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--tan);
  font-weight: 600;
}

.reading-card__title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.reading-card__author {
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.about__main {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.about__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 46px;
  line-height: 1.15;
}

.about__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-weight: 300;
  font-size: 15.5px;
  line-height: 1.95;
  letter-spacing: .015em;
  color: var(--ink-soft);
  max-width: 560px;
}

.about__body p { margin: 0; }

.stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  padding-top: 26px;
  margin-top: 6px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat__value {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.stat__label {
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------------ *
 * CV
 * ------------------------------------------------------------------ */

.cv {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 64px 40px 80px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.cv__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 40px;
}

.cv__name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 54px;
  line-height: 1.1;
}

.cv__headline {
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--tan);
  font-weight: 600;
}

.cv__grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 70px;
  align-items: start;
}

.cv__aside {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.cv__portrait { aspect-ratio: 3 / 4; }

.cv__block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-weight: 300;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-body);
}

.cv__block a { font-weight: 300; color: var(--ink-body); }
.cv__block a:hover { color: var(--tan); }

.cv__block-title {
  font-size: 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--tan);
  font-weight: 600;
  margin-bottom: 4px;
}

.cv__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cv__row span:last-child { color: var(--muted); }

.cv__main {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.cv__section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.cv__section--intro { gap: 16px; }

.cv__section h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
}

.cv__section--ruled h2 {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 14px;
}

.cv__profile {
  margin: 0;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: .015em;
  color: var(--ink-body);
  max-width: 620px;
}

.cv__entry {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
}

.cv__period {
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--tan);
  font-weight: 500;
  padding-top: 4px;
}

.cv__entry-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cv__role {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
}

.cv__org {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.cv__entry-body p {
  margin: 4px 0 0;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-body);
}

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

.contact {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  text-align: center;
  align-items: center;
}

.contact h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 44px;
  line-height: 1.15;
}

.contact__sub {
  margin: 0;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: .02em;
  color: var(--ink-body);
  max-width: 420px;
}

.contact__email {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
}

.contact__links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 500;
}

.contact__links a { color: var(--muted); }

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  text-align: left;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.field input,
.field textarea {
  border: 1px solid var(--rule-strong);
  background: #FFFFFF;
  padding: 13px 14px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: .02em;
  outline: none;
  text-transform: none;
  border-radius: 0;
}

.field textarea { resize: vertical; min-height: 140px; }

.field input:focus,
.field textarea:focus { border-color: var(--tan); }

input::placeholder,
textarea::placeholder { color: var(--faded); }

.form .btn { align-self: center; margin-top: 6px; }

.form__status {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: none;
  font-weight: 400;
  text-align: center;
  min-height: 1.2em;
  color: var(--muted);
}

.form__status[data-tone='ok'] { color: var(--tan); }
.form__status[data-tone='error'] { color: #A5443A; }

/* ------------------------------------------------------------------ *
 * Motion
 *
 * The design is quiet, so the movement is too: things rise into place the
 * way a page settles, rather than sliding or bouncing. All of it is behind
 * [data-motion='on'], which the admin panel and the reduced-motion media
 * query can both switch off.
 * ------------------------------------------------------------------ */

/* Reading progress — a single hairline that fills as you go. */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(var(--progress, 0));
  transform-origin: 0 50%;
  background: var(--tan);
  z-index: 60;
  pointer-events: none;
  opacity: .85;
}

body:not([data-motion='on']) .progress { display: none; }

/* --- entrance on scroll --- */

body[data-motion='on'] [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity .8s var(--ease) calc(var(--reveal-i, 0) * 80ms),
    transform .8s var(--ease) calc(var(--reveal-i, 0) * 80ms);
  will-change: opacity, transform;
}

body[data-motion='on'] [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Photographs come up like a print in a tray — from the bottom, softly. */
body[data-motion='on'] [data-reveal='photo'] {
  opacity: 1;
  transform: none;
  clip-path: inset(14% 0 0 0);
  filter: saturate(.6) contrast(.92);
  transition:
    clip-path 1.1s var(--ease) calc(var(--reveal-i, 0) * 80ms),
    filter 1.3s ease calc(var(--reveal-i, 0) * 80ms);
}

body[data-motion='on'] [data-reveal='photo'].is-in {
  clip-path: inset(0 0 0 0);
  filter: none;
}

/* Rules draw themselves in from the left. */
body[data-motion='on'] [data-reveal='rule'] {
  opacity: 1;
  transform: none;
  transition: none;
}

body[data-motion='on'] [data-reveal='rule']::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--divider);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .9s var(--ease);
}

body[data-motion='on'] [data-reveal='rule'].is-in::after { transform: scaleX(1); }
body[data-motion='on'] .rule-short[data-reveal='rule'] { border-top: 0; }

/* Headings set themselves a word at a time. */
body[data-motion='on'] .reveal-line {
  display: inline-block;
  opacity: 0;
  transform: translateY(.5em);
  transition:
    opacity .7s var(--ease) calc(var(--word-i, 0) * 55ms),
    transform .7s var(--ease) calc(var(--word-i, 0) * 55ms);
}

body[data-motion='on'] .is-in .reveal-line {
  opacity: 1;
  transform: none;
}

/* --- changing genre --- */

/* Height is driven from script during the swap; hiding the overflow keeps a
   card that is still fading from spilling past the grid. */
.card-grid.is-shifting {
  overflow: hidden;
  transition: height .42s var(--ease);
}

body[data-motion='on'] .card.is-exiting {
  opacity: 0;
  transform: translateY(12px) scale(.975);
  filter: blur(3px);
  pointer-events: none;
  transition:
    opacity .2s ease calc(var(--exit-i, 0) * 18ms),
    transform .2s var(--ease) calc(var(--exit-i, 0) * 18ms),
    filter .2s ease calc(var(--exit-i, 0) * 18ms);
}

body[data-motion='on'] .card.is-entering {
  opacity: 0;
  transform: translateY(18px) scale(.985);
  filter: blur(4px);
}

body[data-motion='on'] .card.is-entering.is-entered {
  opacity: 1;
  transform: none;
  filter: none;
  transition:
    opacity .5s ease calc(var(--enter-i, 0) * 50ms),
    transform .5s var(--ease) calc(var(--enter-i, 0) * 50ms),
    filter .6s ease calc(var(--enter-i, 0) * 50ms);
}

/* The photograph inside an arriving card develops rather than just fading. */
body[data-motion='on'] .card.is-entering .card__frame {
  clip-path: inset(18% 0 0 0);
  filter: saturate(.55);
}

body[data-motion='on'] .card.is-entering.is-entered .card__frame {
  clip-path: inset(0 0 0 0);
  filter: none;
  transition:
    clip-path .75s var(--ease) calc(var(--enter-i, 0) * 50ms),
    filter .85s ease calc(var(--enter-i, 0) * 50ms);
}

/* The empty note fades in on its own terms. */
body[data-motion='on'] .card-grid.is-shifting .empty-note {
  animation: page-in .5s var(--ease) both;
}

/* --- parallax --- */

body[data-motion='on'] .parallax {
  transform: translate3d(0, var(--py, 0px), 0) scale(1.08);
  will-change: transform;
}

/* --- page transitions --- */

body[data-motion='on'] .page {
  animation: page-in .55s var(--ease) both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

body[data-motion='on'].is-leaving .page {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .22s ease, transform .22s ease;
}

/* The masthead stays put between pages so only the content changes. */
body[data-motion='on'] .site-header { animation: none; }

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */

@media (max-width: 1100px) {
  :root { --gutter: 48px; }

  .hero { gap: 48px; }
  .hero__title { font-size: 44px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 34px; }
  .cv__grid { grid-template-columns: 240px 1fr; gap: 48px; }
  .about { grid-template-columns: 300px 1fr; gap: 52px; padding: 64px 32px; }
}

@media (max-width: 860px) {
  :root { --gutter: 28px; }

  .site-header { padding: 34px 24px 24px; gap: 18px; }
  .brand__name { font-size: calc(var(--masthead-size) * .74); }
  .nav { gap: 20px; font-size: 11px; }
  .lang { margin-left: 0; width: 100%; justify-content: center; }

  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-block: 44px;
  }
  .hero__frame { order: -1; aspect-ratio: 3 / 2; }
  .hero__title { font-size: 36px; }
  .hero__lede { max-width: none; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .reviews-section { padding-block: 20px 56px; }

  .about {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 48px 24px;
  }
  .about__title { font-size: 34px; }
  .about__portrait { max-width: 360px; }

  .cv { padding: 44px 24px 64px; gap: 40px; }
  .cv__name { font-size: 38px; }
  .cv__grid { grid-template-columns: 1fr; gap: 40px; }
  .cv__portrait { max-width: 300px; }
  .cv__entry { grid-template-columns: 1fr; gap: 8px; }
  .cv__period { padding-top: 0; }

  .article { padding: 40px 24px 64px; }
  .article__title { font-size: 32px; }
  .prose { font-size: 15.5px; }
  .prose blockquote { font-size: 20px; padding-left: 20px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }

  .index-head { padding-block: 44px 8px; }
  .index-head h1 { font-size: 34px; }

  .contact { padding: 48px 24px; }
  .contact h1 { font-size: 32px; }

  .site-footer {
    padding: 28px var(--gutter);
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 14px;
  }
}

@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; gap: 40px; }
  .form__row { grid-template-columns: 1fr; }
  .stats { gap: 26px; }
  .nav { gap: 14px; letter-spacing: .12em; }
  .article__nav { flex-direction: column; gap: 12px; }
  .article__nav span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ------------------------------------------------------------------ *
 * Print — mostly so the CV prints cleanly
 * ------------------------------------------------------------------ */

@media print {
  .site-header,
  .site-footer,
  .btn { display: none !important; }

  body { background: #fff; }
  .cv { padding: 0; }
}
