/* ==========================================================================
   MUHIIM — BASE
   Reset, typography, layout utilities, buttons, forms
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul, ol { list-style: none; }
strong { font-weight: 700; color: var(--ink); }

::selection { background: var(--orange-500); color: var(--teal-950); }

:focus-visible {
  outline: 3px solid var(--orange-500);
  outline-offset: 3px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); line-height: 1.2; letter-spacing: -0.01em; }
h4 { font-size: var(--fs-md); line-height: 1.25; letter-spacing: -0.005em; font-weight: 700; }
p { text-wrap: pretty; }

.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
  font-weight: 400;
}

.text-center { text-align: center; }

/* The highlighted phrase in headlines: brand colour, never a gradient */
.text-gradient-purple,
.highlight-gold { color: var(--teal-700); }

.text-link {
  color: var(--teal-800);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--orange-500);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
[data-theme="dark"] .text-link { color: var(--orange-300); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}
.container-sm { max-width: 860px; }

.section-padding { padding-block: var(--section-y); }
.section-padding-sm { padding-block: clamp(3rem, 6vw, 5rem); }
.bg-white { background: var(--bg-surface); }
.bg-tint { background: var(--bg-tint); }

.grid-2, .grid-3, .grid-4 { display: grid; gap: clamp(1.25rem, 2.4vw, 2rem); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.actions-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
}

/* ---------- Section heading system ---------- */
.section-tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--teal-700);
  margin-bottom: var(--space-4);
}
/* the Muhiim chevron, drawn in CSS */
.section-tagline::before {
  content: "";
  width: 15px;
  height: 13px;
  flex: none;
  background: var(--orange-500);
  clip-path: polygon(0 0, 30% 0, 50% 45%, 70% 0, 100% 0, 50% 100%);
}
[data-theme="dark"] .section-tagline { color: var(--teal-300); }

.section-header-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: end;
  gap: var(--space-8) clamp(2rem, 6vw, 6rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-header-split h2 { max-width: 18ch; }
.section-header-split > p {
  color: var(--ink-2);
  font-size: var(--fs-base);
  max-width: 46ch;
  padding-bottom: 0.35rem;
}
.section-header-split > div:last-child:not(:first-child) { justify-self: end; }
.section-header-split > div:last-child:not(:first-child):has(p) { justify-self: stretch; }

@media (max-width: 860px) {
  .section-header-split { grid-template-columns: 1fr; align-items: start; }
  .section-header-split > div:last-child:not(:first-child) { justify-self: start; }
}

.section-header-center {
  text-align: center;
  max-width: 720px;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
}
.section-header-center .section-tagline { justify-content: center; }
.section-title-center { margin: 0 auto var(--space-4); max-width: 18ch; }
.section-intro {
  color: var(--ink-2);
  max-width: 58ch;
  margin: var(--space-3) auto 0;
}
.section-intro-left { color: var(--ink-2); font-size: var(--fs-md); line-height: 1.5; margin-bottom: var(--space-8); max-width: 44ch; }
.split-title { margin-bottom: var(--space-5); max-width: 20ch; }
.split-title-sm { font-size: clamp(1.6rem, 2.4vw, 2rem); }
.body-copy { color: var(--ink-2); margin-bottom: var(--space-4); max-width: 62ch; }
.body-copy-last { margin-bottom: var(--space-8); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--teal-800);
  --btn-fg: var(--white);
  --btn-bd: var(--teal-800);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.8rem 1.45rem;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1.1;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1.5px solid var(--btn-bd);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%);
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
}
.btn svg { width: 16px; height: 16px; flex: none; transition: transform var(--transition-fast); }
.btn:hover svg { transform: translateX(3px); }
.btn:hover { --btn-bg: var(--teal-950); --btn-bd: var(--teal-950); }

.btn-navy, .btn-primary { --btn-bg: var(--teal-800); --btn-fg: var(--white); --btn-bd: var(--teal-800); }

.btn-gold {
  --btn-bg: var(--orange-500); --btn-fg: var(--teal-950); --btn-bd: var(--orange-500);
}
.btn-gold:hover { --btn-bg: var(--orange-300); --btn-bd: var(--orange-300); --btn-fg: var(--teal-950); }

.btn-outline, .btn-secondary {
  --btn-bg: transparent; --btn-fg: var(--teal-800); --btn-bd: var(--teal-800);
}
.btn-outline:hover, .btn-secondary:hover { --btn-bg: var(--teal-800); --btn-fg: var(--white); --btn-bd: var(--teal-800); }
[data-theme="dark"] .btn-outline, [data-theme="dark"] .btn-secondary { --btn-fg: var(--ink); --btn-bd: var(--line-strong); }

.btn-ghost-light {
  --btn-bg: transparent; --btn-fg: var(--white); --btn-bd: rgba(255, 255, 255, 0.4);
}
.btn-ghost-light:hover { --btn-bg: rgba(255, 255, 255, 0.1); --btn-bd: var(--white); --btn-fg: var(--white); }

.btn-lg { min-height: 56px; padding: 1rem 1.75rem; font-size: var(--fs-base); }
.btn-block { width: 100%; }
.btn-icon-play { width: 12px !important; height: 12px !important; color: var(--orange-500); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: var(--space-5); }
.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-2);
}
.form-control {
  width: 100%;
  min-height: 50px;
  padding: 0.8rem 1rem;
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--bg-surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 0;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}
.form-control::placeholder { color: var(--ink-3); }
.form-control:hover { border-color: var(--teal-300); }
.form-control:focus {
  outline: none;
  border-color: var(--teal-800);
  box-shadow: 0 0 0 3px rgba(2, 83, 77, 0.16);
}
select.form-control {
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2302534D' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 8px;
}
textarea.form-control { min-height: 150px; resize: vertical; line-height: 1.55; }
.has-error .form-control { border-color: #C2410C; box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.14); }
.has-error .form-label { color: #C2410C; }

/* ---------- Scroll reveal: a quiet fade only ---------- */
.reveal { opacity: 0; transition: opacity 700ms var(--ease); }
.reveal.active { opacity: 1; }

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