/* ==========================================================================
   Lykkehaven — base reset + typography baseline
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background-color: var(--bg-current);
  color: var(--spruce);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-weight: 400;
  letter-spacing: var(--tracking-body);
  transition: background-color var(--dur-bg) var(--ease);
  font-feature-settings: "ss01", "cv11";
}

/* The page lives inside a body that breathes between cedar and beeswax. */
body[data-bg="cedar"]   { --bg-current: var(--cedar); }
body[data-bg="beeswax"] { --bg-current: var(--beeswax); color: var(--bark); }

img, svg, picture, video {
  display: block;
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--spruce);
  font-weight: 300;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  margin: 0 0 var(--space-5);
  font-variation-settings: "opsz" 144, "SOFT" 50;
}

h1 {
  font-size: var(--fs-4xl);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

h2 {
  font-size: var(--fs-3xl);
  font-weight: 300;
  line-height: 1.08;
}

h3 {
  font-size: var(--fs-xl);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.005em;
  font-variation-settings: "opsz" 36, "SOFT" 50;
}

h4 {
  font-size: var(--fs-lg);
  font-weight: 400;
  line-height: 1.25;
  font-variation-settings: "opsz" 24, "SOFT" 50;
}

p {
  margin: 0 0 var(--space-5);
  max-width: var(--measure);
  font-size: var(--fs-md);
  line-height: var(--lh-base);
}

p + p { margin-top: calc(var(--space-5) * -0.25); }

a {
  color: var(--spruce);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-quick) var(--ease),
              border-color var(--dur-quick) var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--lingon);
}

a:focus-visible {
  outline: 2px solid var(--spruce);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Body text gets a hairline underline on hover */
.prose a {
  border-bottom-color: var(--spruce-40);
}
.prose a:hover {
  border-bottom-color: var(--lingon);
}

ul, ol {
  padding-left: 1.25rem;
  margin: 0 0 var(--space-5);
  max-width: var(--measure);
}

li {
  margin-bottom: var(--space-3);
  line-height: var(--lh-base);
  font-size: var(--fs-md);
}

ul li::marker { color: var(--mist); content: "—  "; }
ul { list-style: none; padding-left: 0; }
ul li { padding-left: 1.5rem; position: relative; }
ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 0.75rem;
  height: 1px;
  background: var(--mist);
}

strong, b {
  font-weight: 500;
  color: inherit;
}

em { font-style: italic; }

hr {
  border: 0;
  height: 1px;
  background: var(--spruce-20);
  margin: var(--space-8) 0;
  max-width: 4rem;
}

::selection {
  background: var(--spruce);
  color: var(--cedar);
}

/* Smallcaps mark — used in the wordmark sub-line and section eyebrows */
.smallcaps {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: var(--tracking-smallcaps);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--spruce);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--spruce);
  color: var(--cedar);
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-sm);
  letter-spacing: var(--tracking-smallcaps);
  text-transform: uppercase;
}
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}

/* Foreign-language word, used inline. Subtle italic, never decorated. */
.lang {
  font-style: italic;
  font-family: var(--font-display);
  font-weight: 400;
}

/* Pull quote — Fraunces, inline, no decorative quote marks. */
blockquote {
  margin: var(--space-8) 0;
  padding: 0;
  border: 0;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 300;
  font-style: italic;
  line-height: 1.25;
  color: var(--spruce);
  letter-spacing: -0.005em;
  max-width: 32ch;
  font-variation-settings: "opsz" 72, "SOFT" 50;
}

blockquote p { font-size: inherit; line-height: inherit; margin: 0; max-width: none; }

/* Helpers */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
