/* ==========================================================================
   nullbird.com
   Type roles:
     Castoro             the voice: statements, headings, descriptions
     Open Sans condensed names of things: wordmark, project names
     Open Sans normal    body text and interface
   ========================================================================== */

/* ---------- Fonts (self-hosted, variable, Latin subset) ---------- */

@font-face {
  font-family: "Open Sans";
  src: url("../fonts/OpenSans.woff2") format("woff2");
  font-weight: 300 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/OpenSans-Italic.woff2") format("woff2");
  font-weight: 300 800;
  font-stretch: 75% 100%;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Castoro";
  src: url("../fonts/Castoro.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Castoro";
  src: url("../fonts/Castoro-Italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --paper: #f3f5f2;
  --ink: #15202b;
  --muted: #55626d;
  --egg: #a8d8cc;          /* robin's egg: the signature field color */
  --on-egg: #15202b;
  --on-egg-muted: #2f4a47;
  --deep: #0e5247;         /* links and focus on paper */
  --code-bg: #e4e9e5;
  --footer-bg: #15202b;
  --footer-fg: #dfe8e4;
  --footer-muted: #93a5a8;

  --sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Castoro", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --max: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 38rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1a20;
    --ink: #e3ebe7;
    --muted: #97a7ac;
    --egg: #173a35;
    --on-egg: #d4efe7;
    --on-egg-muted: #9cc9bd;
    --deep: #8fd3c3;
    --code-bg: #18262d;
    --footer-bg: #0a1216;
    --footer-fg: #d4dfdb;
    --footer-muted: #7f9196;
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
  font-stretch: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}

main { flex: 1; }

a {
  color: var(--deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--deep);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

/* ---------- Wordmark ---------- */

.wordmark {
  font-family: var(--sans);
  font-stretch: 75%;
  font-size: 1.625rem;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wordmark-null { font-weight: 300; }
.wordmark-bird { font-weight: 800; }

/* ---------- Header ---------- */

.site-header {
  background: var(--egg);
  color: var(--on-egg);
}
.site-header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  padding-block: 1.5rem;
}
.brand { color: inherit; text-decoration: none; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-stretch: 87.5%;
  font-weight: 600;
  font-size: 0.9375rem;
}
.site-nav a {
  color: var(--on-egg);
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: currentColor; }
[data-page="projects"] .nav-projects,
[data-page="about"] .nav-about { border-bottom-color: currentColor; }

/* ---------- Home hero ---------- */

.hero {
  background: var(--egg);
  color: var(--on-egg);
  padding-block: clamp(3rem, 9vw, 7rem) clamp(3.5rem, 10vw, 8rem);
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(3.25rem, 11.5vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin-left: -0.04em; /* optical alignment of the large capitals */
}
.hero-line { display: block; }
/* The weight rises line by line: a crescendo on Castoro's weight axis */
.hero-line-1 { font-weight: 400; }
.hero-line-2 { font-weight: 550; }
.hero-line-3 { font-weight: 700; }

.hero-lead {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  max-width: 34rem;
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.55;
  color: var(--on-egg-muted);
}

/* ---------- Inner page hero ---------- */

.page-hero {
  background: var(--egg);
  color: var(--on-egg);
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2.5rem, 7vw, 4.5rem);
}
.page-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.75rem, 8vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.page-lead {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  color: var(--on-egg-muted);
}

.crumbs {
  font-stretch: 87.5%;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}
.crumbs a { color: var(--on-egg-muted); }

.project-title {
  font-family: var(--sans);
  font-stretch: 75%;
  font-weight: 800;
  font-size: clamp(4rem, 17vw, 13rem);
  line-height: 0.85;
  letter-spacing: -0.035em;
  margin-left: -0.05em;
}
.project-title-long {
  font-size: clamp(2.5rem, 10.5vw, 8.5rem);
  overflow-wrap: anywhere;
}
.project-pitch {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 36rem;
  font-family: var(--serif);
  font-size: clamp(1.375rem, 2.6vw, 2rem);
  line-height: 1.3;
}

.facts {
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1.25rem 2rem;
  max-width: 56rem;
}
.facts dt {
  font-stretch: 87.5%;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--on-egg-muted);
}
.facts dd { margin: 0.15rem 0 0; font-size: 1rem; }
.facts code { background: rgba(255, 255, 255, 0.35); }
@media (prefers-color-scheme: dark) {
  .facts code { background: rgba(0, 0, 0, 0.25); }
}

/* ---------- Project index ---------- */

.project-group { padding-block: clamp(3.5rem, 8vw, 6rem) 0; }

.project-group-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1rem 3rem;
  align-items: baseline;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.project-group-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.1;
}
.project-group-head p { color: var(--muted); max-width: var(--measure); }

.project-list { list-style: none; margin: 0; padding: 0; }

.project {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 0.75rem 3rem;
  align-items: start;
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
}
.project-body { padding-top: clamp(0.25rem, 0.8vw, 0.6rem); }

.project-name {
  display: inline-block;
  font-stretch: 75%;
  font-weight: 800;
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.project-name:hover { color: var(--deep); }
.project-name-long { font-size: clamp(2.25rem, 3.6vw, 3rem); }

.project-meta {
  margin-top: 0.5rem;
  font-stretch: 87.5%;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
}

.project-desc {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.4;
  max-width: 32rem;
}
.project-links {
  margin-top: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

/* ---------- Values ---------- */

.values { padding-block: clamp(4.5rem, 10vw, 8rem); }
.values > h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.1;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2.5rem 3rem;
}
.value h3 {
  font-family: var(--serif);
  font-size: 1.375rem;
  line-height: 1.25;
  margin-bottom: 0.625rem;
}
.value p { color: var(--muted); }

/* ---------- Prose (project and about pages) ---------- */

.prose {
  padding-block: clamp(3rem, 7vw, 5rem) clamp(4rem, 9vw, 7rem);
}
.prose > * { max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  line-height: 1.2;
  margin-top: 2.5em;
}
.prose h2:first-child { margin-top: 0; }
.prose h2 + * { margin-top: 0.75em; }

.prose ul { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--deep); }

.prose .aside {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--muted);
}

.prose pre {
  max-width: 44rem;
  background: var(--code-bg);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.5;
}
.prose pre code { background: none; padding: 0; font-size: 0.875rem; }

.link-list { list-style: none; padding-left: 0 !important; }
.link-list li + li { margin-top: 0.375em; }
.link-list a { font-weight: 600; }

/* The about page reads as a letter: serif body, a little more leading */
.prose-serif {
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.7;
}
.prose-serif > * { max-width: 36rem; }
.prose-serif .link-list a { font-family: var(--sans); font-size: 1rem; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  font-size: 0.9375rem;
}
.site-footer a { color: var(--footer-fg); }
.site-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem 3rem;
}
.site-footer-brand p { margin-top: 0.5rem; color: var(--footer-muted); }
.site-footer-contact p { max-width: 32rem; }
.site-footer-legal { margin-top: 0.75rem; color: var(--footer-muted); font-size: 0.875rem; }

/* ---------- Small screens ---------- */

@media (max-width: 48rem) {
  .project-group-head,
  .project,
  .site-footer-inner { grid-template-columns: minmax(0, 1fr); }
  .project { gap: 0.5rem; }
  .project-desc { margin-top: 0.25rem; }
}

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

/* Sub-line under a short project pitch */
.project-sub {
  margin-top: 1rem;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  color: var(--on-egg-muted);
}

/* ---------- Screenshots ---------- */

figure { margin: 0; }
.hero-shot img,
.shot img,
.wide-shot img {
  display: block;
  width: 100%;
  height: auto;
}
.hero-shot a,
.shot a,
.wide-shot a { display: block; }

/* Phone screenshots: rounded like the screen they come from, no fake device frame */
.shot-phone img {
  border-radius: 12% / 5.5%;
  border: 1px solid rgba(21, 32, 43, 0.18);
}
.shot-tablet img {
  border-radius: 3.5% / 2.6%;
  border: 1px solid rgba(21, 32, 43, 0.18);
}
.wide-shot img {
  border-radius: 8px;
  border: 1px solid rgba(21, 32, 43, 0.25);
}

figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

/* Hero with a screenshot beside the text */
.hero-split-text { min-width: 0; }
.hero-shot {
  width: min(70vw, 18rem);
  margin: clamp(2.5rem, 6vw, 3.5rem) auto 0;
}
.hero-shot img { box-shadow: 0 2.5rem 3rem -2rem rgba(14, 82, 71, 0.55); }

@media (min-width: 60rem) {
  .hero-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18.75rem;
    gap: 4rem;
    align-items: start;
  }
  .hero-shot { width: auto; margin: 2.5rem 0 0; }
}
/* Wide enough: the phone hangs over the edge of the colored field */
@media (min-width: 76rem) {
  .hero-shot { position: relative; z-index: 1; margin-bottom: -9rem; }
}

/* A wide screenshot straddling the colored field and the page */
.project-hero.has-wide-shot { padding-bottom: clamp(5rem, 12vw, 10rem); }
.wide-shot {
  position: relative;
  margin-top: calc(-1 * clamp(3.5rem, 9vw, 7.5rem));
}

/* Gallery inside prose: equal heights, widths follow the aspect ratios */
.prose > .gallery {
  max-width: 46rem;
  display: grid;
  grid-template-columns: 75fr 46fr;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}
@media (max-width: 30rem) {
  .prose > .gallery { grid-template-columns: minmax(0, 1fr); }
  .gallery .shot-phone { width: 70%; }
}

@media (prefers-color-scheme: dark) {
  .shot-phone img, .shot-tablet img, .wide-shot img { border-color: rgba(227, 235, 231, 0.18); }
  .hero-shot img { box-shadow: 0 2.5rem 3rem -2rem rgba(0, 0, 0, 0.7); }
}

/* Wide screenshot inside prose: breaks out of the reading measure */
.prose > .shot-wide { max-width: none; margin-top: 2rem; margin-bottom: 1rem; }
.shot-wide img {
  border-radius: 8px;
  border: 1px solid rgba(21, 32, 43, 0.25);
}
@media (prefers-color-scheme: dark) {
  .shot-wide img { border-color: rgba(227, 235, 231, 0.18); }
}
