/* ==========================================================================
   MSI Trading (SMC-Private) Limited — Site Stylesheet
   --------------------------------------------------------------------------
   Structure of this file:
     1. Design tokens (CSS custom properties) + light/dark themes
     2. Base / reset
     3. Header & navigation
     4. Section-waypoint side rail (desktop only)
     5. Hero section + decorative "quotation" visual
     6. Section heading pattern (reused by About/Products/Services)
     7. About section
     8. Products grid
     9. Services grid
    10. Contact form
    11. WhatsApp floating action button
    12. Closing / contact-details band + footer
    13. Accessibility: reduced motion
   ========================================================================== */

/* 1. Design tokens ---------------------------------------------------------
   Colors are defined once here and reused everywhere via var(--token).
   To re-brand the whole site, this is the only place you should need to
   touch color values. A prefers-color-scheme block and a manual
   [data-theme="dark"] override are both provided, so the site adapts to
   the visitor's OS setting and can also be toggled manually if you later
   add a theme switcher. */
:root {
  --ink: #10213F;              /* primary text / navy brand color */
  --ink-soft: #2B3A55;         /* secondary text */
  --paper: #EFE8D8;            /* page background (warm cream) */
  --paper-soft: #F7F3E8;       /* card / header background */
  --copper: #C9A03F;           /* accent (gold/copper) */
  --copper-dark: #9C7B2E;      /* darker accent, used for hover/tagline */
  --verdigris: #3E6B63;        /* secondary accent (teal-green) */
  --charcoal: #23282E;         /* body copy color */
  --line: rgba(22, 35, 61, 0.16);        /* hairline borders */
  --line-strong: rgba(22, 35, 61, 0.3);  /* stronger borders */
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F1ECE0;
    --ink-soft: #C3CBDA;
    --paper: #0E1A30;
    --paper-soft: #162748;
    --copper: #D9BB5B;
    --copper-dark: #EDD489;
    --verdigris: #7FB6AB;
    --charcoal: #EDE8DA;
    --line: rgba(255, 255, 255, 0.14);
    --line-strong: rgba(255, 255, 255, 0.28);
  }
}

:root[data-theme="dark"] {
  --ink: #F1ECE0;
  --ink-soft: #C3CBDA;
  --paper: #0E1A30;
  --paper-soft: #162748;
  --copper: #D9BB5B;
  --copper-dark: #EDD489;
  --verdigris: #7FB6AB;
  --charcoal: #EDE8DA;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.28);
}

/* 2. Base / reset ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Avoids a flash of unstyled background before CSS paints. */
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--charcoal);
  font-family: 'IBM Plex Sans', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .wordmark {
  font-family: 'Zilla Slab', Georgia, serif;
  color: var(--ink);
  margin: 0;
}

a { color: inherit; }

img, svg { display: block; max-width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

section { padding: 96px 0; }
@media (max-width: 720px) { section { padding: 64px 0; } }

/* 3. Header & navigation ---------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 40px; height: 40px; flex-shrink: 0; }

.wordmark { font-size: 19px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
.wordmark small {
  display: block;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--copper-dark);
  margin-top: 1px;
}

nav ul { list-style: none; display: flex; gap: 32px; margin: 0; padding: 0; }
nav a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
nav a:hover, nav a.active { color: var(--copper-dark); border-bottom-color: var(--copper); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; }

@media (max-width: 760px) {
  nav {
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    background: var(--paper-soft);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
  }
  nav.open { max-height: 280px; }
  nav ul { flex-direction: column; gap: 0; padding: 8px 28px 20px; }
  nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
}

/* 4. Section-waypoint side rail (desktop only) ------------------------------
   A small fixed nav on the left edge that tracks scroll position. Hidden
   below 1020px because there isn't enough side margin to show it well. */
.rail {
  position: fixed;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  z-index: 40;
}
.rail::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line-strong);
}
.rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.rail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.rail-label {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s ease, transform .2s ease;
  background: var(--paper-soft);
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.rail-item:hover .rail-label, .rail-item.active .rail-label { opacity: 1; transform: translateX(0); }
.rail-item.active .rail-dot { background: var(--copper); border-color: var(--copper); transform: scale(1.2); }
@media (max-width: 1020px) { .rail { display: none; } }

/* 5. Hero -------------------------------------------------------------------
   The hero uses `fetchpriority="high"` on its LCP-critical text (see HTML)
   and a lazy-loaded decorative "stamp" image, since those images sit below
   or beside the fold and don't need to block first paint. */
.hero { padding-top: 88px; padding-bottom: 88px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; } }

.hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }
.hero p.lede { font-size: 18px; color: var(--ink-soft); max-width: 52ch; margin-top: 22px; }
.hero-ctas { display: flex; gap: 16px; margin-top: 34px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--copper); color: var(--ink); }
.btn-primary:hover { background: var(--copper-dark); color: var(--paper-soft); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }

/* Decorative "quotation letterhead" visual next to the hero copy */
.quote-card {
  position: relative;
  background: var(--paper-soft);
  border: 1px solid var(--line-strong);
  padding: 26px 30px 54px;
  transform: rotate(1.2deg);
  box-shadow: 8px 10px 0 rgba(22, 35, 61, 0.08);
}
.quote-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--line-strong);
  pointer-events: none;
}
.quote-letterhead { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--copper); }
.quote-letterhead img { width: 34px; height: 34px; flex-shrink: 0; }
.quote-letterhead .qname { font-family: 'Zilla Slab', serif; font-weight: 700; font-size: 15px; color: var(--ink); line-height: 1.2; }
.quote-letterhead .qname small {
  display: block;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--copper-dark);
  margin-top: 1px;
}
.quote-letterhead .qcontact { font-size: 10px; color: var(--ink-soft); margin-top: 2px; }
.quote-meta { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--ink-soft); margin: 16px 0 20px; }
.quote-meta b { color: var(--ink); font-weight: 600; }
.quote-meta i { font-style: normal; display: inline-block; min-width: 74px; border-bottom: 1px dotted var(--line-strong); }
.quote-title { font-family: 'Zilla Slab', serif; font-size: 19px; font-weight: 700; letter-spacing: 0.05em; color: var(--ink); margin-bottom: 18px; }
.quote-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.quote-table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 600;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 8px;
}
.quote-table th:last-child, .quote-table td:last-child { text-align: right; }
.quote-table td { padding: 10px 0; border-bottom: 1px dotted var(--line-strong); color: var(--ink-soft); }
.quote-table tr:last-child td { border-bottom: none; }
.quote-table td:first-child { color: var(--ink); font-weight: 500; }
.quote-footnote { margin-top: 18px; font-size: 11.5px; font-style: italic; color: var(--ink-soft); }

.stamp {
  position: absolute;
  right: 0;
  bottom: -26px;
  width: 112px;
  height: 112px;
  transform: rotate(-10deg);
  flex-shrink: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.15));
}
.stamp img { width: 100%; height: 100%; display: block; }
@media (max-width: 520px) {
  .quote-card { padding-bottom: 64px; }
  .stamp { width: 88px; height: 88px; bottom: -20px; }
}

/* 6. Section heading pattern (About / Products / Services) ------------------ */
.section-head { max-width: 60ch; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 600; letter-spacing: -0.01em; }
.section-head p { color: var(--ink-soft); margin-top: 14px; font-size: 16.5px; }

.band { background: var(--paper-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* 7. About -------------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid p { color: var(--ink-soft); margin: 0 0 16px; }
.stat-row { display: flex; gap: 36px; margin-top: 28px; flex-wrap: wrap; }
.stat b { display: block; font-family: 'Zilla Slab', serif; font-size: 26px; color: var(--ink); }
.stat span { font-size: 13px; color: var(--ink-soft); }

/* 8. Products grid -------------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .product-grid { grid-template-columns: 1fr; } }
.product-card { background: var(--paper); padding: 26px 22px; }
.product-card .icon { color: var(--copper); margin-bottom: 14px; }
.product-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.product-card p { font-size: 13.5px; color: var(--ink-soft); margin: 0; }
.products-note {
  margin-top: 32px;
  padding: 20px 24px;
  border-left: 3px solid var(--verdigris);
  background: var(--paper-soft);
  font-size: 15px;
  color: var(--ink-soft);
}
.products-note b { color: var(--ink); }

/* 9. Services grid ---------------------------------------------------------------- */
.service-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .service-grid { grid-template-columns: 1fr; } }
.service-card { border: 1px solid var(--line-strong); padding: 32px 28px; background: var(--paper-soft); }
.service-card .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--verdigris);
  border: 1px solid var(--verdigris);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.service-card h3 { font-size: 21px; font-weight: 600; margin-bottom: 10px; }
.service-card p { color: var(--ink-soft); margin: 0; }

/* 10. Contact form ------------------------------------------------------------------- */
.contact-info p { color: var(--ink-soft); }
.contact-line { display: flex; gap: 12px; margin-top: 18px; font-size: 15px; }
.contact-line b { color: var(--ink); min-width: 88px; display: inline-block; }
form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
input, select, textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-soft);
  color: var(--charcoal);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--copper); outline-offset: 1px; }
textarea { resize: vertical; min-height: 110px; }
.form-note { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

/* Honeypot spam trap: invisible to real visitors (moved off-screen, not
   display:none — some bots skip fields hidden that way), skipped in tab
   order, and never announced to screen readers via aria-hidden on its
   wrapper in the HTML. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { font-size: 14.5px; font-weight: 600; margin-top: 4px; padding: 12px 16px; border-radius: var(--radius); }
.form-status-success { color: #1E5B3A; background: rgba(62, 107, 99, 0.12); border: 1px solid var(--verdigris); }
.form-status-error { color: #7A2E2E; background: rgba(154, 46, 46, 0.08); border: 1px solid #9A2E2E; }
.form-status-error a { color: inherit; text-decoration: underline; }
.is-hidden { display: none; }
button:disabled { opacity: 0.7; cursor: not-allowed; }

/* 11. WhatsApp floating action button -------------------------------------------------- */
.whatsapp-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.whatsapp-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }
@media (max-width: 600px) {
  .whatsapp-fab { right: 16px; bottom: 16px; width: 52px; height: 52px; }
  .whatsapp-fab svg { width: 26px; height: 26px; }
}

/* 12. Closing / contact-details band + footer ------------------------------------------- */
.contact-close { background: #0E1B33; color: #E7E2D4; padding: 88px 0 0; }
.contact-close h2 { color: #F5F1E6; font-size: clamp(26px, 3.4vw, 36px); font-weight: 600; letter-spacing: -0.01em; }
.contact-close > .wrap > p { color: #AEB8CC; margin-top: 14px; font-size: 16.5px; max-width: 56ch; }
.close-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 44px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
@media (max-width: 760px) { .close-grid { grid-template-columns: 1fr; gap: 26px; } }
.close-item b {
  display: block;
  font-family: 'Zilla Slab', serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #D9BB5B;
  margin-bottom: 8px;
}
.close-item span { font-size: 15.5px; line-height: 1.6; color: #E7E2D4; }
.close-bottom-inner {
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13.5px;
  color: #8C96AC;
}

/* 13. Accessibility: respect reduced-motion preference ------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
