/* 1408 Productions: mobile-first, system fonts only, no JS needed */
:root {
  --paper: #f4f5f3;
  --ink: #17212b;
  --muted: #55626d;
  --rule: #c9d0d4;
  --cue: #8d8d8d;
  --on-ink: #f4f5f3;
  --tint-a: #e6edf2;
  --tint-b: #b0c4de;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121a22;
    --ink: #eef0ee;
    --muted: #9fabb4;
    --rule: #2c3945;
    --cue: #8d8d8d;
    --on-ink: #121a22;
    --tint-a: #19283a;
    --tint-b: #25365d;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
}

a { color: inherit; text-underline-offset: 0.2em; }
a:focus-visible { outline: 3px solid var(--cue); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--on-ink);
}
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }

/* Header */
.site-header { padding-block: 1.25rem; border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { font-weight: 700; text-decoration: none; letter-spacing: 0.01em; }
.nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--muted); padding-block: 0.5rem; }
.nav a:hover { color: var(--ink); text-decoration: underline; }
.nav .contact-link { color: var(--ink); font-weight: 600; }

/* Hero */
.hero { padding-block: 4rem 3.5rem; }
.hero h1 {
  margin: 0 0 1.5rem;
  max-width: 18ch;
  font: 700 clamp(2.25rem, 9vw, 4.5rem)/1.05 var(--serif);
  letter-spacing: -0.02em;
}
.hero p { max-width: 38rem; margin: 0 0 2rem; font-size: 1.125rem; color: var(--muted); }
.since {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.since::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--cue);
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.25rem;
}
.btn:hover { background: var(--cue); color: #fff; }
.btn.plain { background: transparent; color: var(--ink); border: 1px solid var(--ink); margin-left: 0.5rem; }
.btn.plain:hover { background: var(--ink); color: var(--on-ink); }

/* Faded background images (images/01bg.jpg and images/02bg.jpg).
   If a file is missing the page simply shows the plain background. */
.hero, .has-bg { position: relative; isolation: isolate; overflow: hidden; }

.hero::before, .has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  /* fade out towards the bottom so the image melts into the page */
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
  pointer-events: none;
}

.hero::before { background-image: url("images/bg01.jpg"); opacity: 0.32; }
.has-bg::before { background-image: url("images/bg02.jpg"); opacity: 0.26; }

@media (prefers-color-scheme: dark) {
  .hero::before { opacity: 0.42; }
  .has-bg::before { opacity: 0.36; }
}

/* Faint section tints */
.tint-a { background: var(--tint-a); }
.tint-b { background: var(--tint-b); }

/* Sections */
section { padding-block: 3rem; border-top: 1px solid var(--rule); }
h2 { margin: 0 0 1.5rem; font: 700 clamp(1.5rem, 5vw, 2.1rem)/1.15 var(--serif); }
h3 { margin: 2rem 0 0.75rem; font-size: 1.05rem; }

.about-text { max-width: 40rem; }
.about-text p { margin: 0 0 1rem; }

/* Services: reads like a cue sheet */
.services { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.services li { padding: 0.9rem 0 0.9rem 1rem; border-left: 3px solid var(--rule); border-bottom: 1px solid var(--rule); }
.services li:hover { border-left-color: var(--cue); }
.services strong { display: block; }
.services span { color: var(--muted); font-size: 0.95rem; }

/* Projects */
.projects { list-style: none; margin: 0; padding: 0; columns: 1; }
.projects li { padding: 0.55rem 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }

.partners { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

/* Contact */
.contact p { max-width: 36rem; margin: 0 0 1.5rem; }

footer { padding-block: 2rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.875rem; }
footer p { margin: 0 0 0.5rem; }

/* Larger screens */
@media (min-width: 40rem) {
  .projects { columns: 2; column-gap: 2.5rem; }
  .services { grid-template-columns: repeat(2, 1fr); column-gap: 2.5rem; }
}

@media (min-width: 64rem) {
  .hero { padding-block: 6rem 5rem; }
  section { padding-block: 4.5rem; }
  .services { grid-template-columns: repeat(4, 1fr); column-gap: 1.5rem; }
  .projects { columns: 3; }
}

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