/* Dorne components — reset, type primitives, controls, bar, section shell,
   footer. Reusable by the app. Page blocks live in styles.css. */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.64;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

p {
  margin: 0 0 1em;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text);
  font-weight: 400;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

.mono {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--track-mono);
}

::selection {
  background: var(--accent-line);
  color: #fff;
}

:focus-visible {
  outline: 1px solid var(--accent-strong);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--cream);
  color: var(--cream-ink-strong);
  padding: 12px 18px;
  z-index: 200;
}

.skip:focus {
  left: 12px;
  top: 12px;
}

.display {
  font-family: var(--display);
  font-size: var(--fs-display);
  font-weight: 350;
  font-variation-settings: "opsz" 120;
  line-height: 1.02;
  letter-spacing: var(--track-tight);
  text-wrap: balance;
  color: var(--text);
}

.display em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent-strong);
}

.display-h2 {
  font-size: var(--fs-h2);
  line-height: 1.06;
}

.display-h3 {
  font-size: var(--fs-h3);
  line-height: 1.12;
}

.display-xl {
  font-size: var(--fs-xl);
}

.kicker {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 22px;
}

.kicker-copper {
  color: var(--accent);
}

.kicker-light {
  color: var(--kicker-light);
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: var(--fs-small);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 28px;
}

.rule {
  display: block;
  width: clamp(24px, 6vw, 56px);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-line));
}

.rule:last-child {
  background: linear-gradient(to left, transparent, var(--accent-line));
}

.lede {
  font-size: var(--fs-lead);
  line-height: 1.68;
  color: var(--muted);
  max-width: 56ch;
  margin: 24px auto 0;
}

.section-lede {
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--muted);
  max-width: 56ch;
  margin: 18px 0 0;
}

.fine {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  color: var(--dim);
  margin: 16px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1;
  padding: 12px 19px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease,
  transform 200ms ease, box-shadow 200ms ease;
}

.btn-lg {
  padding: 15px 23px;
  font-size: var(--fs-small);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-copper {
  background: linear-gradient(180deg, var(--btn-from) 0%, var(--btn-to) 100%);
  color: var(--btn-ink);
  box-shadow:
  var(--specular-strong),
  var(--shadow-copper);
}

.btn-copper:hover {
  background: linear-gradient(180deg, var(--btn-from-hover) 0%, var(--btn-to-hover) 100%);
  transform: translateY(-1px);
  box-shadow:
  var(--specular-strong-hover),
  var(--shadow-copper-hover);
}

.btn-copper:active {
  transform: translateY(0);
}

.btn-outline {
  border-color: var(--outline-line);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--outline-line-hover);
}

.btn-ink {
  background: var(--cream-ink-strong);
  color: var(--cream);
}

.btn-ink:hover {
  background: #241d16;
}

.quiet {
  font-size: var(--fs-small);
  color: var(--muted);
  transition: color 160ms ease;
}

.quiet:hover {
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.actions-tight {
  justify-content: flex-start;
  margin-top: 28px;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bar-bg);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

.bar.is-scrolled {
  border-bottom-color: var(--accent-line);
}

.bar-in {
  /* The gutter sits OUTSIDE the --max box here, matching `.section` padding →
     `.section-in` and `.foot` padding → `.foot-in`. Capping the bar at `--max`
     and insetting the padding put the wordmark one full gutter (52px at 1280)
     to the right of the first heading on the page, so the bar and the page it
     introduces never shared a left edge. The app (`dorne`) mirrors this rule
     exactly, so the two bars stay on the same x. */
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 70px;
  display: flex;
  align-items: center;
  gap: 36px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.mark svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.mark-name {
  font-family: var(--display);
  font-size: var(--fs-wordmark);
  font-weight: 400;
  line-height: 1;
}

.bar-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.bar-nav a {
  font-size: var(--fs-small);
  color: var(--muted);
  transition: color 160ms ease;
}

.bar-nav a:hover {
  color: var(--text);
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.section {
  padding: var(--section-y) var(--gutter);
}

.section-alt {
  background: var(--bg-1);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.section-in {
  max-width: var(--max);
  margin: 0 auto;
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.foot {
  border-top: 1px solid var(--line-soft);
  padding: clamp(44px, 5vw, 64px) var(--gutter) 24px;
}

.foot-in {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr);
  gap: clamp(28px, 5vw, 64px);
  padding-bottom: 38px;
}

.foot-brand p {
  margin: 14px 0 0;
  font-size: var(--fs-mono);
  line-height: 1.6;
  color: var(--dim);
  max-width: 30ch;
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.foot-cols h4 {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 12px;
}

.foot-cols a {
  display: block;
  font-size: var(--fs-small);
  color: var(--muted);
  padding: 4px 0;
  transition: color 160ms ease;
}

.foot-cols a:hover {
  color: var(--text);
}

.foot-base {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--fs-mono);
  color: var(--dim);
}

.foot-base .mono {
  text-transform: uppercase;
  letter-spacing: var(--track-label);
  font-size: var(--fs-label);
}

[id] {
  scroll-margin-top: 96px;
}

@media (max-width: 1000px) {
  .actions-tight {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .bar-in {
    flex-wrap: wrap;
    height: auto;
    padding: 12px var(--gutter) 8px;
    gap: 10px 16px;
  }
  .bar-actions {
    margin-left: auto;
  }
  .bar-actions .quiet {
    display: none;
  }
  .bar-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .bar-nav::-webkit-scrollbar {
    display: none;
  }
  [id] {
    scroll-margin-top: 140px;
  }
  .foot-in {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .foot-cols {
    grid-template-columns: 1fr 1fr;
    gap: 26px;
  }
}

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