:root {
  --ink: #111418;
  --body: #3F4650;
  --muted: #6B727C;
  --rule: #E3E5E8;
  --paper: #FFFFFF;
  --stone: #F6F6F4;
  --navy: #0B2545;
  --navy-2: #163A66;
  --max: 1200px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-underline-offset: 3px; }
p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--ink); }
h1, h2 { font-family: "Source Serif 4", Georgia, serif; font-weight: 500; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4rem); line-height: 1.06; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); line-height: 1.12; }
h3 { font-size: 1.12rem; line-height: 1.35; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.eyebrow { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.lede { font-size: 1.15rem; color: var(--body); }
.muted { color: var(--body); }
.skip { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
section { padding: clamp(72px, 9vw, 112px) 0; }
.stone { background: var(--stone); }
.rule-top { border-top: 1px solid var(--rule); }
.stack-sm > * + * { margin-top: 12px; }
.stack > * + * { margin-top: 18px; }

/* Buttons and links */
.btn {
  display: inline-block; padding: 13px 22px; font: inherit; font-weight: 600; font-size: 0.96rem; cursor: pointer;
  text-decoration: none; border: 1px solid var(--navy); border-radius: 2px; transition: background .15s, color .15s;
}
.btn-solid { background: var(--navy); color: #fff; }
.btn-solid:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: #EEF2F7; }
.btn-light { background: #fff; color: var(--navy); border-color: #fff; }
.btn-light:hover { background: #E6ECF4; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-outline-light:hover { border-color: #fff; }
.textlink { font-weight: 600; font-size: 0.96rem; color: var(--ink); text-decoration: underline; text-decoration-color: #C8CCD2; text-decoration-thickness: 2px; }
.textlink:hover { text-decoration-color: var(--navy); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 30px; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: rgba(255,255,255,.97); position: sticky; top: 0; z-index: 50; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink); flex: none; }
.brand img { height: 30px; width: auto; }
.brand span { padding-left: 16px; border-left: 1px solid var(--rule); font-size: 0.82rem; line-height: 1.25; color: var(--body); }
.primary { display: flex; align-items: center; gap: 26px; }
.primary a { color: var(--body); text-decoration: none; font-size: 0.93rem; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
.primary a:hover { color: var(--ink); }
.primary a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--navy); }
.primary .btn { padding: 9px 16px; color: #fff; border-bottom: 1px solid var(--navy); }
.menu-btn { display: none; background: none; border: 1px solid var(--rule); border-radius: 2px; padding: 8px 12px; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; color: var(--ink); }
@media (max-width: 960px) {
  .menu-btn { display: block; }
  .primary { display: none; position: absolute; top: 76px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--rule); flex-direction: column; align-items: stretch; gap: 0; padding: 8px 28px 20px; }
  .primary.open { display: flex; }
  .primary a { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .primary a[aria-current="page"] { border-bottom-color: var(--rule); color: var(--navy); }
  .primary .btn { margin-top: 14px; text-align: center; }
}
@media (max-width: 520px) { .brand span { display: none; } }

/* Page hero (inner pages) */
.page-hero { padding: clamp(56px, 8vw, 96px) 0 clamp(48px, 6vw, 72px); border-bottom: 1px solid var(--rule); }
.page-hero h1 { margin-top: 12px; max-width: 18ch; }
.page-hero .lede { margin-top: 20px; max-width: 640px; }

/* Home hero */
.hero { padding: clamp(64px, 9vw, 112px) 0 0; }
.hero .tagline { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hero-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 64px; align-items: end; margin-top: 18px; }
.hero-grid > * { min-width: 0; }
.hero h1 { max-width: 22ch; font-size: clamp(2.4rem, 5.2vw, 3.7rem); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 24px; } }
.showcase { margin-top: clamp(56px, 8vw, 88px); display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; }
.showcase figure { margin: 0; }
.showcase img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 1px solid var(--rule); }
.showcase figcaption { margin-top: 10px; font-size: 0.84rem; color: var(--muted); }
@media (max-width: 760px) { .showcase { grid-template-columns: 1fr 1fr; } .showcase figure:first-child { grid-column: 1 / -1; } }

/* Three promises */
.promises { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: clamp(56px, 8vw, 88px); }
.promises div { padding: 28px 28px 28px 0; }
.promises div + div { padding-left: 28px; border-left: 1px solid var(--rule); }
.promises h3 { font-family: "Source Serif 4", Georgia, serif; font-weight: 500; font-size: 1.5rem; }
.promises p { margin-top: 8px; color: var(--body); font-size: 0.96rem; }
@media (max-width: 760px) { .promises { grid-template-columns: 1fr; } .promises div, .promises div + div { padding: 22px 0; border-left: 0; } .promises div + div { border-top: 1px solid var(--rule); } }

/* Section heading row */
.head { max-width: 680px; margin-bottom: 44px; }
.head h2 { margin-top: 12px; }
.head p.muted { margin-top: 16px; }
.head-row { display: flex; justify-content: space-between; align-items: end; gap: 24px 40px; flex-wrap: wrap; margin-bottom: 44px; }
.head-row .head { margin-bottom: 0; }

/* Two-column split */
.split { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 72px; }
.split > * { min-width: 0; }
.split .side h2 { margin-top: 12px; }
.split .side p.muted { margin-top: 18px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 36px; } }

/* Ruled list (services, records) */
.ruled { list-style: none; margin: 0; padding: 0; }
.ruled > li { padding: 26px 0; border-top: 1px solid var(--rule); }
.ruled > li:last-child { border-bottom: 1px solid var(--rule); }
.ruled.two > li { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 28px; }
.ruled p { color: var(--body); font-size: 0.97rem; }
.ruled small { display: block; margin-top: 8px; color: var(--muted); font-size: 0.87rem; }
@media (max-width: 620px) { .ruled.two > li { grid-template-columns: 1fr; gap: 8px; } }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.cell { border-top: 2px solid var(--ink); padding-top: 18px; }
.cell .n { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.cell h3 { margin: 6px 0 8px; }
.cell p { font-size: 0.95rem; color: var(--body); }
.cell.light { border-top: 1px solid var(--rule); }

/* Projects */
.project a.shot { display: block; overflow: hidden; border: 1px solid var(--rule); background: #fff; }
.project img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform .4s ease; }
.project a.shot:hover img { transform: scale(1.02); }
.project .kind { margin-top: 18px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.project h3 { margin-top: 4px; }
.project p.desc { margin-top: 8px; font-size: 0.95rem; color: var(--body); }
.project .result { margin-top: 10px; font-size: 0.92rem; font-weight: 600; }
.project .visit { display: inline-block; margin-top: 12px; font-size: 0.9rem; font-weight: 600; }

/* Case study */
.case { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: start; }
.case > * { min-width: 0; }
.case + .case { margin-top: 88px; padding-top: 88px; border-top: 1px solid var(--rule); }
.case img { width: 100%; border: 1px solid var(--rule); background: #fff; }
.case h2 { margin-top: 8px; }
.case .summary { margin-top: 16px; color: var(--body); }
.facts { margin: 26px 0 0; display: grid; gap: 0; }
.facts div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--rule); }
.facts div:last-child { border-bottom: 1px solid var(--rule); }
.facts dt { font-size: 0.86rem; font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; font-size: 0.95rem; }
.case .textlink { display: inline-block; margin-top: 22px; }
@media (max-width: 900px) { .case { grid-template-columns: 1fr; gap: 28px; } .facts div { grid-template-columns: 110px 1fr; } }
.label-tag { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 3px 9px; border: 1px solid var(--rule); border-radius: 2px; color: var(--body); background: #fff; }

/* Data table */
table.data { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
table.data th, table.data td { text-align: left; vertical-align: top; padding: 16px 0; border-top: 1px solid var(--rule); }
table.data tr:last-child th, table.data tr:last-child td { border-bottom: 1px solid var(--rule); }
table.data th { width: 32%; font-weight: 600; padding-right: 24px; }
table.data td { color: var(--body); }
.code { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; display: inline-block; min-width: 4.4em; }

/* Notice box */
.notice { border: 1px solid var(--rule); background: #fff; padding: 26px 28px; }
.notice h3 { margin-bottom: 8px; }
.notice p { color: var(--body); font-size: 0.96rem; }

/* Form */
form.inquiry { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
form.inquiry .full { grid-column: 1 / -1; }
form.inquiry label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
form.inquiry label .opt { font-weight: 400; color: var(--muted); }
form.inquiry input, form.inquiry select, form.inquiry textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1px solid #C8CCD2; border-radius: 2px; padding: 12px 14px;
}
form.inquiry textarea { min-height: 160px; resize: vertical; }
form.inquiry input:focus, form.inquiry select:focus, form.inquiry textarea:focus { outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy); }
form.inquiry fieldset { border: 0; padding: 0; margin: 0; }
form.inquiry legend { font-size: 0.9rem; font-weight: 600; margin-bottom: 10px; padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
form.inquiry .choices label { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; border: 1px solid #C8CCD2; border-radius: 2px; padding: 10px 14px; margin: 0; cursor: pointer; }
form.inquiry .choices input { width: auto; padding: 0; margin: 0; accent-color: var(--navy); }
form.inquiry .choices label:has(input:checked) { border-color: var(--navy); background: #EEF2F7; }
.form-note { font-size: 0.88rem; color: var(--muted); }
@media (max-width: 620px) { form.inquiry { grid-template-columns: 1fr; } }

/* CTA band */
.cta { background: var(--navy); color: #fff; }
.cta h2 { color: #fff; max-width: 20ch; }
.cta p { color: #C3CDDB; margin-top: 16px; max-width: 560px; }
.cta-grid { display: grid; grid-template-columns: 1.3fr auto; gap: 40px; align-items: end; }
@media (max-width: 760px) { .cta-grid { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: #0A1A30; color: #A9B4C4; font-size: 0.9rem; padding: 56px 0 32px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h4 { color: #fff; font-size: 0.86rem; font-weight: 600; margin-bottom: 12px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: #D5DCE6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.foot-id { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; }
.foot-id img { width: 32px; height: 32px; }
.foot-grid p { margin-top: 14px; max-width: 320px; }
.foot-base { margin-top: 44px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 0.84rem; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .project img { transition: none; } }

/* Research home showcase: natural-aspect product shots, app left, dashboard stacked right */
.showcase.natural { grid-template-columns: 1.2fr 1fr; align-items: start; }
.showcase.natural img { aspect-ratio: auto; object-fit: initial; }
.showcase.natural .stacked { display: grid; gap: 16px; }
@media (max-width: 760px) { .showcase.natural { grid-template-columns: 1fr; } }
