/* ==========================================================================
   Expert English Editors — main stylesheet
   Theme: "red pen on paper"
   ========================================================================== */

:root {
  --ink: #14213d;
  --ink-2: #23345c;
  --paper: #fdfaf3;
  --paper-2: #f5efe2;
  --white: #ffffff;
  --text: #1f2633;
  --muted: #5b6478;
  --line: #e7dfcf;
  --red: #d7263d;
  --red-dark: #b01c30;
  --green: #1f8a5b;
  --gold: #e9a23b;

  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-hand: "Caveat", "Segoe Print", cursive;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, .06), 0 2px 8px rgba(20, 33, 61, .05);
  --shadow: 0 10px 30px -10px rgba(20, 33, 61, .18);
  --shadow-lg: 0 30px 60px -20px rgba(20, 33, 61, .3);
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--red-dark); text-underline-offset: 3px; }
a:hover { color: var(--red); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 32px); margin-inline: auto; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 200; }
.skip-link:focus { top: 12px; color: #fff; }

.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--paper-2); }
.section-ink { background: var(--ink); color: #dfe5f2; }
.section-ink h2, .section-ink h3 { color: #fff; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red-dark); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.section-ink .eyebrow { color: var(--gold); }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { margin-inline: auto; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--muted); }
.section-ink .lead { color: #b9c3da; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px; border: 2px solid transparent;
  font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s, color .2s;
  min-height: 48px;
}
.btn:hover { transform: translateY(-2px); }
.btn-sm { padding: 9px 18px; min-height: 40px; font-size: .92rem; }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }
.btn-accent { background: var(--red); color: #fff; box-shadow: 0 8px 20px -8px rgba(215, 38, 61, .6); }
.btn-accent:hover { background: var(--red-dark); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-2); color: #fff; }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-ghost-light { border-color: rgba(255,255,255,.4); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn[disabled] { opacity: .7; cursor: progress; transform: none; }

/* ---------- Scroll progress ---------- */
.progress-bar { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 150; pointer-events: none; }
.progress-bar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(253, 250, 243, .86);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.site-header.scrolled { border-color: var(--line); box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark svg { transition: transform .4s var(--ease); }
.brand:hover .brand-mark svg { transform: rotate(-8deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; }
.brand-text span { font-size: .78rem; letter-spacing: .3em; text-transform: uppercase; color: var(--red-dark); font-weight: 600; }

.site-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: 999px; border: 0; background: none;
  font: 500 .98rem var(--font-body); color: var(--ink); text-decoration: none; cursor: pointer;
}
.nav-link:hover, .nav-link.is-active { background: rgba(20, 33, 61, .07); color: var(--ink); }
.nav-link.is-active { font-weight: 600; }
.has-sub { position: relative; }
.chev { transition: transform .25s; }
.sub-menu {
  list-style: none; margin: 0; padding: 8px; position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .2s var(--ease);
}
.sub-menu a { display: block; padding: 10px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .96rem; }
.sub-menu a:hover { background: var(--paper-2); color: var(--red-dark); }
.sub-label { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 12px 14px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
h1.eyebrow { font-family: var(--font-body); font-size: .8rem; line-height: 1.4; font-weight: 600; letter-spacing: .14em; color: var(--red-dark); }
.display { font-family: var(--font-head); color: var(--ink); font-size: clamp(2.2rem, 5.5vw, 3.8rem); line-height: 1.12; font-weight: 600; letter-spacing: -.01em; margin: 0 0 .5em; text-wrap: balance; }
.display em { font-style: normal; color: var(--red); position: relative; white-space: nowrap; }
.chips-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips-list li { padding: 7px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: .92rem; color: var(--ink); }
.areas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .areas-grid { grid-template-columns: 1fr; } }
.area-card h3 { display: flex; align-items: center; gap: 10px; }
.area-card p.cities { font-size: .9rem; color: var(--muted); }
.has-sub:hover .sub-menu, .has-sub.open .sub-menu { opacity: 1; visibility: visible; transform: none; }
.has-sub:hover .chev, .has-sub.open .chev { transform: rotate(180deg); }
.nav-cta { margin-left: 8px; }

.nav-toggle { display: none; width: 46px; height: 46px; border: 0; border-radius: 12px; background: var(--ink); cursor: pointer; }
.bars { display: grid; gap: 5px; width: 20px; margin: auto; }
.bars i { display: block; height: 2px; background: #fff; border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.nav-open .bars i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .bars i:nth-child(2) { opacity: 0; }
.nav-open .bars i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 920px) {
  /* backdrop-filter would trap the fixed menu drawer inside the header */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0; background: var(--paper);
    padding: 20px 16px 40px; overflow-y: auto;
    transform: translateX(100%); transition: transform .35s var(--ease); visibility: hidden;
  }
  .nav-open .site-nav { transform: none; visibility: visible; }
  .site-nav > ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-link { width: 100%; justify-content: space-between; padding: 16px; font-size: 1.15rem; border-radius: 12px; }
  .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 12px; display: none; }
  .has-sub.open .sub-menu { display: block; }
  .has-sub:hover .chev { transform: none; }
  .has-sub.open .chev { transform: rotate(180deg); }
  .sub-menu a { padding: 12px 16px; font-size: 1.05rem; }
  .nav-cta { margin: 16px 0 0; }
  .nav-cta .btn { width: 100%; min-height: 52px; font-size: 1.05rem; }
  body.nav-open { overflow: hidden; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 clamp(64px, 9vw, 110px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(800px 400px at 85% 10%, rgba(233, 162, 59, .16), transparent 60%),
    radial-gradient(600px 400px at 0% 100%, rgba(215, 38, 61, .08), transparent 60%),
    repeating-linear-gradient(transparent 0 35px, rgba(20, 33, 61, .045) 35px 36px);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero .display em { font-style: normal; color: var(--red); position: relative; white-space: nowrap; }
.hero .display em::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: .02em; height: .32em; z-index: -1;
  background: rgba(233, 162, 59, .35); border-radius: 4px; transform: skew(-8deg) scaleX(0); transform-origin: left;
  animation: highlight .9s .5s var(--ease) forwards;
}
@keyframes highlight { to { transform: skew(-8deg) scaleX(1); } }
.hero .lead { max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 32px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px 20px; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: .93rem; }
.trust-row li { display: flex; align-items: center; gap: 8px; }
.trust-row svg { color: var(--green); flex: none; }

/* The red-pen demo card */
.pen-card {
  position: relative; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 30px 28px 24px; border: 1px solid var(--line);
  transform: rotate(1.2deg);
}
.pen-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(transparent 0 31px, #eef1f7 31px 32px); background-position: 0 58px;
}
.pen-card::after { content: ""; position: absolute; top: 0; bottom: 0; left: 52px; width: 2px; background: rgba(215, 38, 61, .22); }
.pen-card-top { position: relative; display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); margin-bottom: 14px; padding-left: 40px; }
.pen-card-top .dots { display: flex; gap: 6px; }
.pen-card-top .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.pen-text { position: relative; padding-left: 40px; font-family: var(--font-head); font-size: clamp(1.1rem, 2vw, 1.3rem); line-height: 2.5; color: var(--ink); min-height: 10.5em; padding-top: .4em; }
.fix { position: relative; display: inline-block; }
.fix .wrong { position: relative; transition: color .3s; }
.fix .wrong::after {
  content: ""; position: absolute; left: -2px; right: -2px; top: 55%; height: 2px; background: var(--red);
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.fix .right {
  position: absolute; left: 50%; bottom: 72%; transform: translate(-50%, 6px) rotate(-3deg);
  font-family: var(--font-hand); font-size: 1.45em; color: var(--red); white-space: nowrap; line-height: 1;
  opacity: 0; transition: opacity .35s, transform .35s var(--ease); pointer-events: none;
}
.fix.done .wrong { color: #9aa3b5; }
.fix.done .wrong::after { transform: scaleX(1); }
.fix.done .right { opacity: 1; transform: translate(-50%, 0) rotate(-3deg); }
.pen-foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 0 40px; border-top: 1px dashed var(--line); margin-top: 8px; font-size: .9rem; color: var(--muted); }
.pen-score { font-weight: 600; color: var(--green); }
.pen-replay { border: 0; background: none; color: var(--red-dark); font: 600 .9rem var(--font-body); cursor: pointer; padding: 6px; }
.pen-sticker {
  position: absolute; left: -22px; top: -30px; z-index: 2; background: var(--gold); color: var(--ink);
  font: 700 .85rem/1.1 var(--font-body); padding: 14px 16px; border-radius: 50%; width: 96px; height: 96px;
  display: grid; place-items: center; text-align: center; transform: rotate(-10deg); box-shadow: var(--shadow);
}

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .pen-card { transform: none; }
  .pen-sticker { left: -6px; top: -34px; width: 78px; height: 78px; font-size: .74rem; }
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); padding: 26px 22px; }
.stat-num { font-family: var(--font-head); font-size: clamp(2.2rem, 4.5vw, 3.2rem); font-weight: 700; color: #fff; line-height: 1; }
.stat-num sup { font-size: .5em; color: var(--gold); top: -.7em; }
.stat p { margin: 10px 0 0; color: #b9c3da; font-size: .95rem; }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Cards ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .cards-3 { grid-template-columns: 1fr; } }
.card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 30px 28px; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.service-card { display: flex; flex-direction: column; text-decoration: none; color: var(--text); overflow: hidden; }
.service-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--red);
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.service-card:hover::after { transform: scaleX(1); }
.service-card:hover { color: var(--text); }
.icon-badge { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--paper-2); color: var(--red); margin-bottom: 20px; transition: transform .4s var(--ease), background .3s, color .3s; }
.service-card:hover .icon-badge { transform: rotate(-8deg) scale(1.06); background: var(--red); color: #fff; }
.service-card p { color: var(--muted); flex: 1; }
.more { font-weight: 600; color: var(--red-dark); display: inline-flex; align-items: center; gap: 6px; }
.more svg { transition: transform .3s var(--ease); }
.service-card:hover .more svg { transform: translateX(5px); }

/* ---------- The 5 Cs (tabs) ---------- */
.cs-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.cs-tabs { display: grid; gap: 8px; }
.cs-tab {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; cursor: pointer;
  font: 600 1.05rem var(--font-body); color: var(--ink); transition: .25s var(--ease);
}
.cs-tab .letter { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--paper-2); font-family: var(--font-head); font-size: 1.3rem; color: var(--red); transition: .25s; }
.cs-tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: var(--shadow); }
.cs-tab[aria-selected="true"] .letter { background: var(--red); color: #fff; }
.cs-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow-sm); }
.cs-panel[hidden] { display: none; }
.cs-panel h3 { font-size: 1.6rem; }
.compare { display: grid; gap: 14px; margin-top: 20px; }
.compare-row { border-radius: var(--radius); padding: 16px 18px 16px 56px; position: relative; font-family: var(--font-head); font-size: 1.12rem; line-height: 1.55; }
.compare-row::before { position: absolute; left: 16px; top: 15px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 .85rem var(--font-body); color: #fff; }
.compare-row.before { background: #fdf0f1; color: #7a2632; }
.compare-row.before::before { content: "✕"; background: var(--red); }
.compare-row.after { background: #eaf6f0; color: #164d35; }
.compare-row.after::before { content: "✓"; background: var(--green); }
.compare-row small { display: block; font: 600 .72rem var(--font-body); letter-spacing: .12em; text-transform: uppercase; opacity: .7; margin-bottom: 4px; }
.cs-panel.animate .after { animation: slideIn .5s .15s var(--ease) both; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 820px) {
  .cs-wrap { grid-template-columns: 1fr; }
  .cs-tabs { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .cs-tab { scroll-snap-align: start; padding: 10px 14px; font-size: .98rem; }
  .cs-tab .letter { width: 30px; height: 30px; font-size: 1.05rem; }
}

/* ---------- Game: spot the errors ---------- */
.game { background: #fff; border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow-lg); color: var(--text); }
.game-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.game-meter { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--ink); }
.meter { width: 140px; height: 10px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--gold)); transition: width .4s var(--ease); }
.game-text { font-family: var(--font-head); font-size: clamp(1.1rem, 2.2vw, 1.35rem); line-height: 2.1; color: var(--ink); user-select: none; -webkit-user-select: none; }
.w { cursor: pointer; border-radius: 4px; padding: 1px 1px; transition: background .2s; position: relative; }
.w:hover { background: rgba(233, 162, 59, .22); }
.w.found { color: #9aa3b5; text-decoration: line-through 2px var(--red); background: none; cursor: default; }
.w.found::after {
  content: attr(data-fix); position: absolute; left: 50%; bottom: 78%; transform: translateX(-50%) rotate(-3deg);
  font-family: var(--font-hand); color: var(--red); font-size: 1.35em; white-space: nowrap; line-height: 1;
  animation: pop .35s var(--ease);
}
.w.miss { animation: shake .35s; background: rgba(91, 100, 120, .14); }
.w.revealed { color: var(--red); text-decoration: underline wavy var(--red); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 6px) rotate(-3deg) scale(.6); } }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.game-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.game-msg { margin: 0; color: var(--muted); font-size: .95rem; min-height: 1.5em; }
.game-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.game.won .game-msg { color: var(--green); font-weight: 600; }

/* ---------- Estimator ---------- */
.estimator { display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; background: #fff; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.est-inputs { padding: clamp(22px, 4vw, 40px); }
.est-output { background: var(--ink); color: #dfe5f2; padding: clamp(22px, 4vw, 40px); display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.est-output h3 { color: #fff; margin: 0; }
.est-big { font-family: var(--font-head); font-size: clamp(2rem, 4.4vw, 3rem); color: #fff; line-height: 1; font-weight: 700; }
.est-big small { font-size: .4em; font-family: var(--font-body); font-weight: 500; color: #b9c3da; display: block; margin-top: 8px; }
.est-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: .95rem; }
.est-list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 8px; }
.est-list strong { color: #fff; text-align: right; }
.est-note { font-size: .82rem; color: #93a0bd; margin: 0; }
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row output { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: var(--ink); min-width: 110px; text-align: right; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; background: var(--paper-2); border-radius: 99px; outline-offset: 6px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--red); border: 4px solid #fff; box-shadow: var(--shadow); cursor: grab; }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--red); border: 4px solid #fff; box-shadow: var(--shadow); cursor: grab; }
.paste-box { margin-top: 10px; }
.paste-box summary { cursor: pointer; color: var(--red-dark); font-weight: 600; font-size: .95rem; }
.paste-box textarea { margin-top: 10px; }
@media (max-width: 860px) { .estimator { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 18px; min-width: 0; }
.field label, .field legend, .est-inputs label.lbl { font-weight: 600; font-size: .95rem; color: var(--ink); }
.opt { font-weight: 400; color: var(--muted); font-size: .82rem; margin-left: 4px; }
.req { color: var(--red); }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], select, textarea {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  font: 400 1rem var(--font-body); color: var(--text); transition: border-color .2s, box-shadow .2s; min-height: 50px;
}
textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(20, 33, 61, .1); }
[aria-invalid="true"] { border-color: var(--red) !important; background: #fffafa; }
.field-error { color: var(--red-dark); font-size: .88rem; font-weight: 500; margin: 2px 0 0; }
.hint { font-size: .85rem; color: var(--muted); margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 28px); margin-bottom: 18px; }
.form-step > legend { float: left; width: 100%; display: flex; align-items: center; gap: 12px; font: 600 1.25rem var(--font-head); color: var(--ink); margin-bottom: 18px; padding: 0; }
.form-step > legend + * { clear: both; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font: 700 .95rem var(--font-body); flex: none; }
.service-picks, .challenge-opts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.pick { position: relative; cursor: pointer; }
.pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pick span { display: inline-block; padding: 11px 18px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-weight: 500; transition: .2s; min-height: 46px; line-height: 1.5; }
.pick input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.pick input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.pick:hover span { border-color: var(--ink); }
.pick-word span { font-family: var(--font-head); font-size: 1.08rem; }
@media (max-width: 520px) {
  .service-picks { display: grid; grid-template-columns: 1fr 1fr; }
  .service-picks .pick span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; text-align: center; padding: 10px 12px; border-radius: 14px; font-size: .95rem; }
}
.challenge-q { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.challenge.has-error .pick span { border-color: #f1b8bf; }
.extras { gap: 8px; }
.extras legend { margin-bottom: 6px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .96rem; cursor: pointer; line-height: 1.45; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--red); flex: none; }
.consent { margin-top: 10px; }
.consent.has-error { color: var(--red-dark); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-alert { background: #fdf0f1; border: 1px solid #f3c2c8; color: #7a2632; padding: 16px 18px; border-radius: var(--radius); margin-bottom: 18px; }
.form-alert ul { margin: 6px 0 0; }
.form-alert p { margin: 4px 0 0; }
.submit { width: 100%; }
.submit.loading .label::after { content: "…"; }
.hint.center { margin-top: 12px; }

.success-card { background: #fff; border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 48px); text-align: center; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.success-icon { width: 84px; height: 84px; margin: 0 auto 18px; }
.success-icon circle { stroke-dasharray: 240; stroke-dashoffset: 240; animation: draw 0.8s var(--ease) forwards; }
.success-icon path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.5s .6s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Testimonials ---------- */
.t-slider { position: relative; max-width: 860px; margin-inline: auto; }
.t-track { overflow: hidden; display: grid; padding-top: 40px; margin-top: -40px; } /* headroom for the quote mark */
.t-slide { grid-area: 1 / 1; margin: 0; opacity: 0; visibility: hidden; transform: translateX(30px); transition: opacity .5s var(--ease), transform .5s var(--ease), visibility .5s; text-align: center; }
.t-slide.active { opacity: 1; visibility: visible; transform: none; }
.t-quote { font-family: var(--font-head); font-size: clamp(1.25rem, 2.6vw, 1.75rem); line-height: 1.45; color: #fff; margin: 0 0 22px; font-weight: 500; white-space: pre-line; }
.t-quote::before { content: "\201C"; display: block; font-size: 3.5em; line-height: .6; color: var(--red); margin-bottom: 10px; }
.t-who { color: var(--gold); font-weight: 600; }
.t-org { color: #93a0bd; font-size: .93rem; }
.t-controls { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 30px; }
.t-arrow { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; transition: .2s; }
.t-arrow:hover { background: var(--red); border-color: var(--red); }
.t-dots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 60%; }
.t-dot { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.25); cursor: pointer; transition: .3s; }
.t-dot.active { background: var(--gold); width: 26px; border-radius: 99px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 36px; }
.chip { padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font: 600 .95rem var(--font-body); color: var(--ink); cursor: pointer; transition: .2s; min-height: 44px; }
.chip .count { display: inline-block; min-width: 24px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--paper-2); font-size: .8rem; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] .count { background: var(--red); color: #fff; }
.t-grid { columns: 3 300px; column-gap: 22px; }
.t-card { break-inside: avoid; margin: 0 0 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); transition: opacity .35s, transform .35s var(--ease); }
.t-card.hide { display: none; }
.t-card blockquote { margin: 0 0 18px; font-family: var(--font-head); font-size: 1.12rem; line-height: 1.55; color: var(--ink); white-space: pre-line; }
.t-card blockquote::before { content: "\201C"; color: var(--red); font-size: 2.6em; line-height: 0; vertical-align: -.42em; margin-right: 4px; }
.t-meta { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: .9rem; }
.avatar.academic { background: var(--ink); }
.avatar.business { background: var(--red); }
.avatar.government { background: var(--green); }
.t-meta strong { display: block; color: var(--ink); font-size: .95rem; line-height: 1.3; }
.t-meta span { font-size: .85rem; color: var(--muted); }
.t-meta .avatar { color: #fff; font-size: .9rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; background: var(--paper-2); color: var(--muted); margin-bottom: 12px; }

/* ---------- Countries ---------- */
.map-wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.region { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-lg); padding: 24px; }
.region h3 { font-size: 1.15rem; display: flex; justify-content: space-between; align-items: baseline; }
.region h3 span { font-family: var(--font-body); font-size: .85rem; color: var(--gold); font-weight: 600; }
.flags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.flag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: rgba(255,255,255,.08); font-size: .9rem; color: #e4e9f5; transition: transform .25s var(--ease), background .25s; }
.flag:hover { transform: translateY(-3px); background: rgba(255,255,255,.16); }
.flag img { width: 26px; height: 18px; border-radius: 4px; object-fit: cover; }
.reveal-stagger .flag { opacity: 0; transform: translateY(10px); }
.reveal-stagger.in .flag { opacity: 1; transform: none; transition: opacity .4s var(--ease), transform .4s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
@media (max-width: 900px) { .map-wrap { grid-template-columns: 1fr; } }

/* ---------- Process / timeline ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; counter-reset: step; position: relative; }
.steps::before { content: ""; position: absolute; top: 27px; left: 10%; right: 10%; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 14px); }
.steps li { position: relative; text-align: center; }
.steps .n { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font: 700 1.2rem var(--font-head); color: var(--ink); position: relative; transition: .4s var(--ease); }
.steps li.in .n { background: var(--red); border-color: var(--red); color: #fff; transform: scale(1.06); }
.steps h3 { font-size: 1.05rem; margin-bottom: 4px; }
.steps p { font-size: .9rem; color: var(--muted); margin: 0; }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; gap: 0; }
  .steps::before { top: 10px; bottom: 10px; left: 27px; right: auto; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--line) 0 8px, transparent 8px 14px); }
  .steps li { display: grid; grid-template-columns: 56px 1fr; gap: 0 18px; text-align: left; padding-bottom: 22px; }
  .steps .n { margin: 0; grid-row: span 2; }
}

/* ---------- Split / feature lists ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.ticks { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 36px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' stroke='white' stroke-width='2.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.ticks.cross li::before { background-color: #9aa3b5; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 8l8 8M16 8l-8 8' stroke='white' stroke-width='2.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 36px); box-shadow: var(--shadow-sm); }
.panel h3 { margin-bottom: 14px; }
.price-note { border-left: 4px solid var(--gold); background: #fff8eb; padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 20px 0; }
.mission { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mission div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.mission strong { display: block; font-family: var(--font-head); font-size: 1.12rem; color: var(--ink); margin-bottom: 6px; }
.mission p { margin: 0; font-size: .93rem; color: var(--muted); }
@media (max-width: 900px) { .mission { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .mission { grid-template-columns: 1fr; } }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; padding: clamp(48px, 8vw, 88px) 0 clamp(40px, 6vw, 64px); overflow: hidden; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(700px 300px at 90% 0%, rgba(233, 162, 59, .16), transparent 60%), repeating-linear-gradient(transparent 0 35px, rgba(20, 33, 61, .04) 35px 36px); }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.page-hero .lead { max-width: 680px; }

/* ---------- Team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 860px) { .team-grid { grid-template-columns: 1fr; } }
.member { display: grid; grid-template-columns: 84px 1fr; gap: 20px; align-items: start; }
.monogram { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; font: 700 1.6rem var(--font-head); color: #fff; background: linear-gradient(135deg, var(--ink), var(--ink-2)); position: relative; }
.monogram::after { content: ""; position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 8px; background: var(--red); border: 3px solid #fff; }
.member .role { color: var(--red-dark); font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.member .quals { font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.bio-more { overflow: hidden; max-height: 0; transition: max-height .5s var(--ease); }
.member.open .bio-more { max-height: 900px; }
.bio-toggle { border: 0; background: none; padding: 6px 0; color: var(--red-dark); font: 600 .95rem var(--font-body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.bio-toggle svg { transition: transform .3s; }
.member.open .bio-toggle svg { transform: rotate(180deg); }
@media (max-width: 520px) { .member { grid-template-columns: 1fr; } }
.memorial { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 44px); align-items: center; }
.memorial .monogram { width: 120px; height: 120px; font-size: 2.2rem; background: linear-gradient(135deg, #2c2c2c, #4b4b4b); }
.memorial .monogram::after { background: var(--gold); }
.memorial .years { font-family: var(--font-hand); font-size: 1.6rem; color: var(--gold); }
@media (max-width: 640px) { .memorial { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: box-shadow .3s; }
.faq details[open] { box-shadow: var(--shadow); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 56px 18px 22px; position: relative; font: 600 1.05rem var(--font-body); color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font-size: 1.3rem; line-height: 1; color: var(--red); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); background: var(--red); color: #fff; }
.faq .answer { padding: 0 22px 20px; color: var(--muted); }

/* ---------- Contact layout ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.contact-aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 16px; }
.info-item { display: flex; gap: 14px; align-items: flex-start; }
.info-item .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--paper-2); color: var(--red); flex: none; }
.info-item p { margin: 0; font-size: .95rem; }
.info-item strong { display: block; color: var(--ink); }
.shield { display: flex; gap: 12px; align-items: flex-start; font-size: .88rem; color: var(--muted); background: #eaf6f0; border-radius: var(--radius); padding: 14px 16px; }
.shield svg { color: var(--green); flex: none; }
@media (max-width: 960px) { .contact-grid { grid-template-columns: 1fr; } .contact-aside { position: static; } }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(120deg, var(--ink) 0%, var(--ink-2) 100%); color: #dfe5f2; padding: clamp(48px, 7vw, 80px) 0; position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; border: 50px solid rgba(215, 38, 61, .18); }
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap; position: relative; z-index: 1; }
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { margin: 0; color: #b9c3da; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 520px) { .cta-actions, .cta-actions .btn { width: 100%; } .cta-ghost-email { word-break: break-all; } }

/* ---------- Footer ---------- */
.site-footer { background: #0e1830; color: #a7b1c8; padding: 64px 0 24px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr; gap: 28px; }
.footer-logo { font-family: var(--font-head); color: #fff; font-size: 1.4rem; margin-bottom: 10px; }
.footer-h { color: #fff; font-weight: 600; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.site-footer a { color: #cfd6e6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-contact a { word-break: break-word; }
.footer-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-badges span { font-size: .78rem; border: 1px solid rgba(255,255,255,.18); border-radius: 99px; padding: 4px 10px; }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 20px; font-size: .85rem; }
.footer-base p { margin: 0; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Back to top ---------- */
.to-top { position: fixed; right: 18px; bottom: 18px; width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); opacity: 0; transform: translateY(16px); pointer-events: none; transition: .3s var(--ease); z-index: 90; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--red); color: #fff; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: .1s; }
.js .reveal.d2 { transition-delay: .2s; }

/* ---------- Prose (privacy etc.) ---------- */
.prose h2 { font-size: 1.5rem; margin-top: 1.6em; }
.prose { color: var(--text); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
