/* ============================================
   Emerchant Solutions — Editorial Theme
   Shared design system for index.html + jobs.html
   Aesthetic: warm paper · navy + gold accent ·
   Instrument Serif display · Inter UI · mono meta
   ============================================ */

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

:root {
  --navy:        #1B2A4A;
  --navy-light:  #243556;
  --navy-dark:   #0F1A30;
  --ink:         #0A1226;
  --gold:        #F2B705;
  --gold-hover:  #D9A504;
  --gold-soft:   #F7D26B;
  --paper:       #F5F1E8;
  --paper-warm:  #EFE9D9;
  --paper-line:  #DCD3BD;
  --rule:        rgba(15, 26, 48, 0.12);
  --rule-strong: rgba(15, 26, 48, 0.22);
  --muted:       #6B6557;

  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans:  'Inter', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Paper grain overlay — fixed, multiply-blended */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.08 0 0 0 0 0.1 0 0 0 0.12 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }
button { font: inherit; }

/* ----------------- LAYOUT ----------------- */
.wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

section { position: relative; }

.section-pad { padding: 130px 0; }

.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  align-items: end;
  margin-bottom: 80px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}

.section-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-tag .num {
  color: var(--gold-hover);
  font-weight: 500;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 4.5vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section-title em {
  font-style: italic;
  color: var(--gold-hover);
}

/* Sections on navy invert tag/title colors */
.section--navy { background: var(--navy); color: var(--paper); }
.section--navy .section-tag { color: rgba(245,241,232,0.5); }
.section--navy .section-tag .num { color: var(--gold); }
.section--navy .section-title { color: var(--paper); }
.section--navy .section-title em { color: var(--gold-soft); }
.section--navy .section-head { border-bottom-color: rgba(255,255,255,0.1); }

/* ----------------- NAVIGATION ----------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: box-shadow 0.3s ease;
}
.nav.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo img { height: 32px; width: auto; }

.nav-meta {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-meta .live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Nav link group (used by index.html) */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  color: rgba(255,255,255,0.7);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover {
  color: var(--paper);
  background: rgba(255,255,255,0.06);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  margin-left: 8px;
  background: var(--gold);
  color: var(--navy-dark);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 4px;
  transition: background 0.2s ease;
}
.nav-cta:hover { background: var(--gold-hover); color: var(--navy-dark); }
.nav-cta svg { width: 12px; height: 12px; }

/* Mobile toggle */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-mobile-toggle span {
  width: 22px; height: 2px;
  background: var(--paper);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ----------------- BUTTONS ----------------- */
.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 32px;
  background: var(--gold);
  color: var(--navy-dark);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn-gold:hover {
  background: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(242,183,5,0.5);
  color: var(--navy-dark);
}
.btn-gold svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.btn-gold:hover svg { transform: translateX(4px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 28px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(15,26,48,0.04); }

.btn-ghost--light {
  color: var(--paper);
  border-color: rgba(245,241,232,0.3);
}
.btn-ghost--light:hover {
  border-color: var(--paper);
  background: rgba(245,241,232,0.06);
  color: var(--paper);
}

.text-link {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: rgba(245,241,232,0.7);
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(245,241,232,0.25);
  padding-bottom: 4px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.text-link:hover { color: var(--paper); border-color: var(--gold); }

.text-link--dark {
  color: var(--muted);
  border-bottom-color: var(--rule-strong);
}
.text-link--dark:hover { color: var(--ink); border-bottom-color: var(--gold-hover); }

/* ----------------- FORMS (editorial underline style) ----------------- */
.form-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.form-label .req { color: var(--gold-hover); }

.form-input,
.form-select {
  width: 100%;
  padding: 16px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--paper-line);
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: border-color 0.2s ease;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.form-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%236B6557' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 28px;
  cursor: pointer;
}
.form-input::placeholder { color: var(--muted); opacity: 0.5; font-style: italic; }
.form-input:focus,
.form-select:focus { outline: none; border-bottom-color: var(--gold-hover); }

.form-field { margin-bottom: 28px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-submit {
  width: 100%;
  padding: 22px;
  margin-top: 12px;
  background: var(--navy);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.form-submit:hover { background: var(--navy-dark); transform: translateY(-2px); }
.form-submit svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.form-submit:hover svg { transform: translateX(4px); }

.form-note {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 18px;
  text-align: center;
  line-height: 1.7;
}

/* File upload (editorial dashed) */
.file-upload {
  border: 1px dashed var(--paper-line);
  background: rgba(255,255,255,0.4);
  border-radius: 4px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.file-upload:hover { border-color: var(--gold-hover); background: rgba(247,210,107,0.12); }
.file-upload svg {
  width: 32px; height: 32px;
  color: var(--muted);
  margin: 0 auto 12px;
}
.file-upload p {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
}
.file-upload p span {
  color: var(--gold-hover);
  font-weight: 600;
}

/* ----------------- FOOTER ----------------- */
.foot {
  background: var(--ink);
  color: rgba(245,241,232,0.6);
  padding: 70px 0 30px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  align-items: start;
  margin-bottom: 50px;
}
.foot-brand img { height: 32px; margin-bottom: 20px; }
.foot-brand p {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.5;
  color: rgba(245,241,232,0.7);
  max-width: 360px;
}
.foot-col h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.foot-col a, .foot-col .row {
  display: block;
  font-size: 0.88rem;
  color: rgba(245,241,232,0.65);
  margin-bottom: 10px;
  transition: color 0.2s ease;
}
.foot-col a:hover { color: var(--gold); }

.foot-socials {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.foot-socials a {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: grid;
  place-items: center;
  margin-bottom: 0;
  transition: background 0.2s ease, color 0.2s ease;
}
.foot-socials a:hover { background: var(--gold); color: var(--navy-dark); }
.foot-socials svg { width: 14px; height: 14px; }

.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(245,241,232,0.4);
  text-transform: uppercase;
}

/* ----------------- SCROLL REVEAL ----------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.40s; }

/* ----------------- GENERIC ANIMATIONS ----------------- */
@keyframes scrollLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes barGrow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* ----------------- RESPONSIVE BASE ----------------- */
@media (max-width: 1024px) {
  .wrap { padding: 0 24px; }
  .section-pad { padding: 90px 0; }
  .section-head { grid-template-columns: 1fr; gap: 24px; margin-bottom: 56px; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--navy);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 24px 20px;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 12px 24px -10px rgba(0,0,0,0.3);
  }
  .nav-links.active { display: flex; }
  .nav-links a {
    padding: 14px 16px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .nav-links .nav-cta { margin-left: 0; margin-top: 12px; justify-content: center; }
  .nav-mobile-toggle { display: flex; }
  .nav-meta { display: none; }

  .foot-grid { grid-template-columns: 1fr; gap: 36px; }
  .foot-bottom { flex-direction: column; gap: 12px; text-align: center; }

  .form-row { grid-template-columns: 1fr; }
  .form-input { font-size: 1.1rem; }
}

@media (max-width: 640px) {
  .section-pad { padding: 70px 0; }
}

@media (max-width: 420px) {
  .wrap { padding: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; }
}
