/* Custom styles for digitalnative.net */

/* Inter for everything the reader reads; Inconsolata kept for code only.
   Inter also sets the logotype, so the wordmark and the page agree. */
:root {
  --pico-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pico-font-family-monospace: "Inconsolata", "SFMono-Regular", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;

  /* One spacing scale, so vertical rhythm is a choice rather than an accident. */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;

  /* Comfortable reading measure. Headings opt out of it deliberately. */
  --measure: 68ch;

  /* The single horizontal inset everything aligns to. */
  --gutter: clamp(1.25rem, 4vw, 2rem);
}

[data-theme="dark"] {
  --pico-primary: #888;
  --pico-primary-hover: #aaa;
  --pico-primary-focus: rgba(136, 136, 136, 0.25);
  --pico-primary-background: #333;
  --pico-primary-hover-background: #444;
  --pico-primary-border: #555;
  --pico-primary-hover-border: #666;
  --pico-primary-inverse: #ccc;
}

body {
  font-family: var(--pico-font-family);
  background-color: black;
}

/* Code keeps the monospace face. Everything else inherits from body, which is
   why the previous blanket `* { font-family: ... !important }` rule is gone:
   it also overrode <code>, so nothing could opt out. */
code, pre, kbd, samp, tt {
  font-family: var(--pico-font-family-monospace);
}

body {
  line-height: 1.55;
  font-size: 1rem;
  font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.011em;
  margin-block: var(--space-4) var(--space-2);
  text-wrap: balance;
}

/* Nothing should collide with the top of its own section. */
:is(h1, h2, h3):first-child {
  margin-block-start: 0;
}

p {
  margin-bottom: var(--space-2);
  max-width: var(--measure);
}

a {
  font-weight: bold;
  color: #666;
  text-decoration: none;
}

a:hover {
  color: #aaa;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Full page video background */
.video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
}

/* The video is decorative. Without a scrim the body copy sits on moving
   high-contrast noise, which is most of why the page felt cheap. */
.video-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.82), rgba(0,0,0,0.66) 40%, rgba(0,0,0,0.88));
}

.background-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  transform: translate(-50%, -50%);
  z-index: -1;
}

/* Header, main and footer all use .container-fluid, so this is the one rule
   that sets the shared left/right edge. Nothing else may add horizontal
   padding, or the page stops lining up. */
.container-fluid {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 2;
}

/* Ensure content is readable over video */
.template-homepage {
  min-height: 100vh;
}

.template-homepage main {
  padding-block: var(--space-5) var(--space-4);
}

.template-homepage section {
  margin-block-end: var(--space-4);
}

/* Type scales with the viewport rather than stepping at two breakpoints, so
   there are no widths where it looks wrong. */
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 1.05rem + 1.3vw, 1.9rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.7vw, 1.4rem); }

@media (max-width: 768px) {
  .template-homepage main {
    padding-block: var(--space-4) var(--space-3);
  }
}

@media (max-width: 480px) {
  /* Video is hidden here for performance, so the scrim has nothing to sit on
     and the background is simply black. */
  .video-background {
    display: none;
  }
}

/* Header layout. Flex rather than a 1fr 1fr grid: the nav now sits at the
   right edge at every width instead of being pinned to the page midpoint and
   snapping at a single breakpoint. */
header .grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding-block: var(--space-3);
  grid-template-columns: none;
}

/* No padding here on purpose: the logo aligns to the container edge, which is
   the same edge as the body copy. The old padding-left put it 2rem adrift. */
.logo-container {
  align-self: center;
}

.logo-link {
  display: inline-block;
  line-height: 0;
}

/* The stacked lockup is 385x283; 190px wide lands at ~140px tall, in the same
   band as the old 1000x336 logo at its 300px width. */
header img {
  width: min(190px, 58vw);
  height: auto;
}

/* Likewise no padding-right: it used to pull the nav 4rem in from the edge
   the rest of the page aligns to. */
.nav-container {
  align-self: center;
}

/* Header navigation styling */
.header-nav ul {
  gap: 1.5rem;
}

.header-nav li {
  margin: 0;
  align: right;
}

.header-nav a {
  font-weight: bold;
  padding: 0.2rem 0;
  text-decoration: none;
  color: #666;
  transition: color 0.2s ease;
}

.header-nav a:hover {
  color: #aaa;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Responsive header for mobile */
/* Below this the logo and nav stack, both still on the shared left edge. */
@media (max-width: 700px) {
  header .grid {
    justify-content: flex-start;
    gap: var(--space-2);
  }

  .header-nav ul {
    justify-content: flex-start;
    gap: var(--space-3);
    padding-left: 0;
    flex-wrap: wrap;
  }
}

footer.container-fluid {
  padding-block: var(--space-4);
  border-top: 1px solid #1c1c1c;
  margin-block-start: var(--space-5);
  font-size: 0.9rem;
  color: #555;
}

/* Footer sits on the same left edge as everything else, rather than centred
   against left-aligned content. */
footer.container-fluid,
footer.container-fluid * {
  text-align: left;
}

/* Footer social links */
.social-links {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: #555;
}

.social-links span {
  margin-right: 0.25rem;
}

.social-links a {
  color: #666;
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: #aaa;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.social-links .sep {
  color: #333;
}

/* Footer copy sits under the links with a little air, and the version line
   should read as metadata rather than content. */
footer.container-fluid p {
  margin-block: var(--space-2) 0;
  max-width: var(--measure);
}

footer.container-fluid p:last-child {
  color: #3a3a3a;
  font-size: 0.8rem;
}

/* "Contact Us" was splitting across lines mid-phrase on narrow screens. */
main a {
  text-wrap: nowrap;
}
