/* base.css — Velvet Fig: reset, primitives, chrome.
   Sections live in site.css. Colour lives in tokens.css. */

/* ------------------------------------------------------------------ reset */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  background: var(--plum);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-0);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-head);
  letter-spacing: -0.012em;
  margin: 0 0 var(--sp-3);
  text-wrap: balance;
}
h1 { font-size: var(--fs-4); letter-spacing: -0.022em; }
h2 { font-size: var(--fs-3); letter-spacing: -0.016em; }
h3 { font-size: var(--fs-2); }
em { font-style: italic; }
p { margin: 0 0 var(--sp-3); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }
b, strong { font-weight: 600; }

::selection { background: var(--brass); color: var(--plum-ink); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--brass); color: var(--plum-ink);
  padding: 0.85rem 1.3rem; font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }

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

/* ------------------------------------------------------------------ layout */

.container { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.container--narrow { --maxw: 900px; }

.section { padding-block: var(--section-y); position: relative; }
.section--tint { background: var(--plum-2); }
.section--deep { background: var(--plum-3); }
.section--ruled { border-top: 1px solid var(--hair-soft); }

.split { display: grid; gap: var(--sp-5); align-items: start; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 4.5rem); }
  .split--flip > :first-child { order: 2; }
  .split--wide-left { grid-template-columns: 1.15fr 0.85fr; }
  .split--wide-right { grid-template-columns: 0.85fr 1.15fr; }
  .split--center { align-items: center; }
}

.stack > * + * { margin-top: var(--sp-3); }

.sec-head { max-width: 42rem; margin-bottom: clamp(2rem, 4.5vw, 3.25rem); }
.sec-head > :last-child { margin-bottom: 0; }
.sec-head .lead { margin-top: var(--sp-3); }

/* The shelf label: small caps with a brass rule running out beside it — the
   apothecary label the room was built out of. */
.label { display: flex; align-items: center; gap: 1rem; margin: 0 0 var(--sp-3); max-width: none; }
.label::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--hair-brass); }
.label span {
  font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--brass); white-space: nowrap;
}
.label--short::after { flex: 0 0 3.5rem; }

.lead { font-size: var(--fs-1); line-height: 1.55; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 52px; padding: 0.85rem 1.6rem;
  border: 1px solid transparent; border-radius: var(--r);
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.02em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn--primary { background: var(--brass); color: var(--plum-ink); border-color: var(--brass); }
.btn--primary:hover, .btn--primary:focus-visible { background: var(--brass-lift); border-color: var(--brass-lift); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--hair-btn); }
.btn--ghost:hover, .btn--ghost:focus-visible { border-color: var(--ink); background: rgba(243, 239, 242, 0.08); transform: translateY(-1px); }
.btn--lg { min-height: 58px; padding: 1rem 2rem; font-size: 0.98rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin-top: var(--sp-4); }
@media (max-width: 560px) {
  .btn-row { gap: var(--sp-2); }
  .btn-row > .btn { width: 100%; }
}

.link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 600; font-size: var(--fs-sm); text-decoration: none; color: var(--brass);
  padding-bottom: 3px;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 1px;
  transition: background-size var(--dur) var(--ease), color var(--dur) var(--ease);
}
.link:hover { color: var(--brass-lift); background-size: 100% 2px; }
.arw { display: inline-block; transition: transform var(--dur) var(--ease); }
.link:hover .arw { transform: translateX(3px); }

/* ------------------------------------------------------------------ media */

.media { overflow: hidden; background: var(--plum-3); border-radius: var(--r-lg); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.r-3-2 { aspect-ratio: 3 / 2; }
.r-4-3 { aspect-ratio: 4 / 3; }
.r-3-4 { aspect-ratio: 3 / 4; }
.r-4-5 { aspect-ratio: 4 / 5; }
.figcap {
  margin-top: 0.8rem; font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted);
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--plum) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
@supports not (backdrop-filter: blur(1px)) { .site-header { background: var(--plum); } }
.site-header.is-stuck { border-bottom-color: var(--hair-brass); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); min-height: var(--header-h);
}

.brand {
  font-family: var(--font-display); font-weight: 600; font-size: 1.3rem;
  letter-spacing: 0.01em; text-decoration: none; color: var(--ink); padding-block: 0.4rem;
}
.brand em { font-style: italic; color: var(--brass); }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 1.8rem); }
.nav a:not(.btn) {
  position: relative; text-decoration: none; font-weight: 500; font-size: 0.93rem;
  color: var(--muted); padding-block: 0.6rem; transition: color var(--dur) var(--ease);
}
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.15rem; height: 1px;
  background: var(--brass); transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav a:not(.btn):hover { color: var(--ink); }
.nav a:not(.btn):hover::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--brass); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav .btn { min-height: 44px; padding: 0.6rem 1.15rem; font-size: 0.86rem; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--hair-btn); border-radius: var(--r);
  width: 46px; height: 44px; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink);
}
.nav-toggle:hover { border-color: var(--brass); color: var(--brass); }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--plum-3); border-bottom: 1px solid var(--hair-brass);
    padding: var(--sp-2) var(--gutter) var(--sp-4);
    box-shadow: 0 24px 40px -26px rgba(0, 0, 0, 0.9);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding: 0.95rem 0; border-bottom: 1px solid var(--hair-soft); font-size: 1.05rem; }
  .nav a:not(.btn)::after { display: none; }
  .nav .btn { margin-top: var(--sp-3); width: 100%; min-height: 52px; font-size: 0.95rem; }
}

/* ------------------------------------------------------------------ footer */

.site-footer {
  background: var(--plum-3); border-top: 1px solid var(--hair-brass);
  padding-block: var(--sp-5) var(--sp-4);
  color: var(--muted); font-size: var(--fs-sm);
}
.site-footer .container { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.site-footer p { max-width: 34ch; margin-bottom: var(--sp-2); }
.site-footer a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--hair); }
.site-footer a:hover { color: var(--brass); border-bottom-color: var(--brass); }
.site-footer .brand { font-size: 1.1rem; display: inline-block; margin-bottom: var(--sp-2); border: 0; color: var(--ink); }
.footer-h {
  font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: var(--track-label); text-transform: uppercase; color: var(--brass); margin: 0 0 var(--sp-2);
}
.footer-links { display: grid; gap: 0.45rem; justify-items: start; }
.site-footer .demo {
  grid-column: 1 / -1; border-top: 1px solid var(--hair-soft);
  padding-top: var(--sp-3); margin: var(--sp-2) 0 0; max-width: none; font-size: 0.76rem;
}

/* ------------------------------------------------------------------ reveal */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
