/* =========================================================
   ministry of code — modern one-pager
   Light theme based on the logo colour (deep oxblood/maroon #461e1e)
   ========================================================= */

/* ---- DaxOT (self-hosted, taken from the original moc.io site) ---- */
@font-face {
  font-family: 'DaxOT';
  src: url("fonts/DaxOT/DaxOT-Light.woff2") format("woff2"),
       url("fonts/DaxOT/DaxOT-Light.woff") format("woff");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DaxOT';
  src: url("fonts/DaxOT/DaxOT-Light.woff2") format("woff2"),
       url("fonts/DaxOT/DaxOT-Light.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DaxOT';
  src: url("fonts/DaxOT/DaxOT-Medium.woff2") format("woff2"),
       url("fonts/DaxOT/DaxOT-Medium.woff") format("woff");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DaxOT';
  src: url("fonts/DaxOT/DaxOT-Medium.woff2") format("woff2"),
       url("fonts/DaxOT/DaxOT-Medium.woff") format("woff");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DaxOT';
  src: url("fonts/DaxOT/DaxOT-Medium.woff2") format("woff2"),
       url("fonts/DaxOT/DaxOT-Medium.woff") format("woff");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DaxOT';
  src: url("fonts/DaxOT/DaxOT-Medium.woff2") format("woff2"),
       url("fonts/DaxOT/DaxOT-Medium.woff") format("woff");
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  /* Surfaces — warm off-white, matching the logo's paper tone */
  --bg:        #ffffff;
  --bg-2:      #faf7f7;
  --bg-3:      #f4eeee;
  --surface:   #ffffff;
  --surface-2: #f7f1f1;

  --border:        rgba(70, 30, 30, 0.12);
  --border-strong: rgba(70, 30, 30, 0.24);

  --text:       #241414;
  --text-dim:   #6b5a5a;
  --text-faint: #9c8c8c;

  /* MOC brand — oxblood/maroon from the logo */
  --brand:      #7a2a2a;
  --brand-2:    #9c3838;
  --brand-deep: #461e1e;
  --brand-soft: rgba(122, 42, 42, 0.08);
  --brand-glow: rgba(122, 42, 42, 0.28);

  /* Text placed on top of a brand-coloured surface */
  --on-brand:   #ffffff;

  /* Overlay / scrim tones (dark, used for image gradients & backdrops) */
  --scrim:      36, 20, 20;

  --radius:      18px;
  --radius-pill: 100px;
  --container:   1200px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font: 'DaxOT', 'Open Sans', system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Scroll progress ---- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand-2));
  z-index: 200; transition: width .1s linear;
}

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s, padding .3s;
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: var(--border);
  padding-top: 10px; padding-bottom: 10px;
}
.nav-logo img { width: 168px; height: auto; }

.nav-links {
  display: flex; gap: 28px; margin-left: auto;
}
.nav-links a {
  font-size: 15px; color: var(--text-dim); font-weight: 600;
  position: relative; padding: 4px 0; transition: color .2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--brand); transition: width .25s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 14px; }

.lang-toggle {
  display: inline-flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 3px;
}
.lang-toggle a {
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--text-faint); padding: 5px 10px; border-radius: var(--radius-pill);
  cursor: pointer; transition: all .2s;
}
.lang-toggle a.active { background: var(--brand); color: var(--on-brand); }
.lang-toggle a:not(.active):hover { color: var(--text); }

.nav-cta {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: var(--on-brand); border: 0;
  font-weight: 700; font-size: 14px; cursor: pointer;
  padding: 10px 18px; border-radius: var(--radius-pill);
  transition: transform .15s, box-shadow .2s, background .2s;
  font-family: inherit;
}
.nav-cta:hover { background: var(--brand-2); transform: translateY(-1px); box-shadow: 0 8px 24px -8px var(--brand-glow); }

.nav-menu-btn {
  display: none; width: 42px; height: 42px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; position: relative;
}
.nav-menu-btn span,
.nav-menu-btn span::before,
.nav-menu-btn span::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 2px;
  background: var(--text); transform: translate(-50%, -50%); transition: .25s var(--ease);
}
.nav-menu-btn span::before { transform: translate(-50%, -7px); }
.nav-menu-btn span::after  { transform: translate(-50%, 5px); }
.nav-menu-btn[aria-expanded="true"] span { background: transparent; }
.nav-menu-btn[aria-expanded="true"] span::before { transform: translate(-50%, 0) rotate(45deg); }
.nav-menu-btn[aria-expanded="true"] span::after  { transform: translate(-50%, 0) rotate(-45deg); }

/* ---- Mobile menu ---- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 80px 24px 40px;
  opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: opacity .3s, transform .3s, visibility .3s;
}
.mobile-menu.open { opacity: 1; visibility: visible; transform: none; }
.mobile-menu a, .mobile-menu .menu-link {
  font-size: 22px; font-weight: 700; color: var(--text);
  padding: 12px; background: none; border: 0; cursor: pointer; font-family: inherit;
}
.mobile-menu .menu-link { color: var(--brand); }
.mobile-menu .mobile-lang { margin-top: 18px; }
.mobile-menu .mobile-lang a { font-size: 14px; }
.mobile-menu-note { margin-top: 24px; color: var(--text-faint); font-size: 13px; }

/* ============ HERO ============ */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  padding: 140px 0 80px; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-stage {
  position: absolute; top: 0; left: 0; right: 0;
  height: 500px; max-height: 66%;
  background: url("images/stage_1920x500.jpg") center top / cover no-repeat;
  opacity: 0.75;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 40%, transparent 100%);
}
.hero-glow {
  position: absolute; top: -10%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px; max-width: 120vw;
  background: radial-gradient(ellipse at center, var(--brand-glow), transparent 60%);
  opacity: .35; filter: blur(40px);
}
.hero-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px;
  text-align: center;
}
.hero-inner::before {
  content: ""; position: absolute; z-index: -1;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 130%; height: 150%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.86) 0%, rgba(255,255,255,0.7) 45%, transparent 75%);
  pointer-events: none;
}
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.05; margin-bottom: 22px;
}
.hero-title .accent {
  display: block;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-rotator {
  min-height: 1.15em;
  opacity: 1;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.hero-rotator.fade-out { opacity: 0; transform: translateY(-8px); }
.hero-sub {
  max-width: 760px; margin: 0 auto 34px;
  font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-dim);
}
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }

.hero-trust {
  display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center;
}
.hero-trust span {
  font-size: 13px; color: var(--text-dim); font-weight: 600;
  padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
  padding: 14px 28px; border-radius: var(--radius-pill); border: 1px solid transparent;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
}
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-2); transform: translateY(-2px); box-shadow: 0 14px 34px -12px var(--brand-glow); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }

/* ============ STATS ============ */
.stats { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-2); }
.stats .container {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  padding-top: 44px; padding-bottom: 44px;
}
.stat { text-align: center; }
.stat-num {
  font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { margin-top: 8px; color: var(--text-dim); font-size: 14px; font-weight: 600; }

/* ============ SECTIONS ============ */
.section { padding: 100px 0; position: relative; }
.section-head { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.section-eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 14px;
}
.section-title { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 16px; }
.section-desc { color: var(--text-dim); font-size: 1.1rem; }

/* ---- About ---- */
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.about-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  transition: transform .25s var(--ease), border-color .25s, background .25s;
}
.about-card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); }
.about-icon { font-size: 32px; margin-bottom: 16px; }
.about-card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.about-card p { color: var(--text-dim); }
.about-lede {
  max-width: 880px; margin: 48px auto 0; text-align: center;
  font-size: 1.15rem; color: var(--text-dim); line-height: 1.7;
}

/* ============ CLIENTS / MARQUEE ============ */
.clients { padding: 70px 0; background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.clients-head { text-align: center; color: var(--text-dim); font-weight: 600; margin-bottom: 36px; font-size: 1.05rem; }
.marquee {
  position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex; gap: 18px; width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.client-chip {
  flex: none; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em;
  color: var(--text-faint); padding: 12px 30px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); white-space: nowrap; transition: color .2s, border-color .2s;
}
.client-chip:hover { color: var(--text); border-color: var(--border-strong); }

/* ============ PROJECTS ============ */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s;
}
.project-card:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.project-card {
  border-left: 3px solid var(--brand);
}
.project-body { padding: 30px 28px; }
.project-tag {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .08em;
  color: var(--brand); background: var(--brand-soft); border: 1px solid var(--border-strong);
  padding: 4px 12px; border-radius: var(--radius-pill); margin-bottom: 14px;
}
.project-body h3 { font-size: 1.3rem; margin-bottom: 10px; }
.project-body p { color: var(--text-dim); }
.project-link {
  display: inline-block; margin-top: 14px; font-weight: 700; font-size: 14px;
  color: var(--brand); transition: color .2s, transform .2s;
}
.project-link:hover { color: var(--brand-2); transform: translateX(3px); }

/* ============ WHY AI ============ */
.section-ai { background: var(--bg-2); overflow: hidden; }
.ai-bg {
  position: absolute; bottom: -20%; right: -10%; width: 700px; height: 700px; max-width: 90vw;
  background: radial-gradient(circle, var(--brand-glow), transparent 65%);
  opacity: .2; filter: blur(50px); z-index: 0;
}
.section-ai .container { position: relative; z-index: 1; }
.ai-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.ai-text p { color: var(--text-dim); font-size: 1.1rem; margin-bottom: 20px; line-height: 1.75; }
.ai-points { display: flex; flex-direction: column; gap: 18px; }
.ai-point {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.ai-point-num {
  flex: none; width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.2rem; font-weight: 800;
  background: var(--brand-soft); color: var(--brand); border: 1px solid var(--border-strong);
}
.ai-point h4 { font-size: 1.1rem; margin-bottom: 4px; }
.ai-point p { color: var(--text-dim); font-size: .96rem; }
.ai-langs {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 56px;
}
.ai-langs span {
  font-weight: 700; font-size: 15px; color: var(--text-dim);
  padding: 9px 20px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface);
}
.ai-note { text-align: center; color: var(--text-faint); margin-top: 28px; font-style: italic; }

/* ============ CONTACT ============ */
.section-contact { background: var(--bg); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: start; }
.contact-desc { color: var(--text-dim); font-size: 1.1rem; margin: 16px 0 28px; }
.contact-details { display: flex; flex-direction: column; gap: 18px; margin-bottom: 30px; }
.contact-detail-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); font-weight: 700; }
.contact-detail-value { font-size: 1.1rem; font-weight: 600; color: var(--text); }
a.contact-detail-value:hover { color: var(--brand); }

.contact-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
}
.contact-row { margin-bottom: 18px; }
.contact-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-dim); }
.contact-field {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 16px; transition: border-color .2s, box-shadow .2s;
}
.contact-field:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.contact-textarea { resize: vertical; min-height: 120px; }
.contact-submit { width: 100%; margin-top: 6px; }
.contact-status { margin-top: 14px; font-size: 14px; font-weight: 600; min-height: 20px; }
.contact-status.success { color: var(--brand); }
.contact-status.error { color: #c0392b; }

/* ============ FOOTER ============ */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 30px 0; }
.footer-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-copy { color: var(--text-faint); font-size: 14px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--text-dim); font-size: 14px; font-weight: 600; cursor: pointer; }
.footer-links a:hover { color: var(--brand); }

/* ============ MODALS ============ */
.modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.modal.open { opacity: 1; visibility: visible; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(var(--scrim),.55); backdrop-filter: blur(4px); }
.modal-dialog {
  position: relative; z-index: 1; width: 100%; max-width: 720px;
  max-height: 90vh; overflow-y: auto;
  background: var(--bg-3); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 36px;
  transform: translateY(16px) scale(.98); transition: transform .3s var(--ease);
}
.modal.open .modal-dialog { transform: none; }
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 38px; height: 38px;
  font-size: 24px; line-height: 1; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.modal-close:hover { color: var(--text); border-color: var(--border-strong); }

.legal-content h3 { font-size: 1.4rem; margin: 24px 0 12px; }
.legal-content h3:first-child { margin-top: 0; }
.legal-content p { color: var(--text-dim); margin-bottom: 12px; }
.legal-content a:hover { color: var(--brand); }

/* ============ REVEAL ANIMATION ============ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-menu-btn { display: block; }
  .nav-logo img { width: 150px; }

  .ai-grid { grid-template-columns: 1fr; gap: 36px; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 760px) {
  .stats .container { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .about-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
  .hero { padding-top: 120px; min-height: auto; }
  .footer-bar { flex-direction: column; text-align: center; }
  .modal-dialog { padding: 26px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; }
}
