/* ==========================================================================
   BASE / RESET
   Global element defaults. No component-specific styling here.
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: var(--lh-heading);
  margin: 0 0 var(--space-sm) 0;
  font-weight: 600;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

/* Opt-in alt heading font — add class="heading-alt" to any h1-h4 to use it.
   Qualified by tag so it reliably wins over same-specificity component
   classes (e.g. .hero-split__title) regardless of stylesheet order. */
:is(h1, h2, h3, h4).heading-alt {
  font-family: var(--font-heading-alt);
  font-weight: 600;
}

/* Step h1.heading-alt down to the next size in the scale (h2 size) */
h1.heading-alt {
  font-size: var(--fs-h2);
}

/* Step h2.heading-alt down to a size between h2 and h3 (h3 alone was too small).
   Excludes .portfolio-group-heading, which already sets its own deliberate size. */
h2.heading-alt:not(.portfolio-group-heading) {
  font-size: var(--fs-h2-sm);
}

p {
  margin: 0 0 var(--space-sm) 0;
}

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

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Opt-in content list — use class="content-list" for bulleted prose lists */
.content-list {
  list-style: disc;
  padding-left: 1.25em;
  margin-bottom: var(--space-sm);
}

.content-list li {
  margin-bottom: var(--space-xs);
  color: var(--color-text-muted);
}

/* Opt-in reading column — use class="content-width" instead of an inline max-width */
.content-width {
  max-width: var(--content-width);
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* Visible keyboard focus everywhere — accessibility floor, don't remove */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* -- Layout helpers -------------------------------------------------------- */

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

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

.section--tight {
  padding-block: calc(var(--space-xl) / 2);
}

.section--alt {
  background-color: var(--color-surface);
}

.section + .section--alt {
  padding-top: var(--space-lg);
}

.title-band {
  background-color: var(--color-title-band);
  padding-block: var(--space-sm);
}

.title-band .section-heading {
  margin-bottom: 0;
}

.title-band h1 {
  font-size: clamp(1.1rem, 1.4vw, 1.375rem);
  font-weight: 400;
}

.title-band + .section {
  padding-top: var(--space-sm);
}

.section-heading {
  margin-bottom: var(--space-lg);
}

.section-heading p {
  color: var(--color-text-muted);
  max-width: 40em;
}

.section-heading--center {
  text-align: center;
}

.section-heading--center p {
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* -- Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.75em 1.75em;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-accent-contrast);
}

.btn--primary:hover {
  background-color: transparent;
  color: var(--color-accent);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-accent);
}

.btn--secondary:hover {
  background-color: var(--color-accent);
  color: var(--color-accent-contrast);
}

/* -- Scroll fade-in ----------------------------------------------------------
   JS toggles .is-visible on elements with .fade-in when they enter
   the viewport. See js/main.js */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}
