/* ============================================================
   Durban Oil & Gas - base
   Reset, document defaults, typography primitives, utilities,
   reveal-motion foundation and reduced-motion contract.
   ============================================================ */

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-ink);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

/* Width/height attributes reserve layout space; CSS controls the
   rendered box. */
img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* ---- Headings ---- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-display);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.015em; }
h4 { font-size: var(--fs-h4); font-weight: 600; }

p {
  text-wrap: pretty;
}

/* ---- Links ---- */

a {
  color: var(--c-blue-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dur-fast) ease;
}

a:hover {
  color: var(--c-ink);
}

a:active {
  color: var(--c-blue-deep);
}

/* ---- Focus contract ---- */

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---- Selection ---- */

::selection {
  background: var(--c-brand-blue);
  color: #fff;
}

/* ---- Skip link ---- */

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 300;
  padding: 0.65em 1.2em;
  background: var(--c-ink);
  color: #fff;
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-pill);
  transform: translateY(-300%);
}

.skip-link:focus-visible {
  transform: none;
  color: #fff;
}

/* ---- Layout primitives ---- */

.container {
  width: 100%;
  max-width: var(--w-container);
  margin-inline: auto;
  padding-inline: var(--sp-gutter);
}

.prose {
  max-width: var(--w-prose);
}

.prose > * + * {
  margin-top: var(--sp-4);
}

.prose h3 {
  margin-top: var(--sp-6);
}

.prose ul {
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: var(--sp-2);
}

/* ---- Text styles ---- */

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--c-slate);
  max-width: 40em;
  text-wrap: pretty;
}

/* ---- Section rhythm ---- */

.section {
  padding-block: var(--sp-section);
}

.section--tight {
  padding-block: calc(var(--sp-section) * 0.6);
}

/* Section heads: short display title first, descriptive subtitle under it */

.section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
}

.section-head h2 {
  max-width: 17em;
}

.section-head--center {
  align-items: center;
  text-align: center;
  margin-inline: auto;
}

.section-head--center h2 {
  max-width: 16em;
}

/* ---- Utilities ---- */

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

.nowrap { white-space: nowrap; }

.accent {
  color: var(--c-brand-orange);
}

/* ============================================================
   Reveal-on-scroll foundation.
   JS adds .is-in when an element enters the viewport.
   Without JS - or with reduced motion - content is fully visible.
   ============================================================ */

.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Reduced motion: kill transforms, transitions and smooth scroll. */

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

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
