/* Merveno corporate website
   Palette: ink #1D1E4F · indigo #4246B2 · lavender #C9C6F4 · mist #F5F5FA · white
            semantic (hero exam only): pass #1E7F55 · flag #A85A12
   Type:    Bricolage Grotesque (display) · Instrument Sans (text) · IBM Plex Mono (code), self-hosted, SIL OFL */

@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/BricolageGrotesque-Bold.woff") format("woff"); font-weight: 600 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/BricolageGrotesque-Regular.woff") format("woff"); font-weight: 300 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Regular.woff") format("woff"); font-weight: 300 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Bold.woff") format("woff"); font-weight: 600 800; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-Regular.woff") format("woff"); font-weight: 300 600; font-style: normal; font-display: swap; }


:root {
  --ink: #1D1E4F;
  --ink-2: #3A3C6E;
  --ink-soft: #5B5D84;
  --indigo: #4246B2;
  --indigo-deep: #2A2C78;
  --lavender: #C9C6F4;
  --lavender-soft: #E9E8FB;
  --mist: #F5F5FA;
  --white: #FFFFFF;
  --line: #DCDCEA;
  --pass: #1E7F55;
  --flag: #A85A12;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --text: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --space: clamp(72px, 10vw, 128px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--mist);
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--indigo); text-underline-offset: 0.18em; }
a:hover { color: var(--indigo-deep); }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 4.8vw, 4rem); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.08; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
section[id] { scroll-margin-top: 80px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 6px; }
.skip:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 600 1rem/1 var(--text); text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--indigo); color: var(--white); }
.btn-primary:hover { background: var(--indigo-deep); color: var(--white); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--white); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: .9375rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(245, 245, 250, .92); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 1.375rem/1 var(--display); letter-spacing: -0.02em; }
.brand:hover { color: var(--ink); }
.site-nav { display: flex; align-items: center; gap: 36px; }
.site-nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.site-nav ul a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .9875rem; }
.site-nav ul a:hover { color: var(--indigo); }
.nav-actions { display: flex; align-items: center; gap: 20px; }
.link-quiet { color: var(--ink); font-weight: 500; text-decoration: none; font-size: .9875rem; }
.menu-toggle { display: none; }

/* Hero */
.hero { padding: clamp(48px, 7vw, 96px) 0 var(--space); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(40px, 6vw, 80px); align-items: center; }
.hero-copy h1 { max-width: 15ch; }
.lede { margin-top: 28px; font-size: 1.1875rem; max-width: 34em; color: var(--ink-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero-note { margin-top: 22px; color: var(--ink-soft); font-size: .9375rem; }

/* The exam attempt panel: the one bold element of the page */
.attempt {
  margin: 0; background: var(--ink); color: #E6E5F7; border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(29, 30, 79, .55), 0 0 0 1px rgba(29, 30, 79, .08);
  font-size: .875rem;
}
.attempt-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid rgba(201, 198, 244, .16); }
.attempt-title { color: var(--lavender); font-weight: 500; }
.attempt-timer { font-family: var(--mono); color: var(--white); background: rgba(201, 198, 244, .14); padding: 3px 9px; border-radius: 6px; }
.attempt-body { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.editor { border-right: 1px solid rgba(201, 198, 244, .16); min-width: 0; }
.editor-tabs { display: flex; gap: 2px; padding: 10px 14px 0; }
.tab { padding: 6px 10px; font-size: .78rem; color: #9C9BC4; border-radius: 6px 6px 0 0; }
.tab.is-on { background: #26275F; color: var(--white); }
.editor pre { margin: 0; padding: 16px 14px 20px; background: #26275F; overflow-x: auto; }
.editor code { font: 400 .74rem/1.65 var(--mono); color: #E6E5F7; }
.editor .k { color: #B9B5EE; }
.editor .f { color: #8FE3B8; }
.tests { list-style: none; margin: 0; padding: 14px; display: grid; gap: 8px; align-content: start; }
.test { display: grid; grid-template-columns: 10px 1fr; column-gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; background: rgba(255, 255, 255, .04); font-family: var(--mono); font-size: .76rem; }
.test .dot { width: 10px; height: 10px; border-radius: 50%; background: #6E6D99; }
.test .res { grid-column: 2; color: #8FE3B8; font-family: var(--text); font-size: .74rem; }
.test.is-done .dot { background: #4CC88A; }
.proctor { display: grid; grid-template-columns: 84px 1fr; gap: 16px; padding: 14px 18px 18px; border-top: 1px solid rgba(201, 198, 244, .16); align-items: center; }
.cam { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; background: linear-gradient(160deg, #34357A, #222357); overflow: hidden; outline: 2px solid #4CC88A; outline-offset: -2px; }
.cam-face { position: absolute; left: 50%; top: 26%; width: 30%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: #8C8BC2; box-shadow: 0 34px 0 14px #8C8BC2; }
.proctor-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .8rem; color: #CFCDEE; }
.proctor-log time { font-family: var(--mono); color: #8F8EBB; margin-right: 8px; }
.proctor-log .flag { color: #F4C38E; }
.proctor-log .flag time { color: #D9A56F; }

/* Load sequence: test cases pass one after another, once */
.js .test .res { opacity: 0; }
.test:nth-child(1) { --i: 0; } .test:nth-child(2) { --i: 1; } .test:nth-child(3) { --i: 2; } .test:nth-child(4) { --i: 3; }
.js .test { animation: run .01s linear forwards; animation-delay: calc(700ms + var(--i) * 450ms); }
.js .test .res { animation: show .3s ease forwards; animation-delay: calc(700ms + var(--i) * 450ms); }
.js .test .dot { animation: pass .3s ease forwards; animation-delay: calc(700ms + var(--i) * 450ms); }
@keyframes show { to { opacity: 1; } }
@keyframes pass { to { background: #4CC88A; } }
@keyframes run { to { background: rgba(76, 200, 138, .10); } }

/* Sections */
.how, .platform, .services, .tech, .contact { padding: var(--space) 0; }
.how { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { list-style: none; counter-reset: step; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; }
.steps li { counter-increment: step; position: relative; padding-top: 58px; }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  font: 700 2.4rem/1 var(--display); color: var(--indigo);
}
.steps li::after { content: ""; position: absolute; top: 20px; left: 44px; right: -14px; height: 2px; background: var(--lavender); }
.steps li:last-child::after { display: none; }
.steps h3 { margin-bottom: 10px; }
.steps p { font-size: .975rem; color: var(--ink-soft); }

.platform-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); gap: clamp(40px, 7vw, 96px); align-items: start; }
.platform-intro { position: sticky; top: 112px; }
.platform-intro p { margin: 22px 0 30px; max-width: 30em; }
.features { display: grid; gap: 0; }
.feature { padding: 30px 0; border-top: 1px solid var(--line); }
.feature:last-child { border-bottom: 1px solid var(--line); }
.feature h3 { font-size: 1.5rem; margin-bottom: 10px; }
.feature p { max-width: 38em; }
.langs { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; }
.langs li { font: 500 .85rem/1 var(--mono); color: var(--ink); background: var(--lavender-soft); padding: 7px 10px; border-radius: 6px; }

.security { background: var(--ink); color: #D9D8F2; padding: var(--space) 0; }
.security h2, .security h3 { color: var(--white); }
.section-lede { margin-top: 18px; max-width: 40em; font-size: 1.125rem; color: #C3C2E6; }
.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 80px); margin-top: 56px; }
.security h3 { font-size: 1.125rem; padding-bottom: 14px; border-bottom: 1px solid rgba(201, 198, 244, .25); }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding: 14px 0 14px 30px; border-bottom: 1px solid rgba(201, 198, 244, .12); }
.checks li::before { content: ""; position: absolute; left: 2px; top: 22px; width: 12px; height: 7px; border-left: 2px solid var(--lavender); border-bottom: 2px solid var(--lavender); transform: rotate(-45deg); }

.services-grid, .tech-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); gap: clamp(40px, 7vw, 96px); }
.service-list, .facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 40px; }
.service-list dt, .facts dt { font: 700 1.1875rem/1.3 var(--display); color: var(--ink); margin-bottom: 8px; }
.service-list dd, .facts dd { margin: 0; color: var(--ink-soft); }
.tech { background: var(--white); border-top: 1px solid var(--line); }
.facts { grid-template-columns: 1fr; gap: 0; }
.facts > div { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { margin: 0; font-size: 1.0625rem; }

.contact { background: var(--lavender-soft); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); gap: clamp(40px, 7vw, 96px); align-items: start; }
.contact-intro p { margin-top: 18px; max-width: 28em; }
.contact-direct { font-weight: 500; }
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 22px; background: var(--white); padding: clamp(24px, 4vw, 40px); border-radius: 14px; border: 1px solid var(--line); }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9375rem; color: var(--ink); }
.optional { font-weight: 400; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--white);
  border: 1.5px solid #C4C4D8; border-radius: 8px; padding: 11px 13px; min-height: 48px;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--indigo); outline: 3px solid rgba(66, 70, 178, .2); outline-offset: 0; }
.field [aria-invalid="true"] { border-color: #B23E38; }
.field-error { color: #B23E38; font-size: .875rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.form-note { font-size: .875rem; color: var(--ink-soft); }
.form-status { font-weight: 500; }
.form-status:empty { display: none; }
.form-status.is-ok { color: var(--pass); }
.form-status.is-error { color: #B23E38; }

.site-footer { background: var(--ink); color: #C3C2E6; padding: 64px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.brand-light, .brand-light:hover { color: var(--white); }
.footer-brand p { margin-top: 14px; max-width: 26em; }
.footer-head { font: 600 1rem/1.3 var(--text); color: var(--white); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: #D9D8F2; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-note { font-size: .9rem; color: #A9A8D3; max-width: 22em; }
.footer-base { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(201, 198, 244, .18); font-size: .875rem; color: #A9A8D3; }

/* Simple content pages (privacy, 404) */
.page { padding: clamp(48px, 7vw, 88px) 0 var(--space); }
.page .wrap { max-width: 780px; }
.page h1 { font-size: clamp(2.2rem, 4.4vw, 3.2rem); }
.page h2 { font-size: 1.5rem; margin-top: 40px; }
.page p, .page ul { margin-top: 14px; }
.page .updated { color: var(--ink-soft); margin-top: 14px; }
.page .page-cta { margin-top: 28px; }

/* Tablet */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy h1 { max-width: 16ch; }
  .attempt { max-width: 640px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
  .steps li::after { display: none; }
  .platform-grid, .services-grid, .tech-grid, .contact-grid { grid-template-columns: 1fr; }
  .platform-intro { position: static; }
}

/* Navigation collapses */
@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border: 1.5px solid var(--line); border-radius: 10px; background: var(--white); cursor: pointer;
  }
  .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: var(--ink); position: relative; transition: transform .2s ease; }
  .menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
  .menu-icon::before { top: -6px; }
  .menu-icon::after { top: 6px; }
  .menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }
  .site-nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 8px;
    background: var(--mist); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 24px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.0625rem; }
  .nav-actions { flex-direction: column; align-items: stretch; gap: 12px; margin-top: 12px; }
  .link-quiet { padding: 10px 0; }
}

/* Mobile */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .lede { font-size: 1.0625rem; }
  .cta-row .btn { flex: 1 1 100%; }
  .attempt-body { grid-template-columns: 1fr; }
  .editor { border-right: 0; border-bottom: 1px solid rgba(201, 198, 244, .16); }
  .tests { grid-template-columns: 1fr 1fr; }
  .proctor { grid-template-columns: 64px 1fr; }
  .steps { grid-template-columns: 1fr; }
  .service-list { grid-template-columns: 1fr; }
  .facts > div { grid-template-columns: 1fr; gap: 6px; }
  .contact-form { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .test, .js .test .res, .js .test .dot { animation: none; }
  .js .test .res { opacity: 1; }
  .js .test .dot { background: #4CC88A; }
  * { transition: none !important; }
}

@media print {
  .site-header, .contact-form, .menu-toggle { display: none; }
  body { background: #fff; }
}
