/* Layout: a navy opening band with the logo's interlocking squares at full scale, then left-aligned sections ruled like a working paper. */
:root {
  --navy: #0a1b33;
  --navy-2: #13294a;
  --gold: #c19f56;
  --gold-text: #80611f;
  --white: #ffffff;
  --ground: #f5f6f8;
  --ink: #0f1f35;
  --muted: #55627a;
  --line: #d6dbe3;
  --on-navy-soft: #b9c3d3;
  --note: #fff0a8;
  --note-ink: #3a2c00;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Golos Text", "Segoe UI", Arial, sans-serif;
  --logo: "Poppins", "Segoe UI", Arial, sans-serif;
  /* Type scale: six steps, every size on the page comes from here. */
  --fs-xs: 14px;
  --fs-base: 17px;
  --fs-lead: clamp(18px, 1.5vw, 19px);
  --fs-h3: clamp(20px, 1.8vw, 23px);
  --fs-h2: clamp(27px, 2.8vw, 35px);
  --fs-h1: clamp(32px, 3.9vw, 48px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--white); color: var(--ink); font: 400 var(--fs-base)/1.65 var(--sans); overflow-x: hidden; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; font-family: var(--serif); font-weight: 600; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap {
  max-width: 1200px;
  margin-inline: auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}

.btn {
  display: inline-block; border: 0; cursor: pointer;
  font: 700 var(--fs-base)/1 var(--sans); text-decoration: none;
  padding: 18px 28px; border-radius: 2px;
  background: var(--gold); color: var(--navy);
  transition: background-color .15s ease;
}
.btn:hover { background: #d3b36c; }
.btn.navy { background: var(--navy); color: var(--white); }
.btn.navy:hover { background: var(--navy-2); }

/* Opening band */
.hero { background: var(--navy); color: var(--white); overflow: hidden; }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding-block: 18px; border-bottom: 1px solid var(--navy-2); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { width: 46px; height: 46px; flex: none; overflow: visible; }
.brand-text { display: grid; gap: 6px; }
.brand b { font: 700 22px/1 var(--logo); letter-spacing: .01em; white-space: nowrap; }
.brand small { font-size: 10px; line-height: 1; letter-spacing: .22em; color: var(--on-navy-soft); white-space: nowrap; }
.nav ul a[aria-current] { color: var(--white); }
.nav ul { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.nav ul a { text-decoration: none; font-weight: 500; color: var(--on-navy-soft); }
.nav ul a:hover { color: var(--white); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px 56px;
  padding-block: clamp(40px, 7vw, 96px) clamp(56px, 8vw, 112px);
}
.eyebrow { font-size: var(--fs-xs); font-weight: 500; line-height: 1.4; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.hero h1 { font-size: var(--fs-h1); line-height: 1.15; letter-spacing: -.015em; margin-top: 12px; }
.lead { color: var(--on-navy-soft); font-size: var(--fs-lead); line-height: 1.6; max-width: 56ch; margin-top: 16px; }
.hero .btn { margin-top: 22px; }
.hero-mark { width: 100%; max-width: 460px; justify-self: end; display: block; overflow: visible; }
/* Logo: splits into place once, then a gold sheen repeats */
.logo-anim .w { animation: splitA .9s cubic-bezier(.3, 1.45, .5, 1) .15s both; }
.logo-anim .g { animation: splitB .9s cubic-bezier(.3, 1.45, .5, 1) .15s both; }
.logo-anim .slit { stroke-dasharray: 1; animation: drawSlit .3s ease .9s both; }
.logo-anim .band { transform-box: fill-box; animation: sheen 6s ease-in-out 1.2s infinite both; }
@keyframes splitA { from { transform: translate(41px, 41px); } }
@keyframes splitB { from { transform: translate(-41px, -41px); } }
@keyframes drawSlit { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes sheen {
  0% { transform: translateX(-160px) skewX(-22deg); }
  22%, 100% { transform: translateX(420px) skewX(-22deg); }
}
/* The nav logo animates only where the large hero logo is hidden. */
@media (min-width: 901px) { .brand .logo-anim * { animation: none; } }

/* Sections */
section.block { padding-block: clamp(56px, 8vw, 104px); }
.head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: clamp(32px, 4vw, 56px); }
.head h2 { font-size: var(--fs-h2); line-height: 1.15; letter-spacing: -.01em; }
.head p { color: var(--muted); max-width: 54ch; }

.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; }
.head.stacked { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.service { display: grid; grid-row: span 2; grid-template-rows: subgrid; gap: 10px; align-content: start; padding-block: 28px; border-top: 1px solid var(--navy); }
.service h3 { font: 600 var(--fs-h3)/1.3 var(--serif); }
.service p { color: var(--muted); max-width: 54ch; }

.process { background: var(--ground); }

.founder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px 64px; }
.founder > * { min-width: 0; }
.founder h3 { font: 600 var(--fs-h3)/1.3 var(--serif); }
.founder .role { color: var(--gold-text); font-weight: 500; margin-top: 4px; }
.founder .bio { color: var(--muted); max-width: 54ch; margin-top: 16px; }
.facts { display: grid; margin: 0; }
.facts div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 4px 24px; padding-block: 16px; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 1px solid var(--navy); }
.facts dt { font-size: var(--fs-xs); font-weight: 500; line-height: 1.7; color: var(--muted); }
.facts dd { margin: 0; }
.sector-label { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); margin-top: clamp(32px, 4vw, 48px); }
.sectors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; }
.sectors li { font: 600 var(--fs-lead)/1.3 var(--serif); padding-block: 18px; border-top: 1px solid var(--navy); min-width: 0; }
@media (max-width: 900px) { .sectors { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .sectors { grid-template-columns: minmax(0, 1fr); } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.steps li { display: grid; gap: 10px; align-content: start; padding-top: 18px; border-top: 3px solid var(--gold); min-width: 0; }
.steps .n { font: 600 var(--fs-xs)/1 var(--sans); color: var(--gold-text); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.steps h3 { font: 600 var(--fs-h3)/1.3 var(--serif); }
.steps p { color: var(--muted); }

.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.principles div { display: grid; gap: 8px; align-content: start; min-width: 0; }
.principles h3 { font: 600 var(--fs-h3)/1.3 var(--serif); }
.principles p { color: var(--muted); }
.license { margin-top: clamp(32px, 4vw, 48px); padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); }

/* About page */
.more { display: inline-block; margin-top: 16px; font-weight: 500; color: var(--navy); text-underline-offset: 3px; }
.story { align-items: start; margin-bottom: 0; }
.story-body { display: grid; gap: 16px; }
.story-body p { max-width: 58ch; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 24px; padding-block: 18px; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 1px solid var(--navy); }
.timeline .year { font: 600 var(--fs-h3)/1.3 var(--serif); color: var(--gold-text); font-variant-numeric: tabular-nums; }
.timeline h3 { font: 600 var(--fs-h3)/1.3 var(--serif); }
.timeline p { color: var(--muted); margin-top: 2px; }
.band { background: var(--navy); color: var(--white); }
.band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-block: clamp(48px, 6vw, 72px); }
.band h2 { font-size: var(--fs-h2); line-height: 1.15; letter-spacing: -.01em; }
.hero-grid.compact { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px 64px; padding-block: clamp(28px, 3vw, 40px) clamp(36px, 3.6vw, 48px); }
.hero-grid.compact .hero-mark { width: 200px; max-width: 200px; justify-self: end; }
@media (max-width: 900px) { .hero-grid.compact { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .hero-grid.compact .hero-mark { display: none; } }

/* Values: four across, heading and text rows aligned */
.principles.values { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.principles > div { grid-row: span 2; grid-template-rows: subgrid; }
@media (max-width: 900px) { .principles.values { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .principles.values { grid-template-columns: minmax(0, 1fr); } }

/* Leader card and detail dialog */
.team { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
.leader { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 24px 32px; align-items: center; }
@media (max-width: 900px) { .team { grid-template-columns: minmax(0, 1fr); } }
.leader > * { min-width: 0; }
.portrait { display: block; position: relative; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; overflow: hidden; border-radius: 2px; }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .25s ease; }
.portrait:hover img { transform: scale(1.03); }
.portrait.static { cursor: default; }
.portrait.static:hover img { transform: none; }
.portrait span { position: absolute; inset: auto 0 0 0; background: var(--navy); color: var(--white); font: 500 var(--fs-xs)/1.4 var(--sans); padding: 10px 14px; text-align: left; }
.leader h3, .dialog-body h3 { font: 600 var(--fs-h3)/1.3 var(--serif); }
.leader .role, .dialog-body .role { color: var(--gold-text); font-weight: 500; margin-top: 4px; }
.leader .bio, .dialog-body .bio { color: var(--muted); max-width: 54ch; margin-top: 12px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 16px 0 0; padding: 0; }
.badges li { background: var(--navy); color: var(--white); font: 500 var(--fs-xs)/1 var(--sans); padding: 8px 12px; border-radius: 2px; }
.leader-dialog { width: min(760px, calc(100vw - 32px)); max-height: 85vh; padding: 0; border: 0; border-radius: 2px; background: var(--white); color: var(--ink); overflow: auto; }
.leader-dialog::backdrop { background: rgba(10, 27, 51, .72); }
.dialog-inner { position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; padding: clamp(24px, 4vw, 40px); }
.dialog-inner > * { min-width: 0; }
.dialog-inner img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 2px; }
.dialog-body .facts { margin-top: 24px; }
.dialog-close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; background: none; color: var(--navy); font: 400 28px/1 var(--sans); cursor: pointer; }
@media (max-width: 600px) {
  .leader, .dialog-inner { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 280px; }
  .dialog-inner img { max-width: 150px; }
}
@media (prefers-reduced-motion: reduce) { .portrait img { transition: none; } }

/* Design system: the logo's cut corner repeats on every panel, the gold rule marks every section */
:root { --cut: 16px; --ground-2: #e9edf3; }
.btn, .service, .principles > div, .sectors li, .portrait, .leader, .contact form {
  clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut));
}
section.block { padding-block: clamp(48px, 6vw, 80px); }
.head::before, .contact-grid > div:first-child::before { content: ""; display: block; width: 44px; height: 3px; background: var(--gold); }
.contact-grid > div:first-child::before { margin-bottom: 14px; }

.btn { --cut: 10px; border-radius: 0; }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--navy); }
.btn.navy:focus-visible { box-shadow: inset 0 0 0 3px var(--gold); }
.portrait:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

.nav ul a { display: inline-block; padding-block: 4px; border-bottom: 2px solid transparent; transition: color .15s ease, border-color .15s ease; }
.nav ul a:hover, .nav ul a[aria-current] { border-bottom-color: var(--gold); }

.services { gap: 16px; }
.service { background: var(--ground); border-top: 0; padding: 26px 24px; transition: background-color .2s ease; }
.service:hover { background: var(--ground-2); }

.principles, .principles.values { gap: 16px; }
.principles > div { background: var(--white); padding: 26px 24px; }

.sectors { gap: 12px; }
.sectors li { --cut: 10px; background: var(--white); border-top: 0; padding: 18px 20px; }

.team { gap: 16px; }
.leader { background: var(--ground); padding: 16px; }

.contact form { --cut: 22px; border-radius: 0; }
.contact-list a { text-decoration-color: var(--gold); text-underline-offset: 3px; }
.contact-list a:hover { color: var(--gold); }

@media (prefers-reduced-motion: reduce) { .service, .nav ul a { transition: none; } }

/* Home: service cards overlap the bottom of the navy band */
.hero-grid.compact.overlap { padding-bottom: clamp(100px, 9vw, 120px); }
section.block.services-overlap { padding-top: 0; }
.services-overlap .services { grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; z-index: 1; margin-top: -76px; }
.service-intro, .service-intro:hover { background: var(--gold); color: var(--navy); }
.service-intro h2 { font: 600 var(--fs-h3)/1.3 var(--serif); letter-spacing: 0; }
.service-intro p { color: var(--navy); }
@media (max-width: 900px) { .services-overlap .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .hero-grid.compact.overlap { padding-bottom: 84px; }
  .services-overlap .services { grid-template-columns: minmax(0, 1fr); margin-top: -48px; }
}

/* Nav "Үйлчилгээ": services and "why" fit one screen */
#services { scroll-margin-top: 16px; }
section.block.services-overlap { padding-bottom: 20px; }
section.block#why { padding-block: 26px 36px; }
#why .head { margin-bottom: 20px; }
#why .principles > div { padding: 20px 22px; }

/* Home first screen: navy band fills the view, only the card titles show below it */
@media (min-width: 901px) {
  .hero-full { min-height: calc(100vh - var(--peek, 92px) + 76px); min-height: calc(100svh - var(--peek, 92px) + 76px); display: flex; }
  .hero-full > .wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
  .hero-full .hero-grid { flex: 1; align-content: start; padding-top: clamp(36px, 7vh, 72px); }
}

/* About page: each section fills the screen, an arrow leads to the next one */
.screen { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.screen > .wrap { width: 100%; }
section.block.screen { padding-block: 56px 92px; }
header.screen { justify-content: flex-start; }
header.screen > .wrap { flex: 1; display: flex; flex-direction: column; }
header.screen .hero-grid { flex: 1; align-content: center; padding-bottom: 92px; }
.next { position: absolute; left: 50%; bottom: 18px; margin-left: -28px; width: 56px; height: 56px; display: grid; place-items: center; color: var(--navy); animation: nudge 2s ease-in-out infinite; }
.hero .next { color: var(--gold); }
.next svg { width: 40px; height: 40px; opacity: .45; transition: opacity .15s ease; }
.next:hover svg, .next:focus-visible svg { opacity: 1; }
.next:hover { color: var(--gold-text); }
.hero .next:hover { color: var(--white); }
@keyframes nudge { 0%, 100% { transform: translateY(-4px); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .next { animation: none; } }

/* Phone: keep the four menu links on one line */
@media (max-width: 480px) { nav.nav ul { font-size: 14px; gap: 6px 8px; justify-content: space-between; } }

/* Home: up arrow at the end of the contact section */
section.block.contact { position: relative; padding-bottom: 92px; }
.contact .next { color: var(--gold); }
.contact .next:hover { color: var(--white); }

/* Contact */
.contact { background: var(--navy); color: var(--white); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px 72px; }
.contact-grid > * { min-width: 0; }
.contact h2 { font-size: var(--fs-h2); line-height: 1.15; letter-spacing: -.01em; }
.contact .sub { color: var(--on-navy-soft); margin-top: 16px; max-width: 44ch; }
.contact-list { display: grid; gap: 18px; margin: 32px 0 0; }
.contact-list div { display: grid; gap: 4px; }
.contact-list dt { font-size: var(--fs-xs); color: var(--gold); letter-spacing: .12em; text-transform: uppercase; }
.contact-list dd { margin: 0; font-weight: 500; }

form { background: var(--white); color: var(--ink); padding: clamp(24px, 3vw, 40px); border-radius: 2px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full, .form-end { grid-column: 1 / -1; }
label { font-weight: 500; font-size: var(--fs-xs); }
input, textarea { width: 100%; font: 400 var(--fs-base)/1.4 var(--sans); color: var(--ink); background: var(--ground); border: 1px solid var(--line); border-radius: 2px; padding: 13px 14px; }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--navy); outline-offset: 0; }
textarea { min-height: 120px; resize: vertical; }
.form-end { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
#form-status { color: var(--muted); font-size: var(--fs-xs); flex: 1 1 220px; min-width: 0; }

footer { background: var(--navy); color: var(--on-navy-soft); font-size: var(--fs-xs); border-top: 1px solid var(--navy-2); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; padding-block: 26px; }

@media (max-width: 900px) {
  .nav ul { width: 100%; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; }
  .hero-grid, .head, .contact-grid, .founder, .services { grid-template-columns: minmax(0, 1fr); }
  .hero-mark { max-width: 220px; justify-self: start; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 600px) {
  .services, .steps, form { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .logo-anim * { animation: none !important; }
  .btn { transition: none; }
}
