/* LauLuna-Art portfolio, v1 "cream and navy".
   Tokens are the only colour values in this file; translucent variants use
   color-mix() on a token. Previous version: _versions/v0-paper/. */

:root,
::backdrop {
  --cream: #FFF8DE;
  --cream-pale: #FEFCF2;
  --navy: #253850;
  --navy-deep: #1A2A3E;
  --navy-soft: #4A5A70;

  /* Hero grounds, sampled from the artwork by _tools/sample_grounds.py and
     darkened only until cream text reaches 4.6:1 (see brand-spec.md). */
  --dusk-top: #394890;
  --dusk-bottom: #76689D;
  --ground-dawn-top: #3F4488;
  --ground-dawn-bottom: #565381;
  --ground-flying-top: #2D789A;
  --ground-flying-bottom: #456A88;
  --ground-always-top: #007B95;
  --ground-always-bottom: #415184;
  --ground-stars-fall-top: #3D5D61;
  --ground-stars-fall-bottom: #607476;
  /* Star colours: the motes around the wolf in "Even stars shine at dawn". */
  --mote-light: #EDF2FA;
  --mote-lilac: #ACC0E0;

  --font-heading: "Marcellus", Georgia, "Times New Roman", serif;
  --font-body: "League Spartan", "Helvetica Neue", Arial, sans-serif;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-15: 120px;

  --radius-tile: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  --content: 1200px;
  --row-h: 260px;
  --scallop-period: 112px;
  --scallop-depth: 32px;
  --header-h: 61px; /* 8 + 44 + 8 padding and links, 1px hairline */
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  text-wrap: pretty;
}

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

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  margin: 0 0 var(--space-2);
  text-wrap: balance;
}

/* "LauLuna-Art" stays on one line: the size is capped by the viewport width. */
h1 {
  font-size: clamp(2.5rem, 16vw, 6rem);
  line-height: 1;
  letter-spacing: -0.05em;
  white-space: nowrap;
}

h2 {
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h3 {
  font-size: 26px;
  line-height: 1.2;
}

p,
ul,
dl {
  margin: 0 0 var(--space-2);
}

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--navy-deep);
  text-decoration-thickness: 2px;
}

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

.band-navy :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--cream);
}

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

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: var(--space-1);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 28px;
  background: var(--navy);
  color: var(--cream);
  border-radius: 999px;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  color: var(--cream);
}

.container {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Pills */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  background: var(--navy);
  color: var(--cream);
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--navy);
  border-radius: 999px;
  cursor: pointer;
}

.pill:hover,
.pill:active {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  color: var(--cream);
}

.pill-secondary {
  background: transparent;
  color: var(--navy);
}

.pill-secondary:hover,
.pill-secondary:active {
  background: color-mix(in srgb, var(--navy) 10%, transparent);
  border-color: var(--navy-deep);
  color: var(--navy-deep);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
}

/* Header */

/* The header sits on the hero's dusk ground: the entry screen is one view. */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  border-bottom: 1px solid color-mix(in srgb, var(--cream) 30%, transparent);
}

.site-header :focus-visible {
  outline-color: var(--cream);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-1);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 500;
  color: var(--cream);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark:hover {
  color: var(--cream);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.nav-list {
  display: flex;
  gap: 0 var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-1);
  color: var(--cream);
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--cream);
  text-decoration: underline;
}

@media (max-width: 519px) {
  .wordmark {
    font-size: 17px;
  }

  .nav-list {
    gap: 0;
  }

  .nav-list a {
    padding-inline: 5px;
    font-size: 15px;
  }

  .nav-list li:last-child a {
    padding-right: 0;
  }
}

/* Hero: "Cover wall" on the dusk sky of "Even stars shine at dawn".
   Intro text beside a wall of four pieces in two justified rows (brick
   pattern). The ground is the one gradient on the site; hovering or focusing
   a tile cross-fades it to that piece's own colours (data-ground, set by
   js/gallery.js). Tiles open the enlarge view. */

@property --g1 {
  syntax: "<color>";
  inherits: false;
  initial-value: transparent;
}

@property --g2 {
  syntax: "<color>";
  inherits: false;
  initial-value: transparent;
}

.hero {
  --g1: var(--dusk-top);
  --g2: var(--dusk-bottom);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block:
    calc(var(--header-h) + clamp(var(--space-5), 5vw, var(--space-8)))
    calc(var(--scallop-depth) + clamp(var(--space-5), 5vw, var(--space-8)));
  background: linear-gradient(var(--g1), var(--g2));
  color: var(--cream);
  transition: --g1 600ms ease, --g2 600ms ease;
}

.hero[data-ground="dawn"] {
  --g1: var(--ground-dawn-top);
  --g2: var(--ground-dawn-bottom);
}

.hero[data-ground="flying"] {
  --g1: var(--ground-flying-top);
  --g2: var(--ground-flying-bottom);
}

.hero[data-ground="always"] {
  --g1: var(--ground-always-top);
  --g2: var(--ground-always-bottom);
}

.hero[data-ground="stars-fall"] {
  --g1: var(--ground-stars-fall-top);
  --g2: var(--ground-stars-fall-bottom);
}

/* Cream lobes rise into the dusk at the foot of the hero (the footer's
   scallop geometry), and the cream page carries on below. */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 2;
  height: calc(var(--scallop-depth) + 1px);
  background: var(--cream);
  -webkit-mask: radial-gradient(50% 100% at 50% 100%, var(--navy) 98%, transparent 100%) center bottom / var(--scallop-period) 100% repeat-x;
  mask: radial-gradient(50% 100% at 50% 100%, var(--navy) 98%, transparent 100%) center bottom / var(--scallop-period) 100% repeat-x;
  pointer-events: none;
}

.hero + .section {
  border-top: 0;
}

.hero :focus-visible {
  outline-color: var(--cream);
}

.hero-grid {
  display: grid;
  gap: var(--space-6);
}

/* "LauLuna-Art" is about 5 font-sizes wide: size it to its column. */
.hero-text {
  container-type: inline-size;
}

.hero-eyebrow {
  margin: 0 0 var(--space-2);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.hero h1 {
  margin: 0;
  font-size: min(8rem, 19.6cqi);
}

.hero-lede {
  max-width: 30rem;
  margin: var(--space-3) 0 0;
  font-size: 20px;
  font-weight: 300;
  line-height: 1.5;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-4);
  margin: var(--space-4) 0 0;
}

.hero .pill {
  background: var(--cream);
  color: var(--navy-deep);
  border-color: var(--cream);
}

.hero .pill:hover,
.hero .pill:active {
  background: color-mix(in srgb, var(--cream) 86%, var(--navy));
  border-color: color-mix(in srgb, var(--cream) 86%, var(--navy));
  color: var(--navy-deep);
}

.hero .text-link,
.hero .text-link:hover {
  color: var(--cream);
}

.hero-wall {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* flex-grow = aspect ratio (--r) on a zero basis: tiles in a row share one
   height, and both rows have the same ratio sum, so both rows match. */
.hero-tile {
  position: relative;
  flex: var(--r) 1 0;
  min-width: 0;
  display: block;
  margin: 0;
  padding: 0;
  background: none;
  color: var(--cream);
  font: inherit;
  text-align: left;
  border: 0;
  border-radius: var(--radius-tile);
  cursor: zoom-in;
}

.hero-tile img {
  width: 100%;
  border-radius: var(--radius-tile);
}

/* Captions sit under the image below 1000px and on touch screens. */
.hero-cap {
  display: block;
  padding-top: 10px;
  font-size: 15px;
  line-height: 1.35;
}

.hero-cap-title {
  display: block;
  font-weight: 500;
}

.hero-cap-date {
  display: block;
  font-weight: 300;
}

/* Stars: the motes of the painting, placed by js/gallery.js. */
.hero-sky {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.hero-star {
  position: absolute;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  background: var(--mote-light);
  border-radius: 50%;
  opacity: var(--o);
}

.hero-star.is-lilac {
  background: var(--mote-lilac);
}

/* Four-point sparkle, the shape she paints. */
.hero-star.is-sparkle {
  border-radius: 0;
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
}

@media (min-width: 1000px) {
  .hero {
    min-height: 100svh;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 58%;
    column-gap: var(--space-8);
    align-items: center;
  }
}

@media (hover: hover) and (min-width: 1000px) {
  .hero-cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: var(--space-1) var(--space-2) 10px;
    background: color-mix(in srgb, var(--navy-deep) 88%, transparent);
    border-radius: 0 0 var(--radius-tile) var(--radius-tile);
    opacity: 0;
    transition: opacity 150ms ease-out;
  }

  .hero-tile:hover .hero-cap,
  .hero-tile:focus-visible .hero-cap {
    opacity: 1;
  }
}

/* Phones: the two portraits pair up between the landscapes, so each caption
   has room under its image. */
@media (max-width: 599px) {
  .hero-wall {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3) 16px;
  }

  .hero-row {
    display: contents;
  }

  .hero-tile.is-wide {
    grid-column: 1 / -1;
  }
}

/* Entrance: the tiles rise 16px and fade in, 90ms apart. */
@media (prefers-reduced-motion: no-preference) {
  .hero-tile {
    animation: hero-rise 640ms cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--i, 0) * 90ms) both;
  }
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-cap {
    transition: none;
  }
}

.about-figure figcaption {
  margin-top: var(--space-2);
  color: var(--navy-soft);
  font-size: 16px;
  text-align: center;
}

/* Scalloped edge on the footer top: the lobe size for phones. */

@media (max-width: 599px) {
  :root {
    --scallop-period: 72px;
    --scallop-depth: 18px;
  }
}

/* Sections */

.section {
  padding-block: clamp(var(--space-8), 9vw, var(--space-15));
  border-top: 1px solid var(--navy);
}

.section-intro {
  max-width: 640px;
}

.band-navy {
  background: var(--navy);
  color: var(--cream);
  border-top-color: var(--navy);
}

.band-navy a {
  color: var(--cream);
}

.band-navy h2,
.band-navy .section-intro {
  text-align: center;
  margin-inline: auto;
}

.band-navy .section-intro {
  margin-bottom: var(--space-6);
}

/* About */

.about-grid {
  display: grid;
  gap: var(--space-6);
}

.about-heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.about-heading h2 {
  margin: 0;
}

.avatar {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.about-text p {
  max-width: 36rem;
}

.placeholder {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--cream-pale);
  color: var(--navy-soft);
  border: 1px dashed var(--navy-soft);
  border-radius: var(--radius-tile);
}

.about-figure {
  margin: 0;
}

.about-figure img {
  width: 100%;
  border-radius: var(--radius-tile);
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-8);
    align-items: start;
  }
}

/* Gallery: justified rows, each tile keeps its own aspect ratio.
   js/gallery.js reads column-gap from here and sets exact tile widths. */

.gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
}

.gallery::after {
  content: "";
  flex-grow: 1000000;
}

.gallery.is-justified::after {
  content: none;
}

.tile {
  position: relative;
  flex: var(--r, 1) 1 calc(var(--r, 1) * var(--row-h));
  display: block;
  margin: 0;
  padding: 0;
  background: color-mix(in srgb, var(--cream) 10%, transparent);
  color: var(--cream);
  font: inherit;
  text-align: left;
  border: 0;
  border-radius: var(--radius-tile);
  outline: 1px solid var(--cream);
  outline-offset: 4px;
  cursor: zoom-in;
}

.gallery.is-justified .tile {
  flex: none;
}

/* Focus has to differ from the resting 1px outline. */
.band-navy .tile:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 4px;
}

.tile img {
  width: 100%;
  border-radius: var(--radius-tile);
}

.tile-caption {
  display: block;
  padding: 10px 12px 12px;
  font-size: 16px;
  line-height: 1.35;
}

.tile-title {
  display: block;
}

.tile-date {
  display: block;
  font-weight: 300;
}

@media (hover: hover) and (min-width: 520px) {
  .tile-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: var(--space-1) var(--space-2) 10px;
    background: color-mix(in srgb, var(--navy) 88%, transparent);
    border-radius: 0 0 var(--radius-tile) var(--radius-tile);
    opacity: 0;
  }

  .tile:hover .tile-caption,
  .tile:focus-visible .tile-caption {
    opacity: 1;
  }
}

@media (max-width: 899px) {
  :root {
    --row-h: 180px;
  }
}

@media (max-width: 519px) {
  .tile {
    flex: 1 1 100%;
  }

  .gallery {
    gap: var(--space-5) 16px;
  }
}

/* Commissions */

.commissions-grid {
  display: grid;
  gap: 0;
}

.c-intro {
  max-width: 36rem;
}

.price-blocks {
  display: grid;
  gap: var(--space-5) var(--space-6);
  margin-block: var(--space-5) var(--space-4);
}

.price-block {
  padding-top: var(--space-3);
  border-top: 1px solid var(--navy);
}

.price-block h3 {
  margin-bottom: var(--space-1);
}

.price-block p {
  color: var(--navy-soft);
}

.price-block dl {
  margin: var(--space-2) 0 0;
}

.price-block dl > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--navy) 25%, transparent);
}

.price-block dt,
.price-block dd {
  margin: 0;
}

.price-block dd {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.c-note {
  margin-bottom: var(--space-6);
}

.c-terms {
  display: grid;
  gap: var(--space-4);
  padding-top: var(--space-5);
  border-top: 1px solid var(--navy);
}

.c-payment ul {
  padding-left: 1.2em;
}

.c-payment li + li {
  margin-top: var(--space-1);
}

.sheet-link {
  display: block;
  text-decoration: none;
}

.sheet {
  margin: 0;
}

.sheet img {
  width: 100%;
  border-radius: var(--radius-tile);
}

.sheet figcaption {
  margin-top: var(--space-2);
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.sheet-link:hover figcaption {
  color: var(--navy-deep);
  text-decoration-thickness: 2px;
}

.c-cta {
  margin: var(--space-5) 0 0;
}

@media (min-width: 640px) {
  .price-blocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .commissions-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    grid-template-rows: auto auto auto 1fr auto auto;
    column-gap: var(--space-8);
  }

  .c-head {
    grid-column: 1;
    grid-row: 1;
  }

  .c-intro {
    grid-column: 1;
    grid-row: 2;
  }

  .c-cta {
    grid-column: 1;
    grid-row: 3;
    margin-top: var(--space-2);
  }

  .price-blocks {
    grid-column: 2;
    grid-row: 1 / 5;
    margin-top: 0;
  }

  .c-note {
    grid-column: 2;
    grid-row: 5;
  }

  .c-terms {
    grid-column: 1 / -1;
    grid-row: 6;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: var(--space-8);
    align-items: start;
  }
}

/* Contact */

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* Footer */

.site-footer {
  position: relative;
  margin-top: var(--scallop-depth);
  padding-block: var(--space-6) var(--space-5);
  background: var(--navy);
  color: var(--cream);
}

.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  /* Overlaps the footer by 1px so no sub-pixel seam shows. */
  bottom: calc(100% - 1px);
  height: calc(var(--scallop-depth) + 1px);
  background: var(--navy);
  -webkit-mask: radial-gradient(50% 100% at 50% 100%, var(--navy) 98%, transparent 100%) center bottom / var(--scallop-period) 100% repeat-x;
  mask: radial-gradient(50% 100% at 50% 100%, var(--navy) 98%, transparent 100%) center bottom / var(--scallop-period) 100% repeat-x;
  pointer-events: none;
}

.site-footer a {
  color: var(--cream);
}

.site-footer .wordmark {
  color: var(--cream);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
  margin: var(--space-2) 0 0;
  padding: var(--space-2) 0 0;
  list-style: none;
  border-top: 1px solid color-mix(in srgb, var(--cream) 40%, transparent);
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.footer-copy {
  margin: var(--space-2) 0 0;
  font-size: 16px;
}

/* Enlarge view */

.viewer {
  width: fit-content;
  min-width: min(20rem, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: var(--space-2);
  background: var(--cream-pale);
  color: var(--navy);
  border: 0;
  border-radius: var(--radius-tile);
}

.viewer::backdrop {
  background: color-mix(in srgb, var(--navy) 85%, transparent);
}

.viewer[open],
.viewer[open]::backdrop {
  animation: viewer-fade 150ms ease-out;
}

@keyframes viewer-fade {
  from {
    opacity: 0;
  }
}

.viewer-figure {
  margin: 0;
}

.viewer-figure img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 13rem);
  max-height: calc(100dvh - 13rem);
  margin-inline: auto;
  border-radius: 8px;
}

.viewer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
}

.viewer-title {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.viewer-date {
  margin: 0;
  color: var(--navy-soft);
}

.viewer-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.viewer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

@media (max-width: 519px) {
  .viewer-figure img {
    max-height: calc(100vh - 18rem);
    max-height: calc(100dvh - 18rem);
  }

  .viewer .pill {
    padding: 0 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .viewer[open],
  .viewer[open]::backdrop {
    animation: none;
  }
}
