/* ==========================================================================
   Whytelight — base
   Reset, element defaults, fonts, the camera cursor.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------
   Self-hosted. The design loaded these from Google; serving them ourselves
   keeps the site off a third-party CDN, which is the simpler position for a UK
   client under GDPR, and removes a connection from the critical path.

   If assets/fonts/ is empty these rules are inert and the stacks in tokens.css
   fall through to Georgia and system-ui, which is a legible degradation rather
   than a broken one.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-garamond-light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-garamond-light-italic.woff2') format('woff2');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-garamond-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-garamond-semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans-variable.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --- Reset ------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--c-white);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.55;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;

  /* The home page carousel and the collection cards both overflow sideways
     during animation. `clip` contains them without creating a scroll container,
     which `hidden` would and which breaks position: sticky. */
  overflow-x: clip;
}

/* Stop the page shifting sideways when the basket or menu locks scrolling. */
body.wl-locked {
  overflow: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  text-align: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
  font-family: var(--f-display);
  font-weight: var(--fw-display);
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-wrap: balance;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

/* --- Links ------------------------------------------------------------- */

a {
  color: var(--a-link);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  color: var(--a-link-hover);
  text-decoration: underline;
}

/* Links inside dark bands and photographs invert. */
.wl-on-dark a {
  color: var(--c-sand);
}

.wl-on-dark a:hover {
  color: var(--a-warm);
}

/* --- Focus ------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--a-base);
  outline-offset: 2px;
}

/* Never remove the ring without replacing it — on dark it just changes colour. */
.wl-on-dark :focus-visible {
  outline-color: var(--a-warm);
}

::selection {
  background: var(--a-select);
}

/* --- Skip link --------------------------------------------------------- */

.wl-skip {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -110%);
  z-index: calc(var(--z-shutter) + 1);
  background: var(--c-ink);
  color: var(--c-white);
  padding: 0.75rem 1.25rem;
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  transition: transform var(--dur-fast) var(--ease-out);
}

.wl-skip:focus {
  transform: translate(-50%, 0);
  color: var(--c-white);
  text-decoration: none;
}

/* --- Screen-reader only ------------------------------------------------ */

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  position: static !important;
  width: auto;
  height: auto;
  clip-path: none;
  white-space: normal;
}

/* --- The camera cursor -------------------------------------------------
   A 32px camera outline with a white halo so it reads on both dark
   photographs and white paper. The accent version, with a lit aperture, is
   used on anything clickable.

   Scoped to a pointer device: on a touch screen a custom cursor is invisible
   and only costs a decode, and inside the block editor it fights the editing
   UI. Text inputs keep the I-beam, because a camera over a text field tells
   the user the wrong thing about what will happen.
   -------------------------------------------------------------------------- */

@media (hover: hover) and (pointer: fine) {

  body.wl,
  body.wl * {
    cursor:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' shape-rendering='geometricPrecision'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'%3E%3Crect x='3.5' y='9.5' width='25' height='17' rx='2'/%3E%3Cpath d='M10.5 9.5l2-3h7l2 3'/%3E%3Ccircle cx='16' cy='18' r='5'/%3E%3C/g%3E%3Cg fill='none' stroke='%23201e1d' stroke-width='1.25' stroke-linejoin='round' stroke-linecap='round'%3E%3Crect x='3.5' y='9.5' width='25' height='17' rx='2'/%3E%3Cpath d='M10.5 9.5l2-3h7l2 3'/%3E%3Ccircle cx='16' cy='18' r='5'/%3E%3Ccircle cx='16' cy='18' r='2.25'/%3E%3Cpath d='M23.5 13.5h2.5'/%3E%3C/g%3E%3C/svg%3E") 16 18,
      auto;
  }

  body.wl a,
  body.wl button,
  body.wl summary,
  body.wl label,
  body.wl [role="button"] {
    cursor:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' shape-rendering='geometricPrecision'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'%3E%3Crect x='3.5' y='9.5' width='25' height='17' rx='2'/%3E%3Cpath d='M10.5 9.5l2-3h7l2 3'/%3E%3Ccircle cx='16' cy='18' r='5'/%3E%3C/g%3E%3Cg fill='none' stroke='%23c67139' stroke-width='1.25' stroke-linejoin='round' stroke-linecap='round'%3E%3Crect x='3.5' y='9.5' width='25' height='17' rx='2'/%3E%3Cpath d='M10.5 9.5l2-3h7l2 3'/%3E%3Ccircle cx='16' cy='18' r='5'/%3E%3Ccircle cx='16' cy='18' r='2.25' fill='%23c67139'/%3E%3Cpath d='M23.5 13.5h2.5'/%3E%3C/g%3E%3C/svg%3E") 16 18,
      pointer;
  }

  body.wl input,
  body.wl textarea,
  body.wl select,
  body.wl [contenteditable] {
    cursor: auto;
  }

  body.wl input[type="text"],
  body.wl input[type="email"],
  body.wl input[type="search"],
  body.wl input[type="tel"],
  body.wl input[type="number"],
  body.wl textarea {
    cursor: text;
  }

  /* Never over the admin bar — that is WordPress's UI, not the site's. */
  body.wl #wpadminbar,
  body.wl #wpadminbar * {
    cursor: auto;
  }

  body.wl #wpadminbar a {
    cursor: pointer;
  }
}

/* --- Click flash -------------------------------------------------------
   A small burst from the cursor's flash unit on click. Injected by site.js and
   removed on animation end.
   -------------------------------------------------------------------------- */

.wl-flash {
  position: fixed;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  pointer-events: none;
  z-index: var(--z-flash);
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 246, 220, 0.85) 35%,
    rgba(255, 246, 220, 0) 72%
  );
  box-shadow: 0 0 14px 4px rgba(255, 240, 200, 0.5);
  animation: wl-flash-burst 0.32s ease-out forwards;
}

/* --- Keyframes ---------------------------------------------------------- */

@keyframes wl-rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

@keyframes wl-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes wl-page {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

@keyframes wl-cue {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
  50%      { opacity: 1;   transform: scaleY(1); }
}

@keyframes wl-flash-burst {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.3); }
  35%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
}

/* Reduced motion: hold the end state rather than animating to it. Opacity is
   the thing that matters — an element that animates in must not stay at 0. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .wl-flash { display: none; }
}
