/* Simple Imagination site styles. Loaded only by pages under public/; the
   demos/ pages carry their own inline styles and never load this file. */

:root {
  --bg: #FFFEFA;
  --navy: #061C44;
  --panel: #102E64;
  --accent: #1C5CFA;
  --accent-hover: #1448D0;
  --text: #3B3F4C;
  --muted: #5F5B53;
  --label: #4A5878;
  --label-on-dark: #C9D4EA;
  --text-on-dark: #E4DED1;
  --heading-on-dark: #F8F4EC;
  --border: #E9E4D8;
  --card: #FFFFFF;
  --image-fill: #F1ECE1;
  --placeholder-border: #B3A994;
  --input-border: #847E73;
  --error: #B42318;

  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --radius-card: 10px;
  --radius-small: 6px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--navy); }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.on-dark :focus-visible { outline-color: var(--heading-on-dark); }

[id] { scroll-margin-top: 16px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -120px;
  z-index: 10;
  padding: 12px 18px;
  border-radius: var(--radius-small);
  background: var(--navy);
  color: #FFFFFF;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 16px; color: #FFFFFF; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ---------- Header and footer ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  padding-bottom: 28px;
}

.brand { display: flex; align-items: center; padding: 6px 0; }
.brand img { height: 40px; width: auto; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
}
.site-nav a { padding: 12px 0; text-decoration: none; }
.site-nav a.is-active { border-bottom: 2px solid var(--accent); }
.site-nav .nav-cta {
  padding: 12px 18px;
  border: 1.5px solid var(--navy);
  border-radius: var(--radius-small);
}
.site-nav .nav-cta:hover { border-color: var(--accent); }

@media (max-width: 480px) {
  .site-nav { gap: 4px 18px; }
  .site-nav .nav-cta { padding: 10px 14px; }
}

.site-footer { border-top: 1px solid var(--border); }
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 48px;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 40px;
  font-size: 15px;
  color: var(--muted);
}
.site-footer p { margin: 0; }
.footer-note { max-width: 560px; }
.footer-note a { font-weight: 600; }

/* ---------- Type ---------- */

.label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--label);
}
.on-dark .label { color: var(--label-on-dark); }

.display {
  margin: 24px 0 0;
  max-width: 980px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(40px, 6.4vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.section-title {
  margin: 12px 0 0;
  max-width: 720px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lead {
  margin: 32px 0 0;
  max-width: 640px;
  font-size: 20px;
  line-height: 1.55;
  color: var(--text);
}

.intro {
  margin: 16px 0 0;
  max-width: 620px;
  color: var(--text);
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
}

.btn {
  display: inline-block;
  padding: 15px 26px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-small);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-hover); color: #FFFFFF; }
.btn-primary:disabled { opacity: 0.7; cursor: progress; }

.btn-secondary { border-color: var(--navy); color: var(--navy); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* Dark panels: light fill or light outline, never the accent blue. */
.btn-light { background: var(--bg); color: var(--navy); }
.btn-light:hover { background: #FFFFFF; color: var(--navy); }

.btn-outline-light { border-color: var(--heading-on-dark); color: var(--heading-on-dark); }
.btn-outline-light:hover { background: rgba(248, 244, 236, 0.12); color: var(--heading-on-dark); }

.btn-email { overflow-wrap: anywhere; }

/* ---------- Cards with a single stretched link ---------- */

.has-link { position: relative; }
.card-link { text-decoration: none; color: inherit; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 3px; }
.on-dark .card-link:focus-visible::after { outline-color: var(--accent); }
.more { margin: 0; font-weight: 600; }
.has-link:hover .more { text-decoration: underline; }

/* ---------- Home: hero and stats ---------- */

.hero { padding-top: 72px; padding-bottom: 88px; }

.stats-band {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin: 0 auto;
  padding-top: 40px;
  padding-bottom: 40px;
  list-style: none;
}
.stat { flex: 1 1 260px; }
.stat-figure {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-text {
  margin: 10px 0 0;
  max-width: 300px;
  font-size: 15px;
  color: var(--muted);
}

/* ---------- Home: client work ---------- */

.section-work { padding-top: 96px; padding-bottom: 40px; }
.section-products { padding-top: 80px; padding-bottom: 40px; }

.feature-card {
  display: flex;
  flex-wrap: wrap;
  margin-top: 48px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--panel);
  color: var(--heading-on-dark);
}
.feature-card-body {
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 44px;
}
.feature-card-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.feature-card .card-link:hover { color: var(--heading-on-dark); }
.feature-card-text { margin: 0; max-width: 460px; color: var(--text-on-dark); }
.feature-card .more { margin-top: 8px; }
.feature-card-media { flex: 1 1 380px; min-width: 0; margin: 28px; }
.feature-card-media img {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-small);
  object-fit: cover;
  object-position: left top;
}

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
}
.card {
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card);
}
.card:hover { border-color: var(--label); }
.card-media img {
  width: 100%;
  height: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  object-fit: cover;
  object-position: left top;
}
.card-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.card-text { margin: 0; font-size: 16px; color: var(--text); }
.card .more { font-size: 16px; }

.earlier {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 15px;
  color: var(--muted);
}
.earlier h3 { margin: 0; font-size: inherit; font-weight: 600; color: var(--navy); }
.earlier ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Home: products ---------- */

.product-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 48px;
}
.product {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: var(--radius-card);
}
.product-media img {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-card);
  background: var(--image-fill);
  object-fit: cover;
  object-position: center top;
}
.product .label { margin-top: 8px; }
.product-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.product-text { margin: 0; font-size: 16px; color: var(--text); }
.product .more { font-size: 16px; }

/* ---------- Home: about ---------- */

.section-about {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  padding-top: 96px;
  padding-bottom: 40px;
}
.about-text { flex: 1 1 420px; }
.about-text p { margin: 16px 0 0; color: var(--text); }
.about-text .section-title + p { margin-top: 20px; }

.facts-card {
  flex: 1 1 320px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card);
  font-size: 16px;
}
.facts-card dt, .facts dt { font-size: 12px; }
.facts-card dd { margin: 4px 0 0; }

/* ---------- Home: contact ---------- */

.section-contact { padding-top: 80px; padding-bottom: 64px; }

.contact-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  align-items: flex-start;
  padding: clamp(32px, 6vw, 72px);
  border-radius: var(--radius-card);
  background: var(--panel);
  color: var(--heading-on-dark);
}
.contact-copy { flex: 1 1 380px; }
.contact-copy .section-title { margin: 0; }
.contact-copy p { margin: 16px 0 0; max-width: 520px; color: var(--text-on-dark); }
.contact-copy .btn { margin-top: 32px; }

.contact-form {
  flex: 1 1 420px;
  padding: 32px;
  border-radius: var(--radius-card);
  background: var(--card);
  color: var(--navy);
}
.contact-form :focus-visible { outline-color: var(--accent); }

.form-row { display: flex; flex-wrap: wrap; gap: 0 16px; }
.form-row .field { flex: 1 1 200px; }
.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-small);
  background: #FFFFFF;
  color: var(--navy);
  font: inherit;
  font-size: 16px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--accent);
}
.field [aria-invalid="true"] { border-color: var(--error); }
.field-optional { font-weight: 400; color: var(--muted); }

.form-error { margin: 0 0 16px; color: var(--error); font-size: 15px; }
.form-error:empty { display: none; }

.form-success h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: -0.01em;
}
.form-success p { margin: 8px 0 0; color: var(--text); }

/* ---------- Case studies and product pages ---------- */

.cs-hero { padding-top: 56px; padding-bottom: 48px; }
.back-link {
  display: inline-block;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
}
.cs-hero .label { margin-top: 20px; }
.cs-title {
  margin: 16px 0 0;
  max-width: 940px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(36px, 5.4vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.cs-hero .lead { margin-top: 28px; max-width: 680px; }
.cs-hero .actions { margin-top: 32px; }

.facts-band {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 48px;
  margin: 0 auto;
  padding-top: 32px;
  padding-bottom: 32px;
  font-size: 16px;
}
.facts > div { flex: 1 1 180px; }
.facts > .fact-wide { flex-basis: 220px; }
.facts dd { margin: 4px 0 0; font-weight: 500; }

.cs-shot { padding-top: 56px; }
.cs-shot img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.cs-shot-tall img {
  max-height: 720px;
  object-fit: cover;
  object-position: center top;
}

.cs-split {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 64px;
  padding-top: 88px;
}
.cs-h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.cs-split > .cs-h2 { flex: 1 1 260px; }
.cs-body { flex: 2 1 480px; color: var(--text); }
.cs-body > p { margin: 0; }
.cs-body > p + p { margin-top: 16px; }

.cs-items { display: flex; flex-direction: column; gap: 32px; }
.cs-items h3 { margin: 0; font-size: 20px; font-weight: 600; color: var(--navy); }
.cs-items p { margin: 8px 0 0; }
.cs-items p + p { margin-top: 16px; }

/* Content still to be written. Only rendered in local previews built with
   SHOW_PLACEHOLDERS=1 (see scripts/build-pages.mjs). */
.placeholder {
  margin: 0;
  padding: 16px 20px;
  border: 1.5px dashed var(--placeholder-border);
  border-radius: var(--radius-small);
  background: var(--card);
  font-size: 15px;
  color: var(--muted);
}
.placeholder-inline {
  border-bottom: 1.5px dashed var(--placeholder-border);
  color: var(--muted);
}

.cs-section { padding-top: 88px; }
.cs-section .intro { margin-top: 12px; max-width: 640px; }

.mini-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 20px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}
.mini-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card);
}
.mini-cards-sites { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.mini-card h3 { margin: 0; font-size: 18px; font-weight: 600; }
.mini-card p { margin: 8px 0 0; font-size: 15px; color: var(--text); }
.mini-card .mini-card-url { margin-top: 12px; font-size: 13px; }
.mini-card-url a { color: var(--muted); }
.mini-card-url a:hover { color: var(--accent); }
.mini-card-media img {
  width: 100%;
  height: 120px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  object-fit: cover;
  object-position: left top;
}

.cs-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding-top: 88px;
}
.cs-gallery picture { flex: 1 1 380px; min-width: 0; }
.cs-gallery img {
  width: 100%;
  height: 340px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  object-fit: cover;
  object-position: left top;
}

/* A lone screenshot spans the column at its natural shape. */
.cs-gallery > picture:only-child img { height: auto; }

.next-section { padding-top: 96px; padding-bottom: 64px; }
.next-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
  padding: clamp(32px, 5vw, 56px);
  border-radius: var(--radius-card);
  background: var(--panel);
  color: var(--heading-on-dark);
}
.next-copy { flex: 1 1 380px; }
.next-title {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.next-panel .actions { margin-top: 0; }
.next-panel .btn { padding: 15px 24px; }

/* ---------- 404 ---------- */

.not-found { padding-top: 72px; padding-bottom: 120px; }

/* ---------- Narrow screens ---------- */

@media (max-width: 600px) {
  .hero { padding-top: 48px; padding-bottom: 64px; }
  .section-work, .section-about { padding-top: 72px; }
  .section-products, .section-contact { padding-top: 64px; }
  .cs-split, .cs-section, .cs-gallery { padding-top: 64px; }
  .feature-card-body { padding: 32px 24px 8px; }
  .feature-card-media { margin: 24px; }
  .feature-card-media img { height: 220px; }
  .card { padding: 24px; }
  .facts-card { padding: 24px; }
  .contact-panel { padding: 32px 20px; }
  .contact-form { padding: 24px 20px; }
  .btn-email { padding: 15px 16px; font-size: 15px; }
  .cs-gallery img { height: 240px; }
  .cs-gallery > picture:only-child img { height: auto; }
  .stat-figure { font-size: 38px; }
}
