/* ==========================================================================
   overrides.css — loaded last.

   1. Self-hosted fonts (no external requests).
   2. Neutralises Bootstrap's reboot where it fights this design.
   3. Skins the Bootstrap components actually in use (offcanvas, form controls).
   4. The small amount of motion that is not pure CSS.
   ========================================================================== */

/* ---- Fonts ------------------------------------------------------------ */

@font-face {
  font-family: 'Manrope Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('../fonts/manrope-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('../fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('../fonts/instrument-serif-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url('../fonts/instrument-serif-italic-latin.woff2') format('woff2');
}

/* ---- Bootstrap reboot reconciliation ----------------------------------
   Bootstrap's element selectors out-specify the `*` reset, so reset them here. */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
  color: inherit;
}

p,
figure,
blockquote,
dl,
dd,
ol,
ul {
  margin: 0;
}

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

dt {
  font-weight: inherit;
}

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

small {
  font-size: inherit;
}

img,
svg {
  vertical-align: middle;
}

/* Buttons: keep the pill geometry, not Bootstrap's padding box. */
.btn {
  padding-block: 0;
  padding-inline: 24px;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-weight: 500;
}

/* Container: the design owns the width, Bootstrap owns nothing here. */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  padding-inline: var(--gutter);
  --bs-gutter-x: 1.5rem;
}

.row--cards {
  --bs-gutter-x: clamp(16px, 2vw, 24px);
  --bs-gutter-y: clamp(16px, 2vw, 24px);
}

.row--cards > [class*='col-'] > .project-card,
.row--cards > [class*='col-'] > .related__card,
.row--cards > [class*='col-'] > .note-card {
  height: 100%;
}

/* ---- Form controls --------------------------------------------------- */

.form-label {
  margin-bottom: 7px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted-strong);
}

.form-control {
  padding: 13px 15px;
  border: 1px solid var(--border-interactive);
  border-radius: var(--r-sm);
  background: var(--white);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--ink);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.form-control::placeholder {
  color: #a3a3a0;
}

.form-control:focus {
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(122, 38, 58, 0.1);
}

textarea.form-control {
  min-height: 132px;
  resize: vertical;
  line-height: 1.6;
}

.form-control.is-invalid {
  border-color: var(--accent);
  background-image: none;
}

/* ---- Offcanvas navigation -------------------------------------------- */

.nav-panel {
  --bs-offcanvas-width: min(430px, 92vw);
  --bs-offcanvas-bg: var(--bg);
  --bs-offcanvas-color: var(--ink);
  border-left: 1px solid var(--line);
}

.nav-panel .offcanvas-header {
  padding: 18px var(--gutter);
  border-bottom: 1px solid var(--line);
}

.nav-panel .offcanvas-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px var(--gutter) 34px;
}

.nav-panel__list {
  display: flex;
  flex-direction: column;
}

.nav-panel__label {
  padding: 16px 0 8px;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.mobile-menu__link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 2px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.mobile-menu__link[aria-current='page'] {
  color: var(--accent);
}

.mobile-menu__hint {
  max-width: 42%;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  line-height: 1.5;
}

.mobile-menu__foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 28px;
}

.mobile-menu__meta {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Motion ---------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.js .hero__head,
.js .hero__grid > * {
  animation: rise 0.75s var(--ease-out) both;
}

.js .hero__grid > :nth-child(2) {
  animation-delay: 0.14s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .js .hero__head,
  .js .hero__grid > * {
    animation: none;
  }
}

/* ---- Print ----------------------------------------------------------- */

@media print {
  .site-header,
  .site-footer,
  .contact-section,
  .nav-panel,
  .progress-bar,
  .cs-toc {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .hero,
  .page-hero,
  .cs-head,
  .band--dark {
    background: #fff !important;
    color: #000 !important;
  }
}
