/* ================================================
   Base styles
   ================================================ */

/* ================================================
   Local font faces
   ================================================ */

/* Bundled line metrics match native Helvetica Neue; preserve them on replacement. */

@font-face {
  font-family: "Helvetica Neue LT Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/HelveticaNeueLTPro-Roman.woff2") format("woff2");
}

@font-face {
  font-family: "Helvetica Neue LT Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/HelveticaNeueLTPro-Md.woff2") format("woff2");
}

/* ================================================
   Theme application
   ================================================ */

:root {
  color-scheme: light dark;
  transition: --theme-darkness var(--theme-fade-duration) var(--ease);
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

/* ================================================
   Element defaults and keyboard focus
   ================================================ */

* {
  box-sizing: border-box;
}

html {
  /* Paint the viewport explicitly instead of exposing Safari's native canvas. */
  background: var(--bg);
  /* Align the preceding section divider with the navbar's bottom border. */
  scroll-padding-top: var(--header-height);
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  border-radius: 0;
}

button,
summary {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 6px;
}

button:hover,
a:hover {
  color: var(--hover-text);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: var(--font-weight-regular);
}

/* Importance and attention share a weight; their meaning stays in the HTML. */
strong,
b {
  font-weight: var(--font-weight-medium);
}

[hidden] {
  display: none !important;
}

/* ================================================
   Shared layout and text utilities
   ================================================ */

.wrap {
  position: relative;
  margin-inline: var(--gutter);
}

.page-title {
  font-size: var(--font-size-hero);
  font-weight: var(--font-weight-medium);
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.metadata {
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.045em;
  line-height: 1.5;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

/* ================================================
   Skip navigation
   ================================================ */

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  padding: var(--space-12) var(--space-20);
  background: var(--text);
  color: var(--bg);
  z-index: 100;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.skip-link:hover {
  color: var(--bg);
}

/* ================================================
   Section spacing
   ================================================ */

main > section {
  padding-block: var(--section-spacing);
}

/* ================================================
   Section labels
   ================================================ */

.section-index {
  display: flex;
  align-items: flex-start;
  gap: var(--space-20);
  color: var(--muted);
}

.tiny-cross {
  font-size: calc(var(--font-size-caption) * 1.583333);
  line-height: 15px;
  color: var(--text);
}

/* ================================================
   Responsive layout — (min-width: 1800px)
   ================================================ */

@media (min-width: 1800px) {
  .wrap {
    max-width: 1620px;
    margin-inline: auto;
  }
}

/* ================================================
   Responsive layout — (max-width: 560px)
   ================================================ */

@media (max-width: 560px) {
  .section-index {
    gap: var(--space-15);
  }
}
