/*
 * Mad Labs site styles.
 *
 * Built on Atlassian Design System tokens. Token names are kept in comments
 * next to each value so the mapping to ADS stays visible.
 * https://atlassian.design/foundations/tokens
 */

:root {
  /* color.text */
  --ds-text: #172b4d;
  --ds-text-subtle: #44546f;
  --ds-text-subtlest: #626f86;
  --ds-text-brand: #0c66e4;
  --ds-text-inverse: #ffffff;
  --ds-link: #0c66e4;
  --ds-link-pressed: #0055cc;

  /* color.background */
  --ds-bg-brand-bold: #0c66e4;
  --ds-bg-brand-bold-hovered: #0055cc;
  --ds-bg-brand-bold-pressed: #09326c;
  --ds-bg-neutral: #091e420f;
  --ds-bg-neutral-hovered: #091e4224;
  --ds-bg-neutral-pressed: #091e424f;
  --ds-bg-accent-blue-subtlest: #e9f2ff;
  --ds-bg-accent-green-subtlest: #dcfff1;

  /* color.text.accent */
  --ds-text-accent-blue: #0055cc;

  /* color.border */
  --ds-border: #091e4224;
  --ds-border-brand: #0c66e4;
  --ds-border-focused: #388bff;

  /* elevation.surface */
  --ds-surface: #ffffff;
  --ds-surface-sunken: #f7f8f9;

  /* space.* on the 8px grid */
  --sp-050: 4px;
  --sp-100: 8px;
  --sp-150: 12px;
  --sp-200: 16px;
  --sp-300: 24px;
  --sp-400: 32px;
  --sp-500: 40px;
  --sp-600: 48px;
  --sp-800: 64px;
  --sp-1000: 80px;

  /* border.radius.* */
  --rad-100: 4px;
  --rad-200: 8px;
  --rad-300: 12px;

  /* font.family */
  --ff-body: "Atlassian Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif;

  color-scheme: light;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ds-surface);
  color: var(--ds-text);
  font-family: var(--ff-body);
  /* font.body.large */
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ds-link); text-decoration: none; }
a:hover { color: var(--ds-link-pressed); text-decoration: underline; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ds-border-focused);
  outline-offset: 2px;
  border-radius: var(--rad-100);
}

p { margin: 0; }
p + p { margin-top: var(--sp-200); }

.skip {
  position: absolute;
  left: -999px;
  top: var(--sp-100);
  z-index: 10;
  background: var(--ds-bg-brand-bold);
  color: var(--ds-text-inverse);
  padding: var(--sp-100) var(--sp-150);
  border-radius: var(--rad-100);
}
.skip:focus { left: var(--sp-100); }

.wrap {
  max-width: 1128px;
  margin: 0 auto;
  padding: 0 var(--sp-300);
}

/* ---------- typography scale (font.heading.*) ---------- */

.h-xxl { font-size: 35px; line-height: 40px; font-weight: 600; letter-spacing: -0.01em; }
.h-xl  { font-size: 29px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.h-l   { font-size: 24px; line-height: 28px; font-weight: 500; letter-spacing: -0.008em; }
.h-m   { font-size: 20px; line-height: 24px; font-weight: 500; letter-spacing: -0.008em; }

h1, h2, h3 { margin: 0; color: var(--ds-text); }

.body-s { font-size: 12px; line-height: 16px; }
.subtlest { color: var(--ds-text-subtlest); }

/* ---------- components ---------- */

/* Button (default / primary), 32px tall on the 8px grid */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-050);
  height: 32px;
  padding: 0 var(--sp-150);
  border: 0;
  border-radius: var(--rad-100);
  background: var(--ds-bg-neutral);
  color: var(--ds-text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.1s ease-out;
}
.btn:hover { background: var(--ds-bg-neutral-hovered); color: var(--ds-text); text-decoration: none; }
.btn:active { background: var(--ds-bg-neutral-pressed); }
.btn.primary { background: var(--ds-bg-brand-bold); color: var(--ds-text-inverse); }
.btn.primary:hover { background: var(--ds-bg-brand-bold-hovered); color: var(--ds-text-inverse); }
.btn.primary:active { background: var(--ds-bg-brand-bold-pressed); }
.btn.large { height: 40px; padding: 0 var(--sp-200); font-size: 16px; }

/* Card (elevation.surface.raised) */
.card {
  background: var(--ds-surface);
  border-radius: var(--rad-200);
  padding: var(--sp-300);
}

/* ---------- top navigation (56px) ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ds-surface);
  border-bottom: 1px solid var(--ds-border);
}
.top .wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-300);
  height: 56px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-100);
  color: var(--ds-text);
  font-weight: 600;
  font-size: 16px;
}
.brand:hover { text-decoration: none; color: var(--ds-text); }
.brand svg { width: 24px; height: 24px; }
.top nav { display: flex; gap: var(--sp-050); margin-left: var(--sp-200); }
.top nav a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 var(--sp-150);
  border-radius: var(--rad-100);
  color: var(--ds-text-subtle);
  font-size: 14px;
  font-weight: 500;
}
.top nav a:hover { background: var(--ds-bg-neutral); color: var(--ds-text); text-decoration: none; }
.top .cta { margin-left: auto; }

/* ---------- sections ---------- */

.hero {
  padding: var(--sp-1000) 0 var(--sp-800);
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--sp-600);
  align-items: center;
}
.hero h1 { font-size: 44px; line-height: 52px; font-weight: 700; letter-spacing: -0.012em; max-width: 18ch; margin: var(--sp-200) 0 var(--sp-300); }
.hero .lede { font-size: 18px; line-height: 28px; color: var(--ds-text-subtle); max-width: 56ch; }
.hero .actions { display: flex; gap: var(--sp-100); flex-wrap: wrap; margin-top: var(--sp-400); }

.section { padding: var(--sp-800) 0; }
.section.sunken { background: var(--ds-surface-sunken); }
.section-head { max-width: 62ch; margin-bottom: var(--sp-500); }
.section-head p { margin-top: var(--sp-150); color: var(--ds-text-subtle); }

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-400);
}
/* Contact banner */
.contact .card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-400);
  align-items: center;
  padding: var(--sp-500);
}
.contact p { color: var(--ds-text-subtle); max-width: 60ch; margin-top: var(--sp-100); }
.contact .mail { margin-top: var(--sp-150); font-weight: 500; }

footer {
  border-top: 1px solid var(--ds-border);
  padding: var(--sp-400) 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--ds-text-subtlest);
}
footer .wrap { display: flex; justify-content: space-between; gap: var(--sp-200); flex-wrap: wrap; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero { padding: var(--sp-600) 0; }
  .hero h1 { font-size: 35px; line-height: 40px; }
  .section { padding: var(--sp-600) 0; }
  .contact .card { grid-template-columns: 1fr; padding: var(--sp-400); }
}
@media (max-width: 640px) {
  .top nav { display: none; }
  .wrap { padding: 0 var(--sp-200); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- long-form prose (privacy) ---------- */

.prose { max-width: 62ch; }
.prose h2 { margin: var(--sp-400) 0 var(--sp-100); }
.prose h2:first-child { margin-top: 0; }
.prose p + p { margin-top: var(--sp-200); }

/* ---------- Mad Labs company homepage ---------- */

.home {
  font-size: 17px;
  line-height: 27px;
}
.home section, .home main { scroll-margin-top: 80px; }
.home .hero {
  padding: 80px 0 72px;
  background:
    radial-gradient(circle at 90% 12%, #e9f2ff 0, #e9f2ff 10%, transparent 35%),
    var(--ds-surface);
}
.home .section { padding: 72px 0; }
.home .hero h1 {
  font-size: clamp(2.75rem, 5.2vw, 4.25rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  max-width: 15ch;
}
.eyebrow {
  display: block;
  color: var(--ds-text-brand);
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: var(--sp-200);
}
.first-product {
  position: relative;
  padding: var(--sp-500);
  border: 1px solid #b8cdf5;
  border-top: 4px solid var(--ds-border-brand);
  border-radius: var(--rad-300);
  background: linear-gradient(145deg, #ffffff 0%, #e9f2ff 100%);
  box-shadow: 0 16px 40px #09326c1a;
}
.always-on {
  position: absolute;
  top: var(--sp-300);
  right: var(--sp-300);
  padding: 2px var(--sp-100);
  border-radius: 999px;
  background: var(--ds-bg-accent-green-subtlest);
  color: #216e4e;
  font-size: 0.75rem;
  line-height: 1.5;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}
.first-product h2 { font-size: 2rem; line-height: 1.2; }
.first-product .product-promise {
  margin: var(--sp-300) 0 var(--sp-200);
  font-size: 1.375rem;
  line-height: 1.4;
  font-weight: 500;
}
.first-product p { color: var(--ds-text-subtle); }
.first-product a { display: inline-block; margin-top: var(--sp-300); font-weight: 600; }
.home .btn { min-height: 44px; height: auto; white-space: normal; }
.home .btn.large { padding: var(--sp-150) var(--sp-200); }
.home .top .wrap { height: auto; min-height: 64px; }
.home .top nav a { min-height: 44px; height: auto; }
.home .brand { flex-shrink: 0; }
.home .two-col { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; }
.home .two-col p + p { margin-top: var(--sp-200); }
.home .h-xl { font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.2; }
.home .section-head { margin-bottom: var(--sp-400); }
.home .vision { border-top: 1px solid var(--ds-border); background: var(--ds-surface-sunken); }
.home .vision .section-head { padding-left: var(--sp-300); border-left: 4px solid var(--ds-border-brand); }
.vision-bridge { font-weight: 600; }
.home .product-heading { max-width: 72ch; }
.home .product-heading h2 { max-width: 24ch; }
.work-example {
  margin: var(--sp-600) 0 0;
  border: 1px solid var(--ds-border);
  border-radius: var(--rad-300);
  background: var(--ds-surface);
  box-shadow: 0 12px 32px #091e4212;
  overflow: hidden;
}
.work-example figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-100) var(--sp-200);
  padding: var(--sp-300);
  border-bottom: 1px solid var(--ds-border);
  background: #fbfcfd;
}
.work-example figcaption span { font-size: 0.875rem; color: var(--ds-text-subtle); }
.work-example figcaption .example-caption-title {
  display: grid;
  gap: 2px;
}
.work-example figcaption .example-kicker {
  color: var(--ds-text-brand);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.5;
  text-transform: uppercase;
}
.example-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); }
.example-story { padding: var(--sp-400); background: var(--ds-surface-sunken); }
.example-request { font-size: 1.125rem; line-height: 1.5; font-weight: 500; }
.work-steps { margin: var(--sp-300) 0 0; padding-left: var(--sp-300); }
.work-steps li { padding-left: var(--sp-050); }
.work-steps li + li { margin-top: var(--sp-200); }
.work-steps li::marker { color: var(--ds-text-brand); font-weight: 600; }
.work-steps p { margin-top: var(--sp-050); color: var(--ds-text-subtle); }
.example-result { min-width: 0; padding: var(--sp-400); align-self: center; }
.result-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-200); justify-content: space-between; }
.result-head .eyebrow { margin-bottom: var(--sp-050); }
.result-status { font-size: 0.875rem; color: #216e4e; background: var(--ds-bg-accent-green-subtlest); padding: var(--sp-050) var(--sp-100); border-radius: var(--rad-100); }
.table-scroll { max-width: 100%; overflow-x: auto; margin-top: var(--sp-300); }
.table-scroll:focus-visible { outline: 2px solid var(--ds-border-focused); outline-offset: 3px; }
.receipt-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.875rem; line-height: 1.5; }
.receipt-table th { background: var(--ds-surface-sunken); font-weight: 600; }
.receipt-table th, .receipt-table td { padding: var(--sp-150) var(--sp-100); border-bottom: 1px solid var(--ds-border); vertical-align: top; }
.receipt-table th:nth-child(3), .receipt-table td:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.receipt-table td:first-child { white-space: nowrap; }
.new-receipt { background: var(--ds-bg-accent-blue-subtlest); }
.new-label { display: block; font-size: 0.75rem; color: var(--ds-text-accent-blue); font-weight: 600; }
.result-note { margin-top: var(--sp-200); color: var(--ds-text-subtle); font-size: 0.875rem; line-height: 1.5; }
.project-example { border-top: 4px solid var(--ds-border-brand); }
.project-request { padding: var(--sp-400); max-width: 72ch; font-size: 1.25rem; line-height: 1.5; font-weight: 500; }
.project-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0 var(--sp-400); }
.project-flow li { position: relative; min-width: 0; padding: var(--sp-400); background: var(--ds-surface-sunken); border-left: 1px solid var(--ds-border); }
.project-flow li:first-child { border-left: 0; }
.project-flow li:last-child { background: var(--ds-bg-accent-blue-subtlest); }
.project-flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 50%;
  right: -6px;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--ds-border-brand);
  border-right: 2px solid var(--ds-border-brand);
  background: var(--ds-surface-sunken);
  transform: translateY(-50%) rotate(45deg);
}
.artifact-label { display: block; font-size: 0.875rem; line-height: 1.5; color: var(--ds-text-subtle); margin: var(--sp-200) 0 var(--sp-100); }
.artifact-context { color: var(--ds-text-subtle); }
.project-decision { padding: var(--sp-400); font-weight: 500; }
.control-note { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--sp-400); margin-top: var(--sp-500); padding: var(--sp-400); background: var(--ds-surface-sunken); border-radius: var(--rad-300); }
.control-note p { color: var(--ds-text-subtle); }
.models { position: relative; background: linear-gradient(135deg, #082f63 0%, #0c4b9c 100%); color: #ffffff; }
.models::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(#ffffff0d 1px, transparent 1px), linear-gradient(90deg, #ffffff0d 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.models .wrap { position: relative; }
.home .models h2, .home .models .eyebrow { color: #ffffff; }
.models p { color: #e9f2ff; }
.home .contact .card { box-shadow: none; border: 1px solid var(--ds-border); }
.home .contact .eyebrow { margin-bottom: var(--sp-150); }
.home footer { font-size: 0.875rem; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-600); max-width: none; }
.about-grid p + p { margin-top: 0; }
@media (max-width: 900px) {
  .home .hero { padding: var(--sp-600) 0; }
  .home .top nav { margin-left: 0; gap: 0; }
  .home .top nav a { padding: 0 var(--sp-100); }
  .home .top .wrap { gap: var(--sp-150); }
  .example-grid { grid-template-columns: 1fr; }
  .project-flow { grid-template-columns: 1fr; }
  .project-flow li { border-left: 0; border-top: 1px solid var(--ds-border); }
  .project-flow li:first-child { border-top: 0; }
  .project-flow li:not(:last-child)::after {
    top: auto;
    right: 50%;
    bottom: -6px;
    transform: translateX(50%) rotate(135deg);
  }
  .home .two-col { gap: var(--sp-400); }
}
@media (max-width: 640px) {
  .home { font-size: 16px; line-height: 25px; }
  .home .section { padding: var(--sp-600) 0; }
  .home .two-col, .control-note, .about-grid { grid-template-columns: 1fr; }
  .home .two-col { gap: var(--sp-200); }
  .home .two-col .section-head { margin-bottom: 0; }
  .home .hero h1 { max-width: 13ch; }
  .first-product { padding: var(--sp-400); }
  .always-on { position: static; display: table; margin: 0 0 var(--sp-300); }
  .work-example figcaption, .example-story, .example-result { padding: var(--sp-200); }
  .project-request, .project-flow li, .project-decision { padding: var(--sp-200); }
  .project-flow { padding: 0 var(--sp-200); }
  .home .top .wrap { flex-wrap: wrap; padding-top: var(--sp-100); padding-bottom: var(--sp-100); }
  .home .contact .card { padding: var(--sp-300); }
}
