/* ===========================================================
   Blackmore Earthmoving — global tokens + base
   =========================================================== */

:root {
  /* Colour — primary is CAT yellow (Pantone 109 C) */
  --color-primary: #ffcd11;
  --color-primary-hover: #ffd93d;
  --color-primary-press: #e6b800;
  --color-on-primary: #0d0d0d;
  --color-bg: #0d0d0d;
  --color-surface: #111111;
  --color-surface-2: #161616;
  --color-surface-3: #1c1c1c;
  --color-white: #ffffff;
  --color-text: rgba(255, 255, 255, 0.85);
  --color-muted: rgba(255, 255, 255, 0.5);
  --color-faint: rgba(255, 255, 255, 0.35);
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-strong: rgba(255, 255, 255, 0.18);
  --color-primary-glow: rgba(255, 205, 17, 0.2);
  --color-primary-soft: rgba(255, 205, 17, 0.1);
  --color-error: #ff6b5d;

  /* Radius */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Type */
  --font-display:
    "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:
    "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.5rem;
  --fs-4xl: 3.25rem;
  --fs-5xl: 4rem;

  --lh-tight: 1.1;
  --lh-snug: 1.25;
  --lh-base: 1.55;
  --lh-loose: 1.7;

  /* Layout */
  --container: 1240px;
  --container-narrow: 880px;
  --nav-height: 72px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 160ms;
  --dur: 240ms;
  --dur-slow: 480ms;

  /* Shadow */
  --shadow-card:
    0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ===========================================================
   Reset
   =========================================================== */

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

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

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

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--color-primary);
  color: var(--color-white);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-white);
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
}

h1 {
  font-size: clamp(2.25rem, 6vw + 0.5rem, var(--fs-5xl));
  font-weight: 700;
}
h2 {
  font-size: clamp(1.75rem, 3.2vw + 0.5rem, var(--fs-3xl));
}
h3 {
  font-size: clamp(1.25rem, 1.5vw + 0.6rem, var(--fs-xl));
}
h4 {
  font-size: var(--fs-lg);
}

p {
  color: var(--color-text);
  line-height: var(--lh-loose);
}

p + p {
  margin-top: var(--space-4);
}

strong {
  color: var(--color-white);
  font-weight: 600;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-7) 0;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ===========================================================
   Layout primitives
   =========================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.section {
  padding: var(--space-8) 0;
}

@media (min-width: 768px) {
  .container,
  .container-narrow {
    padding: 0 var(--space-6);
  }
  .section {
    padding: var(--space-9) 0;
  }
}

@media (min-width: 1024px) {
  .section {
    padding: var(--space-10) 0;
  }
}

.section--tight {
  padding: var(--space-7) 0;
}
.section--dark {
  background: var(--color-bg);
}
.section--surface {
  background: var(--color-surface);
}

/* ===========================================================
   Page banner (used on every non-home page)
   =========================================================== */

.banner {
  padding: calc(var(--nav-height) + var(--space-8)) 0 var(--space-8);
  background:
    radial-gradient(
      60% 60% at 80% 0%,
      var(--color-primary-soft),
      transparent 60%
    ),
    linear-gradient(180deg, var(--color-surface), var(--color-bg));
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--color-border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--color-border) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse at top, black 30%, transparent 70%);
  pointer-events: none;
}

.banner__inner {
  position: relative;
  z-index: 2;
}

.banner__eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  font-weight: 600;
}

.banner__title {
  max-width: 800px;
}

.banner__sub {
  margin-top: var(--space-4);
  font-size: var(--fs-md);
  color: var(--color-muted);
  max-width: 640px;
}

@media (min-width: 768px) {
  .banner {
    padding: calc(var(--nav-height) + var(--space-9)) 0 var(--space-9);
  }
}

/* Full-viewport-height banner (About page, with a scroll-driven drone
   video). Fills the visible area below the nav and centres the content,
   matching the home hero. */
.banner--full {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  padding-top: var(--space-7);
  padding-bottom: var(--space-7);
}

/* Photo banner — background image behind the title, ~30% shorter than the
   default banner, zoomed in slightly and anchored to the left. */
.banner--photo {
  padding-top: calc(var(--nav-height) + var(--space-5));
  padding-bottom: var(--space-5);
  background:
    linear-gradient(
      90deg,
      rgba(13, 13, 13, 0.92) 0%,
      rgba(13, 13, 13, 0.66) 48%,
      rgba(13, 13, 13, 0.42) 100%
    ),
    linear-gradient(
      0deg,
      var(--color-bg) 0%,
      var(--color-bg) 6%,
      rgba(13, 13, 13, 0) 26%
    ),
    url(../assets/jb-walk.jpg);
  background-size: cover, cover, 130%;
  background-position:
    center,
    center,
    left 25%;
  background-repeat: no-repeat;
  /* divider line to solid black + hard solid strip pinned to the bottom edge */
  border-bottom-color: var(--color-bg);
  box-shadow: inset 0 -6px 0 0 var(--color-bg);
}
/* solid bar covering the bottom edge, nudged ~2px below the seam */
.banner--photo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 16px;
  background: linear-gradient(
    0deg,
    var(--color-bg) 0%,
    var(--color-bg) 35%,
    rgba(13, 13, 13, 0) 100%
  );
  z-index: 1;
  pointer-events: none;
}
.banner--photo::before {
  display: none;
}
@media (min-width: 769px) {
  .banner--photo {
    padding-top: calc(var(--nav-height) + var(--space-6));
    padding-bottom: var(--space-6);
  }
}

/* Compact banner — ~40% shorter than the default (used on Projects) */
.banner--compact {
  padding-top: calc(var(--nav-height) + var(--space-3));
  padding-bottom: var(--space-5);
}
@media (min-width: 769px) {
  .banner--compact {
    padding-top: calc(var(--nav-height) + var(--space-4));
    padding-bottom: var(--space-6);
  }
}

/* Low-opacity location pill over a banner video (About) */
.banner__pill {
  position: absolute;
  right: var(--space-6);
  bottom: var(--space-6);
  z-index: 2;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  background: rgba(13, 13, 13, 0.5);
  border: 1px solid var(--color-border-strong);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--color-text);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}
.banner__pill.is-faded {
  opacity: 0.1;
}

/* Deter saving/dragging of media (paired with the JS handlers in main.js) */
img,
video {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ===========================================================
   Utility
   =========================================================== */

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 600;
}

.text-muted {
  color: var(--color-muted);
}
.text-faint {
  color: var(--color-faint);
}
.text-white {
  color: var(--color-white);
}
.text-primary {
  color: var(--color-primary);
}
.text-center {
  text-align: center;
}
.lead {
  font-size: var(--fs-md);
  color: var(--color-text);
  line-height: var(--lh-loose);
}

.grid {
  display: grid;
  gap: var(--space-5);
}

.divider {
  height: 1px;
  background: var(--color-border);
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* -----------------------------------------------------------
   StripeScroll — animated diagonal stripe background.
   Drop-in utility class. Stripes live on a ::before pseudo so
   the host element's content stays at full opacity while the
   pattern can fade independently on hover.
   ----------------------------------------------------------- */
.stripe-scroll {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.stripe-scroll::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(
    135deg,
    var(--color-bg) 25%,
    var(--color-surface-2) 25%,
    var(--color-surface-2) 50%,
    var(--color-bg) 50%,
    var(--color-bg) 75%,
    var(--color-surface-2) 75%,
    var(--color-surface-2)
  );
  background-size: 40px 40px;
  animation: stripe-scroll 4s linear infinite;
  transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.stripe-scroll:hover::before {
  opacity: 0.5;
}

@keyframes stripe-scroll {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 40px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Shared split-intro heading (replaces inline margin-top:12px) */
.split__title {
  margin-top: var(--space-3);
}
/* Full-height banner collapses on mobile (no scroll-video injected <=768px) */
@media (max-width: 768px) {
  .banner--full {
    min-height: auto;
  }
}

/* Tighten the blank space around full-width image bands */
.section--tight:has(.media-ph--wide) {
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}

/* ===========================================================
   Country grit + warmth (deliberate, subtle)
   =========================================================== */
:root {
  --font-hand: "Kalam", "Bradley Hand", cursive;
}

/* Corner brackets framing the viewport — a quiet "instrument frame" touch at
   the edges instead of an all-over grain. Fixed, subtle, never in the way. */
.edge-frame {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
}
.edge-frame span {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 0 solid var(--color-primary);
  opacity: 0.4;
}
.edge-frame span.tl {
  top: 16px;
  left: 16px;
  border-top-width: 2px;
  border-left-width: 2px;
}
.edge-frame span.tr {
  top: 16px;
  right: 16px;
  border-top-width: 2px;
  border-right-width: 2px;
}
.edge-frame span.bl {
  bottom: 16px;
  left: 16px;
  border-bottom-width: 2px;
  border-left-width: 2px;
}
.edge-frame span.br {
  bottom: 16px;
  right: 16px;
  border-bottom-width: 2px;
  border-right-width: 2px;
}
@media (max-width: 640px) {
  .edge-frame span {
    width: 14px;
    height: 14px;
    opacity: 0.3;
  }
  .edge-frame span.tl,
  .edge-frame span.tr {
    top: 10px;
  }
  .edge-frame span.bl,
  .edge-frame span.br {
    bottom: 10px;
  }
  .edge-frame span.tl,
  .edge-frame span.bl {
    left: 10px;
  }
  .edge-frame span.tr,
  .edge-frame span.br {
    right: 10px;
  }
}

/* Jared's hand — used sparingly: a signature, the odd marker accent. */
.signature {
  font-family: var(--font-hand);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 0.9;
  display: inline-block;
  transform: rotate(-3.5deg);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
}
.signature--white {
  color: var(--color-white);
}
.signature--sm {
  font-size: clamp(1.4rem, 2.5vw, 1.7rem);
}

/* Hand-drawn marker accents */
.hand-note {
  font-family: var(--font-hand);
  font-weight: 400;
  color: var(--color-primary);
  font-size: var(--fs-md);
  transform: rotate(-1.5deg);
  display: inline-block;
}

/* Rough underline under a hero word (SVG squiggle sits just under it) */
.scribble-wrap {
  position: relative;
  display: inline-block;
}
.scribble {
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -0.22em;
  width: 104%;
  height: 0.34em;
  color: var(--color-primary);
  overflow: visible;
  pointer-events: none;
}
.scribble path {
  stroke: currentColor;
  stroke-width: 6;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 460;
  stroke-dashoffset: 460;
  transition: stroke-dashoffset 0.9s var(--ease-out) 0.35s;
}
.is-visible .scribble path,
.scribble--draw path {
  stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: reduce) {
  .scribble path {
    stroke-dashoffset: 0;
    transition: none;
  }
}
