/* ============================================================
   Textile Sourcing — landing page styles
   Design tokens carried over from the original WordPress
   (Twenty Twenty-Five) theme so the look stays consistent.
   ============================================================ */

/* ---- Self-hosted fonts (GDPR: no third-party font CDN) ---- */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/Manrope-VariableFont_wght.woff2") format("woff2");
}
@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/FiraCode-VariableFont_wght.woff2") format("woff2");
}

/* ---- Design tokens ---- */
:root {
  /* Colours — Bangladesh-flag-inspired, muted for a serious business tone */
  --color-base: #ffffff;
  --color-contrast: #111111;
  --color-brand: #006a4e;        /* Bangladesh bottle green — primary accent / CTA */
  --color-brand-dark: #00543d;   /* green hover / active */
  --color-accent-1: #ffee58;     /* legacy (unused) */
  --color-accent-2: #f6cff4;     /* legacy (unused) */
  --color-accent-3: #006a4e;     /* brand green — links, timeline, focus, bullets */
  --color-accent-4: #5f6b66;     /* green-tinted grey — secondary text */
  --color-accent-5: #eef4f0;     /* pale green — alternating section background */
  --color-accent-red: #d45b62;   /* paler flag red — timeline nodes, step labels, crosses */
  --color-danger: #c62828;       /* clear red — form validation / errors */
  --color-border: color-mix(in srgb, currentColor 18%, transparent);

  /* Soft edge shadow used to delineate alternating sections from their
     white neighbours (the pale-green/white boundary is otherwise faint).
     Tune the alpha to taste — higher = more pronounced separation. */
  --section-edge-shadow:
    inset 0 7px 9px -7px rgba(0, 0, 0, 0.05),
    inset 0 -7px 9px -7px rgba(0, 0, 0, 0.05);

  /* Typography */
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Fira Code", ui-monospace, "SFMono-Regular", monospace;

  --fs-small: 0.875rem;
  --fs-medium: clamp(1rem, 1rem + ((1vw - 0.2rem) * 0.196), 1.125rem);
  --fs-large: clamp(1.125rem, 1.125rem + ((1vw - 0.2rem) * 0.392), 1.375rem);
  --fs-x-large: clamp(1.75rem, 1.75rem + ((1vw - 0.2rem) * 0.392), 2rem);
  --fs-xx-large: clamp(2.15rem, 2.15rem + ((1vw - 0.2rem) * 1.333), 3rem);

  /* Spacing scale */
  --space-20: 10px;
  --space-30: 20px;
  --space-40: 30px;
  --space-50: clamp(30px, 5vw, 50px);
  --space-60: clamp(30px, 7vw, 70px);
  --space-70: clamp(50px, 7vw, 90px);
  --space-80: clamp(70px, 10vw, 140px);

  /* Layout widths */
  --content-size: 645px;
  --wide-size: 1340px;
  --radius: 10px;
}

/* ---- Reset / base ---- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--color-base);
  color: var(--color-contrast);
  font-family: var(--font-body);
  font-size: var(--fs-medium);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

h1, h2, h3 {
  line-height: 1.1;
  font-weight: 700;
  margin: 0 0 var(--space-30);
}
h1 { font-size: var(--fs-xx-large); }
h2 { font-size: var(--fs-xx-large); }
h3 { font-size: var(--fs-large); }

/* Flag-red accent rule under section headings — a deliberate graphic accent
   that fades out at both ends. */
.section h2::after {
  content: "";
  display: block;
  width: 460px;
  max-width: 88%;
  height: 3px;
  margin: var(--space-30) auto 0;
  background: linear-gradient(
    to right,
    transparent,
    color-mix(in srgb, var(--color-accent-red) 55%, transparent) 47%,
    color-mix(in srgb, var(--color-accent-red) 55%, transparent) 53%,
    transparent
  );
}

p { margin: 0 0 var(--space-30); }

/* ---- Helpers ---- */
.center { text-align: center; }
.muted { color: var(--color-accent-4); }
.small { font-size: var(--fs-small); }
/* Small end-of-section notes: bold + darker so they read as deliberate, not faded. */
.muted.small { color: #3b433d; font-weight: 600; }
.lead { font-size: var(--fs-large); }

.container {
  width: 100%;
  max-width: var(--wide-size);
  margin-inline: auto;
  padding-inline: var(--space-40);
}
.container--narrow { max-width: var(--content-size); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-contrast);
  color: var(--color-base);
  padding: 10px 16px;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: calc(0.667em + 2px) calc(1.333em + 2px);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.btn--small { padding: 0.5em 1.1em; font-size: var(--fs-small); }
.btn--primary {
  background-color: var(--color-brand);
  color: #ffffff;
}
.btn--primary:hover { background-color: var(--color-brand-dark); }
.btn--secondary {
  background-color: var(--color-accent-5);
  color: var(--color-brand);
  border-color: var(--color-brand);
}
.btn--secondary:hover { background-color: var(--color-brand); color: #ffffff; }

:focus-visible { outline: 2px solid var(--color-accent-3); outline-offset: 2px; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: color-mix(in srgb, var(--color-base) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-30);
  padding-block: 14px;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-30);
}
/* Vertical divider between the logo and the social icons. */
.site-header__brand .social-links {
  border-left: 1px solid var(--color-border);
  padding-left: var(--space-30);
}
.site-title {
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  white-space: nowrap;
}
/* Header logo: subtle shadow to pop, green on hover like the nav links. */
.site-header .site-title {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: color 0.6s ease;
}
.site-header .site-title:hover { color: var(--color-accent-3); }
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-40);
  flex-wrap: nowrap;
}
.site-nav a {
  text-decoration: none;
  font-size: var(--fs-small);
  font-weight: 600;
  white-space: nowrap;
}
.site-nav a:not(.btn):hover { color: var(--color-accent-3); }
.site-nav a.is-current { color: var(--color-accent-3); }
.site-header .site-title.is-current { color: var(--color-accent-3); }

/* Social icon links */
.social-links {
  display: inline-flex;
  align-items: center;
  gap: var(--space-20);
}
.social-link {
  display: inline-flex;
  align-items: center;
  color: var(--color-contrast);
  transition: color 0.15s ease;
}
.social-link:hover { color: var(--color-accent-3); }

/* Hamburger toggle — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  margin: 0 auto;
  background: var(--color-contrast);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1024px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-30) var(--space-40) var(--space-40);
    background: var(--color-base);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  }
  .site-nav.is-open { display: flex; }

  .site-nav a:not(.btn) {
    padding: 12px 0;
    font-size: var(--fs-medium);
    border-bottom: 1px solid var(--color-border);
  }
  .site-nav .btn {
    margin-top: var(--space-30);
    text-align: center;
  }
}

/* ---- Sections ---- */
.section { padding-block: var(--space-70); scroll-margin-top: var(--header-h, 80px); }
.section--alt {
  background-color: var(--color-accent-5);
  padding-block: var(--space-80);
  box-shadow: var(--section-edge-shadow);
}

.hero { padding-block: var(--space-80) var(--space-70); }
.hero__list {
  list-style: none;
  margin: var(--space-50) auto;
  padding: 0;
  display: inline-block;
  text-align: left;
  font-size: var(--fs-medium);
}
.hero__list li { margin-bottom: var(--space-20); }
.hero__list li::before { content: "—"; color: var(--color-accent-3); margin-right: 0.6em; }
.hero__actions {
  display: flex;
  gap: var(--space-30);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-50);
}

/* ---- Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-40);
  margin-block: var(--space-50);
}
/* Force an even 3-per-row layout (was auto-fitting to 4 on top). */
#what-i-do .card-grid,
#faq .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 880px) {
  #what-i-do .card-grid,
  #faq .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  #what-i-do .card-grid,
  #faq .card-grid { grid-template-columns: 1fr; }
}
.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-40);
}
.card h3 { margin-bottom: var(--space-20); }
.card p { margin-bottom: 0; color: var(--color-accent-4); }
.card--plain { border: none; padding-inline: 0; }

/* ---- Timeline (How we work) ---- */
.timeline {
  list-style: none;
  margin: var(--space-50) auto 0;
  padding: 0;
  max-width: var(--content-size);
}
.timeline__item {
  position: relative;
  padding-left: var(--space-40);
  padding-bottom: var(--space-50);
  border-left: 2px solid var(--color-border);
}
/* Keep the line running past the final node so it encloses the last step. */
.timeline__item:last-child { padding-bottom: var(--space-30); }
.timeline__step {
  position: relative;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--color-accent-red);
  margin-bottom: var(--space-20);
}
/* Red node on the line — a nod to the flag's red disc.
   Anchored to the step text so it stays vertically centred on "Step X".
   left offset = padding (space-40) + border (2px) + half the dot (6px). */
.timeline__step::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-40) - 7px);
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent-red);
  box-shadow: 0 0 0 4px var(--color-base);
}
.timeline__body h3 { margin-bottom: var(--space-20); }
.timeline__body ul { margin: 0; padding-left: 1.1em; }

/* ---- Two column (Fit) ---- */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-50);
  margin-block: var(--space-50);
}
.check-list,
.cross-list { list-style: none; padding: 0; margin: 0; }
.check-list li,
.cross-list li { padding-left: 1.6em; position: relative; margin-bottom: var(--space-20); }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--color-brand); font-weight: 700; }
.cross-list li::before { content: "✕"; position: absolute; left: 0; color: var(--color-accent-red); font-weight: 700; }

/* ---- Accordion (Risk & transparency) ---- */
.risk-list { margin-top: var(--space-50); }
.risk-item {
  padding: var(--space-30) 0;
  border-bottom: 1px solid var(--color-border);
}
.risk-item h3 {
  font-size: var(--fs-large);
  margin-bottom: var(--space-20);
}
.risk-item ul { margin: 0; padding-left: 1.1em; }

/* ---- Credentials ---- */
.credentials {
  font-size: var(--fs-large);
  margin-top: var(--space-50);
  padding-left: 1.1em;
}
.credentials > li { margin-bottom: var(--space-20); }
.credentials ul { font-size: var(--fs-medium); margin-top: var(--space-20); }

/* ---- Form ---- */
.form { margin-top: var(--space-50); }
.form__row { margin-bottom: var(--space-30); }
.form__row label {
  display: block;
  font-weight: 600;
  font-size: var(--fs-small);
  margin-bottom: 8px;
}
.form input,
.form textarea {
  width: 100%;
  font: inherit;
  padding: 13px 16px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-base);
  color: var(--color-contrast);
}
.form input:focus,
.form textarea:focus { outline: none; border-color: var(--color-accent-3); }
.form textarea { resize: vertical; }
.form input[aria-invalid="true"],
.form textarea[aria-invalid="true"] { border-color: var(--color-danger); }
.form__actions { display: flex; justify-content: center; margin-top: var(--space-40); }

/* Honeypot — visually hidden but present in the DOM for bots. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__status { margin-top: var(--space-30); text-align: center; min-height: 1.4em; }
.form__status.is-error { color: var(--color-danger); }
.form__status.is-success { color: var(--color-brand); }

/* ---- Media / imagery ---- */

/* Hero image carousel — a contained gallery panel below the hero copy. */
/* Hero two-column layout: copy beside an image carousel. */
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-60);
  align-items: center;
}
/* Stack copy over carousel on mobile. Placed AFTER the base rule so it wins
   (a media query does not add specificity — source order decides ties). */
@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; }
}
.hero__copy { text-align: center; }
.hero__copy .hero__list { margin-left: auto; margin-right: auto; }
.hero__copy .hero__actions { justify-content: center; }
/* Stack the hero CTAs once the hero collapses to a single column (mobile). */
@media (max-width: 1024px) {
  .hero__actions { flex-direction: column; align-items: center; }
  .hero__actions .btn { width: 100%; max-width: 320px; }
}

.hero-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}
.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero-slide img { /* fit by height, keep natural width, never cropped */
  height: 100%;
  width: auto;
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}
.hero-slide.is-active { opacity: 1; }

/* A content section can carry a faint production-video background. */
.section--video { position: relative; overflow: hidden; }
.section--video > .container { position: relative; z-index: 1; }
.section__bg { position: absolute; inset: 0; z-index: 0; }
.section__bg::after { /* strong veil keeps these "white" sections light */
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.93);
}
.section__media { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Foreground photo with caption. */
.media-figure {
  margin: var(--space-50) auto 0;
  max-width: 100%;
  text-align: center;
}
.media-figure img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
}
.media-figure figcaption {
  margin-top: var(--space-20);
  font-size: var(--fs-small);
  color: var(--color-accent-4);
}

/* Personal avatar by the contact form. */
.contact-intro { text-align: center; margin-bottom: var(--space-40); }
.contact-intro .avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-base);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.contact-intro p { margin-top: var(--space-20); }

@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; } /* JS also stops auto-rotation */
  .section__media { display: none; } /* sections fall back to their plain background */
}

/* ---- Legal / policy pages ---- */
.legal { padding-block: var(--space-70); line-height: 1.7; }
.legal h1 { margin-bottom: var(--space-20); }
.legal h2 {
  font-size: var(--fs-x-large);
  margin-top: var(--space-60);
  margin-bottom: var(--space-30);
}
.legal p { margin-bottom: var(--space-30); }
.legal a { color: var(--color-brand); text-decoration: underline; }
.legal code { font-family: var(--font-mono); font-size: 0.9em; }
.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-40) 0;
  font-size: var(--fs-small);
}
.cookie-table th,
.cookie-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}
.cookie-table th { font-weight: 700; }

/* ---- Footer ---- */
.site-footer {
  background-color: var(--color-contrast);
  color: var(--color-base);
  padding-block: var(--space-40);
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* middle column is genuinely centered */
  align-items: center;
  gap: var(--space-30);
}
.site-footer__inner > :nth-child(1) { justify-self: start; }
.site-footer__inner > :nth-child(2) { justify-self: center; text-align: center; }
.site-footer__inner > :nth-child(3) { justify-self: end; text-align: right; }

@media (max-width: 1024px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .site-footer__inner > :nth-child(1),
  .site-footer__inner > :nth-child(2),
  .site-footer__inner > :nth-child(3) {
    justify-self: center;
    text-align: center;
  }
  .site-footer__brand { align-items: center; }
}
.site-footer p { margin: 0; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
/* Footer brand block (logo + social icon) — inline, mirrors the header. */
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-30);
}
.site-footer__brand .social-links {
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: var(--space-30);
}
.site-footer .social-link { display: inline-flex; color: var(--color-base); }
.site-footer .social-link:hover { opacity: 0.7; }
/* Footer links column (right side of the top row; expandable). */
.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: var(--fs-small);
}
/* Bottom bar: copyright on its own line, separated and centered. */
.site-footer__bottom {
  margin-top: var(--space-40);
  padding-top: var(--space-30);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
}
.site-footer__bottom p { margin: 0; }
/* Secondary emphasis (lighter than the bold "Independent"). */
.emph-soft { font-weight: 600; }
.site-title--footer { color: var(--color-base); }

/* ---- Cookie banner ---- */
.cookie-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--color-contrast);
  color: var(--color-base);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-40);
  padding-block: var(--space-30);
  flex-wrap: wrap;
}
.cookie-banner__text { margin: 0; font-size: var(--fs-small); max-width: 70ch; }
.cookie-banner a { color: inherit; text-decoration: underline; }
.cookie-banner__actions { display: flex; gap: var(--space-20); flex-wrap: wrap; }
