/* ==========================================================================
   S.J.PEY Landscapes — homepage concept
   base.css · tokens, reset, typography, small shared pieces
   ========================================================================== */

@font-face {
  font-family: "Rufina";
  src: url("../assets/fonts/rufina-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Rufina";
  src: url("../assets/fonts/rufina-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geologica";
  src: url("../assets/fonts/geologica-300-700.woff2") format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
}

:root {
  /* Palette — taken from the work: aubergine foliage, lime-render and sawn
     stone, and the red-brown of the hardwood arbours. Deliberately not green. */
  --damson:     #23111b;   /* the bed: deep aubergine-black            */
  --damson-2:   #2f1a27;   /* raised dark slab                         */
  --pool:       #160a11;   /* black water                              */
  --plaster:    #e8dfd5;   /* the paper: warm render / sawn stone      */
  --plaster-2:  #d8cdc1;   /* a tone down: slabs and joints on light   */
  --bone:       #f3eee7;   /* highlight                                */
  --sapele:     #a83a1d;   /* hardwood red-brown (accent on light)     */
  --sapele-lt:  #e47d54;   /* the same, lifted for use on dark         */
  --slate:      #5e545b;   /* secondary text on light                  */
  --mist:       #cbbfb6;   /* secondary text on dark                   */
  --rule-l:     rgba(35, 17, 27, .22);
  --rule-d:     rgba(232, 223, 213, .22);

  /* The joint and the frame: the only gutters on the site */
  --j:  5px;
  --m:  clamp(10px, 1.45vw, 24px);
  --hh: 58px;                    /* header height */

  --serif: "Rufina", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans:  "Geologica", "Helvetica Neue", Arial, sans-serif;

  --ease:  cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.65, 0, .25, 1);

  /* Sawn-stone grain, drawn once and reused as a texture */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n' x='0' y='0'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hh) + 8px);
  background: var(--damson);
}

body {
  font: 340 15.5px/1.65 var(--sans);
  color: var(--damson);
  background: var(--plaster);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }

::selection { background: var(--sapele); color: var(--bone); }

:focus-visible {
  outline: 2px solid var(--sapele);
  outline-offset: 3px;
}
.on-dark :focus-visible, .top :focus-visible, .pool :focus-visible, .viewer :focus-visible { outline-color: var(--sapele-lt); }

.skip {
  position: fixed; left: var(--m); top: -60px; z-index: 200;
  background: var(--plaster); color: var(--damson);
  padding: 10px 14px; text-decoration: none; font-weight: 500;
}
.skip:focus { top: 10px; }

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

/* ---- Type ---------------------------------------------------------------- */

.label {
  display: inline-flex; align-items: center; gap: .85em;
  font: 500 11.5px/1 var(--sans);
  letter-spacing: .17em; text-transform: uppercase;
}
.label::before {                       /* the survey peg */
  content: ""; width: 7px; height: 7px; flex: none;
  background: var(--sapele);
}
.on-dark .label::before { background: var(--sapele-lt); }

.display {
  font-family: var(--serif); font-weight: 400;
  letter-spacing: -.012em; line-height: 1.1;
}

/* The wordmark: the full stops of S.J.PEY become small square pegs */
.mark { text-decoration: none; display: inline-block; line-height: 1; }
.mark__name { font-family: var(--serif); font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.mark__name i {
  display: inline-block; width: .15em; height: .15em;
  margin: 0 .075em 0 .06em; background: var(--sapele);
  vertical-align: baseline; transform: translateY(0);
}
.on-dark .mark__name i, .top .mark__name i, .pool .mark__name i { background: var(--sapele-lt); }
.mark__sub { font-family: var(--serif); font-weight: 400; display: block; }

/* Underline that draws in from the left */
.link {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 5px;
  transition: background-size .5s var(--ease);
}
.link:hover, .link:focus-visible { background-size: 0 1px; background-position: 100% 100%; }
.link--arrow::after {
  content: ""; display: inline-block; width: .62em; height: .62em; margin-left: .7em;
  border-top: 1px solid currentColor; border-right: 1px solid currentColor;
  transform: translateY(-.08em) rotate(45deg);
  transition: transform .5s var(--ease);
}
.link--down::after { transform: translateY(-.2em) rotate(135deg); }
.link--arrow:hover::after { transform: translate(.2em, -.08em) rotate(45deg); }
.link--down:hover::after { transform: translateY(0) rotate(135deg); }

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