/* Self-hosted fonts (SIL OFL, see /assets/fonts/OFL.txt). Latin subset. */
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/assets/fonts/newsreader-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/publicsans-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Craner Labs. Paper and ink with one red pencil.
   Newsreader for headings, Public Sans for everything else. */

:root {
  color-scheme: light dark;
  --paper: light-dark(#F7F6F2, #16171A);
  --ink: light-dark(#1A1C20, #ECEAE4);
  --graphite: light-dark(#575C66, #A2A6AE);
  --rule: light-dark(#D9D7CF, #34363B);
  --pencil: light-dark(#C9382A, #F0644F);
  --tint: light-dark(#ECEAE3, #212227);
  --card: light-dark(#FFFFFF, #1D1E22);
  --live: light-dark(#2F7A4B, #6CC08C);
  --dev: light-dark(#8A6A12, #D9B44F);

  --display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --text: "Public Sans", ui-sans-serif, system-ui, sans-serif;

  /* Type scale. Every font-size below uses one of these. */
  --fs-xs: 0.875rem;    /* meta, notes, footer */
  --fs-sm: 0.9375rem;   /* form labels */
  --fs-base: 1rem;
  --fs-body: 1.0625rem;
  --fs-lg: 1.1875rem;   /* lead paragraphs */
  --fs-h4: 1.5rem;
  --fs-h3: 1.875rem;
  --fs-h2s: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
  --fs-h2: clamp(2rem, 1.5rem + 1.8vw, 2.9rem);
  --fs-h1s: clamp(2.5rem, 1.3rem + 4vw, 4.5rem);
  --fs-h1: clamp(2.75rem, 1.4rem + 4.4vw, 5.5rem);

  --radius: 4px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
}

*, *::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: 400 var(--fs-body)/1.65 var(--text);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--pencil); }
:focus-visible { outline: 2px solid var(--pencil); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.05;
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 12px; z-index: 10; padding: 8px 12px; background: var(--ink); color: var(--paper); }

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--ink);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 var(--fs-body)/1 var(--text);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.mark { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.mark-star { fill: var(--pencil); stroke: none; }
.top-nav { display: flex; gap: clamp(14px, 3vw, 32px); font: 500 var(--fs-base)/1 var(--text); }
.top-nav a { padding: 8px 0; text-decoration: none; }

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  align-items: center;
  gap: 48px clamp(32px, 5vw, 72px);
  padding: clamp(56px, 9vw, 120px) 0 clamp(56px, 8vw, 104px);
}
.hero h1 {
  max-width: 14ch;
  margin-bottom: 28px;
  font-size: var(--fs-h1);
  font-weight: 450;
  line-height: 1;
  letter-spacing: -0.025em;
}
.lede { max-width: 34em; font-size: var(--fs-lg); }
.hero-art { order: 2; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin: 32px 0 0; }
.text-link { font-weight: 600; text-underline-offset: 0.25em; }

/* Hero drawing: the logo mark, large */
.art { display: block; width: 100%; height: auto; overflow: visible; }
.art .ink { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.art .faint line { stroke: var(--rule); stroke-width: 1.2; }
.art .tick line, .art .leader { fill: none; stroke: var(--graphite); stroke-width: 1.2; }
.art .mesa { fill: var(--tint); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.art .star { fill: var(--pencil); }
.art .label { fill: var(--graphite); font: 500 11px/1 var(--text); letter-spacing: 0.1em; }

.button {
  display: inline-block;
  padding: 14px 22px;
  background: var(--ink);
  color: var(--paper);
  font: 600 var(--fs-base)/1.2 var(--text);
  text-decoration: none;
  border-radius: var(--radius);
}
.button:hover { background: var(--pencil); color: var(--paper); }

/* Sections */

.block {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 24px clamp(32px, 6vw, 96px);
  padding: clamp(48px, 7vw, 88px) 0;
  border-top: 1px solid var(--ink);
}
.block-title { font-size: var(--fs-h2); font-weight: 450; }

/* Services: one lead item, then three columns split by hairlines */
.service-lead { padding-bottom: 32px; border-bottom: 1px solid var(--rule); }
.service-lead h3 { margin-bottom: 12px; font-size: var(--fs-h2s); font-weight: 450; }
.service-lead p { max-width: 36em; margin: 0; font-size: var(--fs-lg); }
.service-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.service-list > div { padding: 28px 28px 0; border-left: 1px solid var(--rule); }
.service-list > div:first-child { padding-left: 0; border-left: 0; }
.service-list > div:last-child { padding-right: 0; }
.service-list dt { margin-bottom: 8px; font: 500 var(--fs-h4)/1.15 var(--display); letter-spacing: -0.01em; }
.service-list dd { margin: 0; color: var(--graphite); font-size: var(--fs-base); }

/* Packages: a two-line price list, prices set on the right like a shop's menu board */
.packages-intro { max-width: 36em; margin-bottom: 8px; font-size: var(--fs-lg); }
.packages { margin: 0; padding: 0; list-style: none; }
.package {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 48px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.package h3 { grid-column: 1; margin-bottom: 4px; font-size: var(--fs-h3); font-weight: 450; }
.package > p { grid-column: 1; max-width: 34em; margin: 0; }
.package > .price { grid-column: 2; grid-row: 1 / span 2; margin: 0; text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.price-figure { display: block; font: 450 var(--fs-h2)/1 var(--display); letter-spacing: -0.02em; white-space: nowrap; }
.price-note { display: block; margin-top: 6px; color: var(--graphite); font-size: var(--fs-xs); }
.price-note strong { color: var(--ink); font-weight: 600; }
.packages-notes { margin: 24px 0 0; color: var(--graphite); }
.packages-notes p { max-width: 40em; margin: 0 0 8px; }
.packages-cta { margin: 28px 0 0; }

/* Work */

.work, .side { margin: 0; padding: 0; list-style: none; }
.work-item {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 20px 36px;
  padding: 0 0 44px;
}
.work-item + .work-item { padding-top: 44px; border-top: 1px solid var(--rule); }
.work-item img { width: 100%; aspect-ratio: 10 / 7; object-fit: cover; object-position: top; border: 1px solid var(--rule); background: var(--card); border-radius: var(--radius); }
/* Web dashboard with the mobile app overlapping its corner. */
.duo { position: relative; padding: 0 14% 10% 0; }
.work-item .duo-phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 36%;
  aspect-ratio: 600 / 1252;
  object-fit: cover;
  object-position: top;
  border: 5px solid #0E0F12;
  border-radius: 22px;
  box-shadow: 0 0 0 1px var(--rule);
}
.work h3 { margin-bottom: 6px; font-size: var(--fs-h3); }
.work h3 a, .side h4 a { text-decoration: none; background: linear-gradient(var(--pencil), var(--pencil)) no-repeat 0 100% / 100% 2px; padding-bottom: 2px; }
.work-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 0; }
.work-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-bottom: 12px; color: var(--graphite); font: 500 var(--fs-xs)/1.3 var(--text); }
.built-on, .built-own { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.built-on::before { content: ""; width: 1.35em; height: 1.35em; margin: -2px 0; background: var(--pencil); -webkit-mask: url(/assets/ristra-mark.svg) center / contain no-repeat; mask: url(/assets/ristra-mark.svg) center / contain no-repeat; }
.built-on:hover { border-color: var(--pencil); }
.built-own { padding-left: 9px; border-style: dashed; color: var(--graphite); }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--graphite); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-live { color: var(--live); }
.status-dev { color: var(--dev); }

.side-title { margin: 28px 0 18px; padding-top: 36px; border-top: 1px solid var(--ink); font-size: var(--fs-h2s); }
.side li { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; padding: 22px 0; border-top: 1px solid var(--rule); }
.side li:first-child { border-top: 0; padding-top: 0; }
.side img { width: 200px; aspect-ratio: 16 / 10; object-fit: cover; object-position: center 45%; border: 1px solid var(--rule); border-radius: var(--radius); }
.side h4 { margin-bottom: 4px; font-size: var(--fs-h4); }
.side p:last-child { margin: 0; }

/* Contact */

/* A dark panel in both themes: re-point the tokens so the form inside just works. */
.contact {
  --paper: light-dark(#1A1C20, #202226);
  --ink: #ECEAE4;
  --graphite: #A2A6AE;
  --rule: #3A3D44;
  --card: #25272C;
  --tint: #2A2C31;
  --pencil: #F0644F;
  --field-line: #6E727B;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 40px clamp(32px, 6vw, 96px);
  align-items: start;
  margin-block: clamp(24px, 4vw, 48px) clamp(48px, 7vw, 88px);
  padding: clamp(36px, 6vw, 72px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  color-scheme: dark;
}
.contact a:hover { color: var(--pencil); }
.contact h2 { max-width: 12ch; margin-bottom: 24px; font-size: var(--fs-h1s); font-weight: 450; letter-spacing: -0.025em; line-height: 1; }
.contact-intro p { max-width: 30em; font-size: var(--fs-lg); }
.contact-direct { color: var(--graphite); }

.inquiry { display: grid; gap: 18px; }
.inquiry[hidden] { display: none; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 500; font-size: var(--fs-sm); }
.optional { color: var(--graphite); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--field-line, var(--rule));
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-base);
}
.field ::placeholder { color: var(--graphite); opacity: 1; }
.field textarea { resize: vertical; min-height: 7.5em; }
.field :focus-visible { outline: 2px solid var(--pencil); outline-offset: 0; border-color: transparent; }
.field [aria-invalid="true"] { border-color: var(--pencil); }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--pencil); }
.check label { font-weight: 500; font-size: var(--fs-sm); }
.check-note { grid-column: 2; margin: 0; color: var(--graphite); font-size: var(--fs-xs); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.botcheck { display: flex; align-items: center; gap: 12px; }
.botcheck-art { flex: none; width: 60px; height: 45px; overflow: visible; }
.botcheck-ring { fill: none; stroke: var(--graphite); stroke-width: 1.4; }
.botcheck-mesa { fill: var(--tint); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.botcheck-star { fill: var(--pencil); transform: translateY(var(--rise, 22px)); transition: transform 0.25s ease-out; }
.botcheck-text { margin: 0; color: var(--graphite); font-size: var(--fs-xs); }
.botcheck[data-state="done"] .botcheck-text { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .botcheck-star { transition: none; } }
.inquiry .button { justify-self: start; border: 0; cursor: pointer; }
.inquiry-status { margin: 0; font-weight: 500; }
.inquiry-status:empty { display: none; }

/* Footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px 32px;
  padding: 24px 0 calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ink);
  color: var(--graphite);
  font: 400 var(--fs-xs)/1.5 var(--text);
}
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
.foot nav a { display: inline-block; padding: 4px 0; }

/* Privacy and 404 */

.page { padding: clamp(48px, 9vw, 112px) 0 clamp(56px, 8vw, 96px); }
.page h1 { max-width: 12ch; margin-bottom: 28px; font-size: var(--fs-h1s); font-weight: 450; letter-spacing: -0.025em; line-height: 1; }
.page .prose { max-width: 40rem; }
.page h2 { margin: 44px 0 10px; font-size: var(--fs-h3); }
.page ul { padding-left: 1.2em; }
.page li { margin-bottom: 10px; }
.page strong { font-weight: 600; }
.page-date { color: var(--graphite); font: 500 var(--fs-xs)/1.3 var(--text); }

/* Narrow screens */

@media (min-width: 861px) and (max-width: 1100px) {
  .service-list { grid-template-columns: minmax(0, 1fr); }
  .service-list > div { padding: 22px 0 0; border-left: 0; }
}
@media (max-width: 860px) {
  .block, .contact { grid-template-columns: minmax(0, 1fr); }
  /* Headline full width; the drawing sits beside the paragraph under it. */
  .hero { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "h h" "lede art" "cta cta"; column-gap: 16px; row-gap: 0; }
  .hero-copy { display: contents; }
  .hero h1 { grid-area: h; max-width: none; }
  .hero .lede { grid-area: lede; align-self: center; }
  .hero-cta { grid-area: cta; }
  .hero-art { grid-area: art; align-self: center; width: clamp(110px, 30vw, 200px); }
  .hero-art .label, .hero-art .leader, .hero-art .tick { display: none; }
  .work-item { grid-template-columns: minmax(0, 1fr); }
  .side li { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .side img { width: 100%; }
}
@media (max-width: 600px) {
  .package { grid-template-columns: minmax(0, 1fr); }
  .package h3, .package > p, .package > .price { grid-column: 1; grid-row: auto; }
  .package > .price { text-align: left; margin: 2px 0 8px; }
  .service-list { grid-template-columns: minmax(0, 1fr); }
  .service-list > div { padding: 22px 0 0; border-left: 0; }
  .contact { margin-inline: auto; padding: 28px 20px; }
}
@media (max-width: 520px) {
  .field-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .top { flex-wrap: wrap; }
  .top-nav { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.nowrap { white-space: nowrap; }
