@layer components {
  /* ---------- Logo ---------- */

  .logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--bone);
  }

  .mark {
    width: 22px;
    height: 22px;
    flex: none;
  }

  .logo__word {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .logo--big .mark {
    width: 34px;
    height: 34px;
  }

  .logo--big .logo__word {
    font-size: 0.875rem;
  }

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

  .hdr {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    height: var(--header-h);
    background: rgb(13 13 12 / 0.86);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    transition: background-color 500ms var(--ease), border-color 500ms var(--ease);
    view-transition-name: site-header;
  }

  .hdr--over:not(.is-scrolled) {
    background: transparent;
    border-color: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .hdr__in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--margin);
  }

  .nav {
    display: none;
  }

  .nav__list {
    display: flex;
    gap: 2.75rem;
  }

  .nav__a {
    position: relative;
    display: inline-block;
    padding-block: 0.5rem;
    font-size: var(--fs-small);
    color: var(--bone);
  }

  .nav__a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.2rem;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 500ms var(--ease);
  }

  .nav__a:hover::after,
  .nav__a[aria-current="page"]::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  .menu-btn {
    min-height: 44px;
    padding-inline: 0.25rem;
    font-size: var(--fs-small);
    font-weight: 500;
  }

  @media (min-width: 900px) {
    .nav {
      display: block;
    }

    .hdr .menu-btn {
      display: none;
    }
  }

  /* ---------- Mobile menu ---------- */

  .menu {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    background: var(--ink-0);
    overflow-y: auto;
  }

  .menu[hidden] {
    display: none;
  }

  .menu__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: none;
    height: var(--header-h);
    padding-inline: var(--margin);
    border-bottom: 1px solid var(--line);
  }

  .menu__nav {
    flex: 1 0 auto;
    display: flex;
    align-items: flex-end;
    padding: var(--space-5) var(--margin) var(--space-4);
  }

  .menu__a {
    display: inline-block;
    font-family: var(--serif);
    font-size: clamp(3.5rem, 17vw, 6rem);
    line-height: 1;
    letter-spacing: -0.03em;
  }

  .menu__foot {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: var(--space-3) var(--margin) var(--space-4);
    border-top: 1px solid var(--line);
    font-size: var(--fs-small);
    color: var(--mute);
  }

  /* ---------- Links and buttons ---------- */

  .link {
    background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
    padding-bottom: 2px;
    transition: background-size 500ms var(--ease);
  }

  .link:hover {
    background-size: 0% 1px;
    background-position: right bottom;
  }

  .link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding-block: 0.5rem;
    font-size: var(--fs-small);
    font-weight: 500;
    border-bottom: 1px solid currentColor;
  }

  .link-arrow span {
    transition: transform 500ms var(--ease);
  }

  .link-arrow:hover span {
    transform: translateX(0.4rem);
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 2rem;
    background: var(--bone);
    color: var(--ink-0);
    font-size: var(--fs-small);
    font-weight: 500;
    transition: background-color 400ms var(--ease);
  }

  .btn:hover {
    background: var(--light);
  }

  /* ---------- Facts ---------- */

  .facts {
    display: grid;
    gap: var(--space-2);
  }

  .facts__row {
    display: grid;
    gap: 0.25rem;
  }

  .facts dd {
    font-size: var(--fs-small);
  }

  .facts--compact {
    grid-template-columns: 1fr 1fr;
    align-content: start;
  }

  .facts--bar {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3) var(--gutter);
    padding-block: var(--space-4);
  }

  @media (min-width: 900px) {
    .facts--bar {
      grid-template-columns: repeat(5, minmax(0, 1fr));
    }
  }

  /* ---------- Image hover ---------- */

  @media (hover: hover) {
    a:hover .media img {
      transform: scale(1.035);
    }
  }

  /* ---------- Drawings ---------- */

  .dwg {
    --dwg-bg: var(--paper);
    width: 100%;
    height: auto;
    overflow: visible;
    color: var(--paper-ink);
    fill: none;
    stroke: currentColor;
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .dwg .cut {
    stroke-width: 2.2;
  }

  .dwg .thin {
    stroke-width: 0.7;
  }

  .dwg .glass {
    stroke-width: 3;
    stroke: #8b8578;
  }

  .dwg .light {
    fill: #e2bb74;
    fill-opacity: 0.5;
    stroke: none;
  }

  .dwg .ray {
    stroke: #a8772f;
    stroke-width: 1;
    stroke-dasharray: 5 6;
  }

  .dwg .stone {
    stroke-width: 0.6;
    opacity: 0.7;
  }

  .dwg .lbl text {
    fill: var(--paper-mute);
    stroke: none;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  @media (max-width: 599px) {
    .dwg .lbl text {
      font-size: 26px;
    }
  }

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

  .ftr {
    padding-block: var(--space-6) var(--space-4);
    border-top: 1px solid var(--line);
  }

  .ftr__top {
    row-gap: var(--space-5);
  }

  .ftr__brand {
    display: grid;
    gap: var(--space-3);
    max-width: 22rem;
  }

  .ftr__nav ul {
    display: grid;
    gap: 0.5rem;
  }

  .ftr__nav a {
    font-family: var(--serif);
    font-size: 2rem;
    line-height: 1.1;
    transition: color 400ms var(--ease);
  }

  .ftr__nav a:hover {
    color: var(--mute);
  }

  .ftr__studios {
    display: grid;
    gap: 0.5rem;
    align-content: start;
  }

  .ftr__studios .serif {
    font-size: 1.5rem;
    margin-right: 0.5rem;
  }

  .ftr__studios .link {
    justify-self: start;
    margin-top: var(--space-2);
    font-size: var(--fs-small);
  }

  .ftr__legal {
    display: grid;
    gap: var(--space-1);
    margin-top: var(--space-6);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
    font-size: var(--fs-label);
    line-height: 1.6;
    color: var(--mute);
  }

  .ftr__legal p {
    max-width: 62rem;
  }

  @media (min-width: 600px) {
    .ftr__brand {
      grid-column: 1 / -1;
    }

    .ftr__nav {
      grid-column: 1 / 5;
    }

    .ftr__studios {
      grid-column: 5 / 9;
    }
  }

  @media (min-width: 900px) {
    .ftr__brand {
      grid-column: 1 / 6;
    }

    .ftr__nav {
      grid-column: 7 / 10;
    }

    .ftr__studios {
      grid-column: 10 / 13;
    }

    .ftr__legal {
      grid-template-columns: 12rem 1fr;
    }
  }
}

/* ---------- Ambient light ----------
   A fixed layer behind every page. The light moves with the scroll like the
   sun through a day (--p, 0 → 1, set by main.js) and breathes slowly on its
   own. Without motion it stays still, but the background is never flat. */

@layer components {
  .ambient {
    --p: 0;
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background:
      radial-gradient(90% 70% at 78% 8%, rgb(52 47 40 / 0.55), transparent 62%),
      radial-gradient(70% 60% at 10% 100%, rgb(36 33 29 / 0.5), transparent 70%),
      var(--ink-0);
  }

  .ambient > * {
    position: absolute;
    will-change: transform, opacity;
  }

  /* Blades of light, leaning at the angle of the brand blade. */
  .ambient__blade {
    top: -40%;
    height: 180%;
    background: linear-gradient(90deg,
      transparent 0%,
      rgb(244 236 220 / 0.05) 30%,
      rgb(244 236 220 / 0.11) 48%,
      rgb(244 236 220 / 0.11) 52%,
      rgb(244 236 220 / 0.05) 70%,
      transparent 100%);
    filter: blur(28px);
    transform: translate3d(calc(var(--p) * -38vw + var(--tx, 0px)), var(--ty, 0px), 0) rotate(var(--blade-angle));
    transition: transform 600ms var(--ease);
  }

  .ambient__blade--a {
    left: 58%;
    width: 26vw;
    animation: ambient-breathe 11s ease-in-out infinite alternate;
  }

  .ambient__blade--b {
    left: 18%;
    width: 9vw;
    opacity: 0.7;
    transform: translate3d(calc(var(--p) * -22vw + var(--tx, 0px) * 0.6), calc(var(--ty, 0px) * 0.6), 0) rotate(var(--blade-angle));
    animation: ambient-breathe 7s ease-in-out -3s infinite alternate;
  }

  /* Sun through a timber louvre screen, thrown onto the wall: seven slats of
     light of different widths. Their ends dissolve, so the figure reads as
     light, not as a shape. As the page scrolls the light slides across and
     the slats lengthen, like late-afternoon sun. */
  .ambient__louvre {
    top: 8vh;
    right: 4vw;
    display: flex;
    gap: 2.2vw;
    width: clamp(260px, 34vw, 620px);
    height: 78vh;
    filter: blur(4px);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 70%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 70%, transparent 100%);
    transform-origin: 50% 0%;
    transform:
      translate3d(calc(var(--p) * -48vw + var(--tx, 0px) * 1.6), calc(var(--p) * 12vh + var(--ty, 0px)), 0)
      skewX(calc(var(--blade-angle) * -1))
      scaleY(calc(1 + var(--p) * 0.3));
  }

  .ambient__louvre span {
    flex: 0 0 var(--w);
    background: linear-gradient(180deg, rgb(244 236 220 / 0.03), rgb(244 236 220 / 0.085) 55%, rgb(244 236 220 / 0.04));
  }

  .ambient__louvre span:nth-child(1) { --w: 4%; }
  .ambient__louvre span:nth-child(2) { --w: 9%; }
  .ambient__louvre span:nth-child(3) { --w: 5%; }
  .ambient__louvre span:nth-child(4) { --w: 12%; }
  .ambient__louvre span:nth-child(5) { --w: 6%; }
  .ambient__louvre span:nth-child(6) { --w: 9%; }
  .ambient__louvre span:nth-child(7) { --w: 3%; }

  /* A soft light that follows the pointer, like a lamp carried through a dark room. */
  .ambient__glow {
    top: 0;
    left: 0;
    width: 900px;
    height: 900px;
    margin: -450px 0 0 -450px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgb(244 236 220 / 0.07), transparent);
    opacity: 0;
    transition: opacity 1200ms var(--ease);
    transform: translate3d(var(--mx, 50vw), var(--my, 40vh), 0);
  }

  .ambient.is-lit .ambient__glow {
    opacity: 1;
  }

  @keyframes ambient-breathe {
    from {
      opacity: 0.55;
    }

    to {
      opacity: 1;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .ambient > * {
      animation: none !important;
    }
  }

  @media (max-width: 899px) {
    .ambient__blade--a {
      left: 40%;
      width: 60vw;
    }

    .ambient__blade--b {
      width: 18vw;
    }

    .ambient__louvre {
      top: 18vh;
      right: -14vw;
      width: 84vw;
      height: 70vh;
    }
  }
}
