/* Mango AI Limited, site styles.
   Colours and spacing live in :root. Sections are ordered as they appear on the pages. */

:root {
  --bg: #FFFFFF;
  --surface: #F3F4F6;
  --ink: #0E1013;
  --text: #2B2F36;
  --muted: #5B6068;
  --line: #E3E5E9;
  --line-alt: #D9DCE1;
  --field: #C9CDD3;
  --grid: #E9EBEF;
  --accent: #F0A01E;
  --accent-soft: #FDF0D8;
  --dark: #0E1013;
  --on-dark: #F3F4F6;
  --on-dark-muted: rgba(243, 244, 246, 0.68);
  --on-dark-line: rgba(243, 244, 246, 0.14);
  --error: #B42318;
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --gap: clamp(16px, 2.5vw, 32px);
  --section: clamp(72px, 10vw, 136px);
  --radius: 4px;
  --radius-media: 6px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
address { font-style: normal; }
::selection { background: var(--accent-soft); color: var(--ink); }

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.6vw, 4.75rem); line-height: 1.02; letter-spacing: -0.04em; }
h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); letter-spacing: -0.03em; }
h3 { font-size: 1.25rem; letter-spacing: -0.015em; line-height: 1.25; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }
.section-dark :focus-visible, .cta-band :focus-visible, .site-footer :focus-visible { outline-color: var(--accent); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--radius);
  font: inherit; font-size: 1rem; font-weight: 600; line-height: 1;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #262A31; }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:hover { background: #F5B23F; }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 0.95rem; }
.btn:disabled { opacity: 0.6; cursor: progress; }

.arrow { width: 16px; height: 16px; flex: none; transition: transform 0.2s ease; }
.btn:hover .arrow, .link-arrow:hover .arrow, .card:hover .arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px;
  font-weight: 600; color: var(--ink); text-decoration: none;
}
.link-arrow span:not(.visually-hidden) {
  text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 6px; text-decoration-color: rgba(14, 16, 19, 0.3);
  transition: text-decoration-color 0.15s ease;
}
.link-arrow:hover span { text-decoration-color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 76px;
}
/* Logo: pixel mango mark + monospace name */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
}
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-name {
  font-family: var(--font-mono);
  font-size: 1.125rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1;
}

.site-nav ul { display: flex; align-items: center; gap: 36px; }
.site-nav a:not(.btn) {
  position: relative; text-decoration: none;
  font-size: 0.975rem; font-weight: 500; color: var(--muted);
  transition: color 0.15s ease;
}
.site-nav a:not(.btn):hover, .site-nav a:not(.btn)[aria-current="page"] { color: var(--ink); }
.site-nav a:not(.btn)[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--accent);
}

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius);
  border: 1px solid var(--line-alt); background: transparent; color: var(--ink); cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---------- Shared labels and section heads ---------- */
.kicker, .section-label {
  display: flex; align-items: center; gap: 10px; margin: 0;
  font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; line-height: 1.4;
}
.kicker { color: var(--muted); margin-bottom: clamp(20px, 3vw, 32px); }
.kicker::before, .section-label::before {
  content: ""; width: 8px; height: 8px; background: var(--accent); flex: none;
  align-self: flex-start; margin-top: calc((1.4em - 8px) / 2);
}

/* Faint pixel grid behind page headings, echoing the logo */
.hero, .page-hero { position: relative; isolation: isolate; }
.hero::before, .page-hero::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; z-index: -1;
  height: min(100%, 560px); pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center top;
  -webkit-mask-image: linear-gradient(#000 35%, transparent);
  mask-image: linear-gradient(#000 35%, transparent);
}

.section { padding: var(--section) 0; }
.section-tight { padding-top: 0; }
.section-alt { background: var(--surface); }
.section-dark { background: var(--dark); color: var(--on-dark-muted); }
.section-dark h2, .section-dark h3 { color: var(--on-dark); }
.section-dark .section-intro,
.section-dark .steps-row p { color: var(--on-dark-muted); }
.section-dark .steps-row li { border-top-color: var(--on-dark-line); }
.section-dark .step-num { color: var(--accent); }

.section-head {
  row-gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-dark .section-head { border-top-color: rgba(243, 244, 246, 0.4); }
.section-label { grid-column: 1 / span 3; align-self: start; padding-top: 0.75em; color: var(--ink); }
.section-dark .section-label { color: var(--on-dark); }
.section-head-body { grid-column: 4 / -1; }
.section-head h2 { max-width: 18ch; }
.section-intro { margin-top: 20px; font-size: 1.15rem; color: var(--muted); max-width: 54ch; }
.section-foot { margin-top: clamp(28px, 4vw, 40px); }

/* ---------- Media ---------- */
.media img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius-media);
  background: var(--surface);
}
.ratio-wide img { aspect-ratio: 21 / 9; }
.ratio-landscape img { aspect-ratio: 3 / 2; }
.ratio-portrait img { aspect-ratio: 4 / 5; }

/* ---------- Home hero ---------- */
.hero { padding: clamp(56px, 8vw, 112px) 0 0; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 32px clamp(32px, 5vw, 80px); align-items: end;
}
.hero h1 { font-size: clamp(2.4rem, 6.2vw, 5.5rem); line-height: 1; max-width: 13ch; }
.hero-lead { font-size: clamp(1.075rem, 1.4vw, 1.2rem); color: var(--muted); max-width: 44ch; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.hero-media { margin-top: clamp(40px, 6vw, 72px); }
.hero-media img { object-position: 50% 40%; }

.facts-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(32px, 4vw, 48px) 0 0;
  border-top: 1px solid var(--ink);
}
.facts-strip div { padding: 20px 24px 0; }
.facts-strip div:first-child { padding-left: 0; }
.facts-strip div + div { border-left: 1px solid var(--line); }
.facts-strip dt { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); margin-bottom: 6px; }
.facts-strip dd {
  margin: 0; color: var(--ink); font-weight: 600;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem); letter-spacing: -0.02em; line-height: 1.25;
}

/* ---------- Sub-page hero ---------- */
.page-hero { padding: clamp(48px, 7vw, 96px) 0 clamp(40px, 5vw, 64px); }
.page-hero-grid { row-gap: 24px; align-items: end; }
.page-hero h1 { grid-column: 1 / span 8; max-width: 16ch; }
.page-hero-intro { grid-column: 9 / -1; font-size: 1.125rem; color: var(--muted); max-width: 42ch; }
.page-hero-media { margin-top: clamp(40px, 5vw, 64px); }

/* ---------- Cards (home services overview) ---------- */
.cards {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.card {
  display: flex; flex-direction: column;
  padding: clamp(28px, 3.5vw, 44px);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none;
  transition: background-color 0.2s ease;
}
.card:hover { background: var(--surface); }
.card h3 { font-size: clamp(1.35rem, 2vw, 1.6rem); margin-bottom: 12px; }
.card p { color: var(--muted); max-width: 46ch; margin-bottom: 24px; }
.card-link {
  margin-top: auto; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--ink); font-size: 0.975rem;
}

/* ---------- Split (image + text) ---------- */
.split { row-gap: 32px; align-items: center; }
.split-media { grid-column: 1 / span 6; }
.split-body { grid-column: 8 / span 5; }
.split-reverse .split-media { grid-column: 7 / span 6; order: 2; }
.split-reverse .split-body { grid-column: 1 / span 5; order: 1; }
.split-body h2 { font-size: clamp(1.8rem, 3.4vw, 2.75rem); margin-bottom: 20px; }
.split-body > p { color: var(--muted); font-size: 1.075rem; max-width: 48ch; }
.split + .split { margin-top: clamp(64px, 9vw, 120px); }

.split-label { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; color: var(--muted); margin-bottom: 14px; }
.check-list { margin-top: 24px; border-top: 1px solid var(--line); }
.check-list li {
  display: flex; align-items: baseline; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 0.975rem;
}
.check-list li::before {
  content: ""; width: 6px; height: 6px; background: var(--accent);
  flex: none; transform: translateY(-2px);
}

/* ---------- Steps ---------- */
.steps-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.steps-row li { padding-top: 20px; border-top: 1px solid var(--line-alt); }
.step-num { display: block; font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; color: var(--muted); margin-bottom: 14px; }
.steps-row h3 { margin-bottom: 8px; }
.steps-row p { color: var(--muted); font-size: 1rem; }

.steps-detail .step {
  row-gap: 12px; align-items: baseline;
  padding: clamp(28px, 4vw, 48px) 0;
  border-top: 1px solid var(--line-alt);
}
.steps-detail .step:last-child { border-bottom: 1px solid var(--line-alt); }
.steps-detail .step-num { grid-column: 1 / span 3; margin: 0; }
.steps-detail h2 { grid-column: 4 / span 4; font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.step-body { grid-column: 8 / span 5; }
.step-body p { color: var(--muted); }
.step-outcome {
  margin-top: 16px; padding: 14px 16px;
  background: var(--surface); border-radius: var(--radius);
  font-size: 0.95rem; color: var(--text);
}
.step-outcome strong { color: var(--ink); font-weight: 600; }

/* ---------- Principles ---------- */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.principles li { padding-top: 20px; border-top: 1px solid var(--line-alt); }
.principles h3 { margin-bottom: 10px; }
.principles p { color: var(--muted); }
.section-dark .principles li { border-top-color: var(--on-dark-line); }
.section-dark .principles p { color: var(--on-dark-muted); }

/* ---------- Company details ---------- */
.details { margin: 0; border-top: 1px solid var(--line-alt); }
.details div {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line-alt);
}
.details dt { color: var(--muted); }
.details dd { margin: 0; color: var(--ink); font-weight: 500; }
.details-wrap { grid-column: 4 / -1; }

/* ---------- Contact ---------- */
.contact-body { row-gap: 48px; align-items: start; }
.contact-info { grid-column: 1 / span 3; }
.info-block + .info-block { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.info-title { font-size: 0.95rem; font-weight: 600; color: var(--ink); margin-bottom: 10px; letter-spacing: 0; }
.info-block address { margin-bottom: 4px; line-height: 1.55; }
.next-steps { counter-reset: next; }
.next-steps li {
  counter-increment: next;
  display: grid; grid-template-columns: 22px minmax(0, 1fr);
  padding: 4px 0; font-size: 0.975rem; color: var(--muted);
}
.next-steps li::before { content: counter(next) "."; color: var(--ink); font-weight: 600; }

.form-card {
  grid-column: 4 / -1;
  background: var(--surface); border-radius: var(--radius-media);
  padding: clamp(24px, 4vw, 48px);
}
.field { margin-bottom: 22px; }
.field label { display: block; font-size: 0.95rem; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.field .optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; min-height: 48px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--field); border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
.field input:hover, .field textarea:hover { border-color: #A9A59B; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(240, 160, 30, 0.3);
}
.field [aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: 0.9rem; font-weight: 500; margin: 6px 0 0; }
.field-error:empty { display: none; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
.form-actions {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-top: 8px;
}
.form-hint { margin: 0; font-size: 0.9rem; color: var(--muted); }
.form-status { margin: 20px 0 0; padding: 14px 16px; border-radius: var(--radius); font-size: 0.975rem; font-weight: 500; }
.form-status:empty { display: none; }
.form-status.is-info { background: var(--accent-soft); color: var(--ink); }
.form-status.is-success { background: #E3F1E0; color: #1E4620; }
.form-status.is-error { background: #FBE4E1; color: var(--error); }

/* ---------- Closing call to action ---------- */
.cta-band { background: var(--dark); color: var(--on-dark-muted); padding: clamp(64px, 8vw, 112px) 0; }
.cta-grid { row-gap: 28px; align-items: end; }
.cta-band h2 { grid-column: 1 / span 7; color: var(--on-dark); max-width: 16ch; }
.cta-body { grid-column: 9 / -1; }
.cta-body p { font-size: 1.075rem; margin-bottom: 24px; max-width: 40ch; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dark); color: var(--on-dark-muted);
  padding: clamp(48px, 6vw, 72px) 0 32px; font-size: 0.95rem;
  border-top: 1px solid var(--on-dark-line);
}
.footer-top { row-gap: 40px; padding-bottom: 48px; }
.footer-brand { grid-column: 1 / span 6; }
.footer-brand .brand { color: var(--on-dark); margin-bottom: 16px; }
.footer-brand p { max-width: 36ch; }
.footer-col { grid-column: span 3; }
.footer-title { color: var(--on-dark); font-weight: 600; margin-bottom: 12px; }
.footer-col li + li { margin-top: 6px; }
.footer-col a { text-decoration: none; transition: color 0.15s ease; }
.footer-col a:hover { color: var(--on-dark); }
.footer-col address { margin-bottom: 8px; }
.footer-col .map-link { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--on-dark-line); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 40px;
  padding-top: 24px; border-top: 1px solid var(--on-dark-line); font-size: 0.875rem;
}
.footer-bottom p { margin: 0; max-width: 80ch; }
.footer-bottom p:last-child { white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .page-hero h1 { grid-column: 1 / -1; }
  .page-hero-intro { grid-column: 1 / span 8; }
  .split-media, .split-reverse .split-media { grid-column: 1 / -1; order: 1; }
  .split-body, .split-reverse .split-body { grid-column: 1 / span 10; order: 2; }
  .steps-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .cta-band h2, .cta-body { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li a:not(.btn) { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
  .site-nav a:not(.btn)[aria-current="page"]::after { display: none; }
  .site-nav a:not(.btn)[aria-current="page"] { font-weight: 600; }
  .site-nav li:last-child { padding-top: 16px; }
  .site-nav .btn { width: 100%; min-height: 48px; }

  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .ratio-wide img { aspect-ratio: 16 / 10; }
  .section-label, .section-head-body,
  .page-hero-intro, .split-body, .split-reverse .split-body,
  .steps-detail .step-num, .steps-detail h2, .step-body,
  .details-wrap, .contact-info, .form-card { grid-column: 1 / -1; }
  .section-label { padding-top: 0; }
  .steps-detail .step { row-gap: 8px; }
  .contact-info { order: 2; }
  .principles { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-col { grid-column: span 6; }
}

@media (max-width: 700px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .facts-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts-strip div { padding: 16px; }
  .facts-strip div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .facts-strip div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hero-actions .btn, .form-actions .btn { width: 100%; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .steps-row { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
  .details div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ratio-wide img, .ratio-landscape img { aspect-ratio: 4 / 3; }
  .footer-col { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; }
  .footer-bottom p:last-child { white-space: normal; }
}

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