/**
 * web-premium design floor.
 *
 * Tokens, a spacing and type scale, the reveal states the engine toggles, and
 * the hero plane mechanics. Theme by overriding the tokens in your page; do not
 * edit this file per project. Every component beyond this is yours to write,
 * because a page assembled from a component library looks like one.
 *
 * Read references/taste.md before writing markup against this.
 */

/* ============================================================== tokens ===
 * Override these six colours and two faces in the page and the whole floor
 * re-themes. Everything below is expressed in terms of them.
 */
:root {
  --wp-canvas: #0b0a09;
  --wp-surface: #15130f;
  --wp-ink: #f4efe7;
  --wp-ink-soft: #9c9489;
  --wp-accent: #d8562f;
  --wp-accent-ink: #120e0c;

  --wp-font-display: system-ui, sans-serif;
  --wp-font-text: system-ui, sans-serif;

  /* One ratio, applied everywhere. Spacing that does not come off a scale is
   * what "almost right" looks like. */
  --wp-s1: 0.5rem;
  --wp-s2: 0.75rem;
  --wp-s3: 1rem;
  --wp-s4: 1.5rem;
  --wp-s5: 2.5rem;
  --wp-s6: 4rem;
  --wp-s7: 6rem;
  --wp-s8: 9rem;

  /* Section rhythm. Premium reads as air; this is where most of it lives. */
  --wp-section-y: clamp(4.5rem, 9vw, 9rem);
  --wp-gutter: clamp(1.25rem, 5vw, 4rem);
  --wp-measure: 62ch;
  --wp-max: 78rem;

  --wp-radius: 2px;
  --wp-hairline: 1px solid color-mix(in oklab, var(--wp-ink) 14%, transparent);

  /* One duration and one curve for everything that is not the hero. Motion
   * that varies per element reads as several sites fighting. */
  --wp-dur: 620ms;
  --wp-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================== reset ===
 * Short on purpose. A heavy reset fights the cascade you then have to rebuild.
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--wp-canvas);
  color: var(--wp-ink);
  font-family: var(--wp-font-text);
  font-size: clamp(1rem, 0.35vw + 0.95rem, 1.0625rem);
  line-height: 1.65;
  /* Optical, not decorative: kerning and ligatures off is how browser-default
   * type announces itself. */
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  /* A long page with any full-bleed plane will overflow sideways on some phone
   * eventually. Clip it here rather than hunting it per section. */
  overflow-x: clip;
}

img, video, svg, canvas { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* Focus is not optional and is not the UA default ring on a dark canvas. */
:focus-visible {
  outline: 2px solid var(--wp-accent);
  outline-offset: 3px;
  border-radius: var(--wp-radius);
}

/* ============================================================ type scale ===
 * Display faces get tighter tracking and leading as they get bigger, because
 * the metrics a face is drawn for at 16px are wrong at 96px.
 */
h1, h2, h3, h4, .wp-display {
  font-family: var(--wp-font-display);
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}
h1, .wp-h1 { font-size: clamp(2.5rem, 6.2vw, 5.25rem); line-height: 0.98; letter-spacing: -0.03em; }
h2, .wp-h2 { font-size: clamp(1.9rem, 3.8vw, 3.1rem);  line-height: 1.06; letter-spacing: -0.02em; }
h3, .wp-h3 { font-size: clamp(1.25rem, 1.8vw, 1.6rem); line-height: 1.2;  letter-spacing: -0.01em; }

p, li { max-width: var(--wp-measure); text-wrap: pretty; }
p { margin: 0 0 var(--wp-s3); }

.wp-lead { font-size: clamp(1.1rem, 1.3vw, 1.35rem); line-height: 1.5; color: var(--wp-ink); }
.wp-soft { color: var(--wp-ink-soft); }

/* An eyebrow is a tool, not a section header prefix. At most one per three
 * sections; taste.md says why. */
.wp-eyebrow {
  font-family: var(--wp-font-text);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wp-ink-soft);
}

/* ============================================================== layout ===
 * Two containers and a section. Anything more specific is page work.
 */
.wp-wrap {
  width: 100%;
  max-width: var(--wp-max);
  margin-inline: auto;
  padding-inline: var(--wp-gutter);
}
.wp-section { padding-block: var(--wp-section-y); }
.wp-section--tight { padding-block: calc(var(--wp-section-y) * 0.55); }
.wp-section--flush { padding-block: 0; }
.wp-rule { border-top: var(--wp-hairline); }

/* Column sets. `auto-fit` collapses without a media query, which matters because
 * the breakpoint that suits three cards is not the one that suits four. */
.wp-cols {
  display: grid;
  gap: var(--wp-s5) var(--wp-s4);
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
}
.wp-split {
  display: grid;
  gap: var(--wp-s6) var(--wp-s5);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 60rem) {
  .wp-split { grid-template-columns: 1fr 1fr; }
  .wp-split--wide-left  { grid-template-columns: 1.35fr 1fr; }
  .wp-split--wide-right { grid-template-columns: 1fr 1.35fr; }
}

/* ============================================================== reveal ===
 * The engine adds `.wp-in`. Everything here is transform and opacity only:
 * animating width, height, top or left costs a layout per frame and is visible
 * as jank on a mid-range phone.
 *
 * `will-change` is deliberately absent. Set on dozens of elements it costs more
 * in compositor memory than it saves, and these transitions are cheap.
 */
[data-wp-reveal] {
  opacity: 0;
  transition: opacity var(--wp-dur) var(--wp-ease), transform var(--wp-dur) var(--wp-ease),
              -webkit-mask-size var(--wp-dur) var(--wp-ease),
              mask-size var(--wp-dur) var(--wp-ease);
}
[data-wp-reveal=""], [data-wp-reveal="up"] { transform: translate3d(0, 18px, 0); }
[data-wp-reveal="fade"]  { transform: none; }
[data-wp-reveal="scale"] { transform: scale(1.03); }

/* The wipe uses a MASK, not `clip-path`, and the difference is load-bearing.
 * An element clipped to `inset(0 0 100% 0)` has a layout box but a zero-area
 * intersection rect, so IntersectionObserver reports isIntersecting: false at
 * threshold 0 and the reveal can never fire: the element clips itself out of
 * the observer's view forever. Masking does not affect intersection geometry.
 */
[data-wp-reveal="mask"] {
  opacity: 1;
  transform: none;
  -webkit-mask-image: linear-gradient(#000, #000);
          mask-image: linear-gradient(#000, #000);
  -webkit-mask-repeat: no-repeat;  mask-repeat: no-repeat;
  -webkit-mask-position: top;      mask-position: top;
  -webkit-mask-size: 100% 0%;      mask-size: 100% 0%;
}

[data-wp-reveal].wp-in {
  opacity: 1;
  transform: none;
}
[data-wp-reveal="mask"].wp-in {
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
}

/* Reduced motion: visible, instantly, with no transition to interrupt. */
@media (prefers-reduced-motion: reduce) {
  [data-wp-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  [data-wp-reveal="mask"] {
    -webkit-mask-image: none !important;
            mask-image: none !important;
  }
}

/* ================================================================ hero ===
 * The planes. Depth comes from the composition: real occlusion, a shared
 * contact anchor, and separation you can see in a still frame. The movement
 * only confirms depth that is already there. Read references/hero-depth.md.
 */
[data-wp-hero] {
  position: relative;
  isolation: isolate;
  overflow: clip;           /* not `hidden`: clip does not create a scroll port */
}
[data-wp-plane] {
  transform: translate3d(0, var(--wp-plane, 0px), 0);
  /* No transition. This tracks scroll, and a transition on a scroll-driven
   * transform lags behind the pointer by exactly its duration. */
  backface-visibility: hidden;
}
/* Full-bleed planes need bleed on the asset, not travel on the element.
 * 106% with the overflow above absorbs the capped travel without a gap. */
.wp-plane-bleed {
  position: absolute;
  inset: -3% 0;
  width: 100%;
  height: 106%;
  object-fit: cover;
  z-index: 0;
}
.wp-hero-copy { position: relative; z-index: 2; }

/* A scrim ONLY where the text sits. A full-frame overlay to fix contrast flattens
 * the image you paid to generate, and it is the single most common way a
 * dimensional hero turns into a grey rectangle. */
.wp-scrim {
  position: absolute;
  inset: auto 0 0 0;
  height: 62%;
  z-index: 1;
  background: linear-gradient(to top,
    color-mix(in oklab, var(--wp-canvas) 88%, transparent) 0%,
    color-mix(in oklab, var(--wp-canvas) 55%, transparent) 42%,
    transparent 100%);
  pointer-events: none;
}

/* ================================================================= nav ===
 * The engine sets `html.wp-scrolled`. The chrome changes once, at the top.
 */
.wp-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wp-s4);
  padding: var(--wp-s3) var(--wp-gutter);
  transition: background-color 300ms var(--wp-ease), border-color 300ms var(--wp-ease);
  border-bottom: 1px solid transparent;
}
.wp-scrolled .wp-nav {
  background: color-mix(in oklab, var(--wp-canvas) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom-color: color-mix(in oklab, var(--wp-ink) 10%, transparent);
}

/* ============================================================== surface ===
 * One card and one button. Both deliberately plain, because a premium page
 * gets its quality from spacing and type, not from component chrome.
 */
.wp-card {
  background: var(--wp-surface);
  border: var(--wp-hairline);
  border-radius: var(--wp-radius);
  padding: var(--wp-s5);
}

.wp-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--wp-s2);
  /* 48px minimum on the cross axis. A 36px tap target fails on a phone and the
   * failure looks like "the site is broken", not "the button is small". */
  min-height: 48px;
  padding: 0 var(--wp-s4);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--wp-accent);
  border-radius: var(--wp-radius);
  background: var(--wp-accent);
  color: var(--wp-accent-ink);
  cursor: pointer;
  transition: transform 180ms var(--wp-ease), background-color 180ms var(--wp-ease);
}
.wp-btn:hover { transform: translateY(-1px); }
.wp-btn:active { transform: translateY(0); }
.wp-btn--ghost {
  background: transparent;
  color: var(--wp-ink);
  border-color: color-mix(in oklab, var(--wp-ink) 28%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .wp-btn, .wp-btn:hover { transform: none; transition: none; }
}

/* Link underline that sits off the baseline instead of through the descenders. */
.wp-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in oklab, currentColor 40%, transparent);
}
.wp-link:hover { text-decoration-color: currentColor; }

/* ================================================================== a11y ===*/
.wp-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.wp-skip {
  position: absolute; left: var(--wp-gutter); top: -100%;
  z-index: 100; padding: var(--wp-s2) var(--wp-s3);
  background: var(--wp-accent); color: var(--wp-accent-ink);
}
.wp-skip:focus { top: var(--wp-s2); }
