/* =========================================================================
   Rayyan Enterprises — E-Waste Solutions
   Design System: "Electronic Forest" — Tech-Forward Sustainability
   ========================================================================= */

/* ---------- Design Tokens ---------- */
:root{
  /* Color */
  --surface: #f5faf6;
  --surface-dim: #dfeee5;
  --surface-bright: #fbfefb;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #edf7f0;
  --surface-container: #e3f1e7;
  --surface-container-high: #d8eadd;
  --surface-container-highest: #cfe5d6;
  --on-surface: #10281d;
  --on-surface-variant: #4d6258;
  --inverse-surface: #18352b;
  --inverse-on-surface: #ebf6ef;
  --outline: #728679;
  --outline-variant: #bfd5c8;
  --primary: #006c49;
  --on-primary: #ffffff;
  --primary-container: #10b981;
  --on-primary-container: #00422b;
  --inverse-primary: #63d5a3;
  --secondary: #586f69;
  --on-secondary: #ffffff;
  --secondary-container: #d8ece1;
  --on-secondary-container: #415950;
  --tertiary: #4f645b;
  --on-tertiary: #ffffff;
  --tertiary-container: #9cb8a9;
  --on-tertiary-container: #213a32;
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #93000a;
  --primary-fixed: #7af0c0;
  --primary-fixed-dim: #67d7a8;
  --on-primary-fixed: #002113;
  --on-primary-fixed-variant: #005236;
  --secondary-fixed: #e1f1ea;
  --secondary-fixed-dim: #c3d7ce;
  --tertiary-fixed: #dfece6;
  --tertiary-fixed-dim: #c7d7d0;
  --background: #edf5ef;
  --background-soft: #f7faf8;
  --section-alt: #eaf3ee;
  --section-strong: #e3efe7;
  --on-background: #10281d;
  --surface-variant: #dfece4;

  /* Type */
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;

  /* Spacing (8px linear scale) */
  --sp-base: 4px;
  --sp-xs: 8px;
  --sp-sm: 16px;
  --sp-md: 24px;
  --sp-lg: 40px;
  --sp-xl: 64px;
  --container-max: 1280px;
  --gutter: 24px;
  --margin-mobile: 16px;
  --margin-desktop: 48px;

  /* Radius */
  --r-sm: 0.25rem;
  --r-md: 0.5rem;
  --r-lg: 0.75rem;
  --r-xl: 1rem;
  --r-2xl: 1.5rem;
  --r-full: 9999px;

  /* Elevation */
  --shadow-ambient: 0 10px 40px -10px rgba(0,0,0,0.08);
  --shadow-soft: 0 4px 40px rgba(11,28,48,0.06);
  --shadow-lg: 0 20px 60px -15px rgba(0,108,73,0.25);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur-mid: 320ms;
  --dur-slow: 600ms;

  --header-h: 80px;
}

/* ---------- Reset ---------- */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, ul, ol{ margin: 0; }
ul, ol{ padding: 0; list-style: none; }
img, picture, svg{ display: block; max-width: 100%; }
button, input, select, textarea{ font: inherit; color: inherit; }
a{ color: inherit; text-decoration: none; }
button{ cursor: pointer; background: none; border: none; }

body{
  background: linear-gradient(180deg, var(--background) 0%, var(--background-soft) 100%);
  color: var(--on-background);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

@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;
    scroll-behavior: auto !important;
  }
}

/* ---------- Typography ---------- */
h1, h2, h3, .font-display{ font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; color: var(--on-background); }

.display-lg{ font-size: clamp(32px, 4.4vw, 48px); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.headline-md{ font-size: clamp(24px, 3vw, 32px); line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.headline-sm{ font-size: 22px; line-height: 1.35; font-weight: 600; }
.body-lg{ font-size: 18px; line-height: 1.6; font-weight: 400; }
.body-md{ font-size: 16px; line-height: 1.55; font-weight: 400; }
.label-md{ font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: 0.04em; }
.label-sm{ font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.04em; }
.eyebrow{ text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; font-size: 12px; }
.text-primary{ color: var(--primary); }
.text-muted{ color: var(--on-surface-variant); }

/* ---------- Layout ---------- */
.container{ width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: var(--margin-mobile); }
@media (min-width: 900px){ .container{ padding-inline: var(--margin-desktop); } }

.section{ padding-block: var(--sp-xl); background: transparent; }
.section-tight{ padding-block: var(--sp-lg); }

.page-shell,
main{
  background: transparent;
}

.section-soft{
  background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0.75));
}

.tech-grid{
  background-image: radial-gradient(circle, rgba(0,108,73,0.10) 1.2px, transparent 1.5px);
  background-size: 22px 22px;
  background-color: rgba(255,255,255,0.12);
}

.grid{ display: grid; gap: var(--gutter); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-4{ grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px){
  .grid-3, .grid-4{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .grid-2, .grid-3, .grid-4{ grid-template-columns: 1fr; }
}

.flex{ display: flex; }
.items-center{ align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-xs{ gap: var(--sp-xs); }
.gap-sm{ gap: var(--sp-sm); }
.gap-md{ gap: var(--sp-md); }
.text-center{ text-align: center; }

/* ---------- Skip Link (Accessibility) ---------- */
.skip-link{
  position: absolute;
  left: 12px; top: -60px;
  background: var(--primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r-md);
  z-index: 999;
  transition: top var(--dur-fast) var(--ease-out);
  font-weight: 600;
}
.skip-link:focus{ top: 12px; }

/* ---------- Focus states ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible{
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---------- Header / Nav ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(248,249,255,0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--outline-variant);
  transition: box-shadow var(--dur-mid) var(--ease-out), background var(--dur-mid) var(--ease-out);
}
.site-header.is-scrolled{ box-shadow: var(--shadow-soft); }

.nav-bar{
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--margin-mobile);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
@media (min-width: 900px){ .nav-bar{ padding-inline: var(--margin-desktop); } }

.brand{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--primary);
  min-height: 44px;
}
.brand-logo{
  display: block;
  width: clamp(180px, 19vw, 335px);
  height: auto;
  max-height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0,108,73,0.12));
}
.brand-footer{ margin-bottom: 10px; }
.footer-brand .brand-logo,
.brand-footer .brand-logo{ width: clamp(160px, 18vw, 240px); max-height: 58px; }
.brand .brand-mark{
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
@media (max-width: 640px){ .brand-logo{ width: clamp(150px, 48vw, 210px); max-height: 54px; } }

.nav-links{
  display: none;
  align-items: center;
  gap: var(--sp-md);
  font-size: 14px;
  font-weight: 600;
}
@media (min-width: 900px){ .nav-links{ display: flex; } }

.nav-links a{
  position: relative;
  color: var(--on-surface-variant);
  padding-block: 6px;
  transition: color var(--dur-fast);
}
.nav-links a::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-mid) var(--ease-out);
}
.nav-links a:hover{ color: var(--primary); }
.nav-links a:hover::after{ transform: scaleX(1); }
.nav-links a[aria-current="page"]{ color: var(--primary); }
.nav-links a[aria-current="page"]::after{ transform: scaleX(1); }

.nav-actions{ display: flex; align-items: center; gap: var(--sp-sm); }

.nav-toggle{
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--r-md);
}
@media (min-width: 900px){ .nav-toggle{ display: none; } }
.nav-toggle span{
  width: 22px; height: 2px;
  background: var(--on-background);
  border-radius: 2px;
  transition: transform var(--dur-mid) var(--ease-out), opacity var(--dur-fast);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

.mobile-menu{
  display: none;
  overflow: hidden;
  border-bottom: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
}
.mobile-menu.is-open{
  display: grid;
}
.mobile-menu-inner{ min-height: 0; padding: var(--sp-sm) var(--margin-mobile) var(--sp-md); display: flex; flex-direction: column; gap: var(--sp-xs); }
.mobile-menu-inner a{ padding: 10px 4px; font-weight: 600; color: var(--on-surface-variant); border-radius: var(--r-md); }
.mobile-menu-inner a[aria-current="page"]{ color: var(--primary); }
.mobile-menu-inner a:hover{ background: var(--surface-container-low); color: var(--primary); }

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), filter var(--dur-fast), background var(--dur-fast);
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary{
  background: linear-gradient(120deg, var(--primary), var(--primary-container));
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(0,108,73,0.45);
}
.btn-primary:hover{ filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 14px 30px -10px rgba(0,108,73,0.55); }
.btn-secondary{
  background: transparent;
  border-color: var(--outline);
  color: var(--on-surface);
}
.btn-secondary:hover{ background: var(--surface-container-low); border-color: var(--primary); color: var(--primary); }
.btn-ghost{ background: var(--surface-container); color: var(--on-surface); }
.btn-ghost:hover{ background: var(--surface-container-high); }
.btn-sm{ padding: 10px 18px; font-size: 13px; }
.btn-full{ width: 100%; }
.btn[disabled]{ opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---------- Chips ---------- */
.chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  color: var(--on-surface);
}
.chip-primary{ background: #d1fae5; color: #064e3b; border-color: rgba(52,211,153,0.4); }
.chip.is-toggle{ transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); }
.chip.is-toggle:hover{ background: var(--surface-variant); }
.chip.is-active{ background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Glass Panel ---------- */
.glass{
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226,232,240,0.6);
}

/* ---------- Cards ---------- */
.card{
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-xl);
  padding: var(--sp-md);
  box-shadow: var(--shadow-soft);
  transition: transform var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid) var(--ease-out), border-color var(--dur-mid);
}
.card:hover{ transform: translateY(-4px); box-shadow: 0 20px 45px -18px rgba(11,28,48,0.18); border-color: rgba(0,108,73,0.3); }
.card-icon{
  width: 48px; height: 48px;
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  background: rgba(16,185,129,0.14);
  color: var(--primary);
  margin-bottom: var(--sp-sm);
  flex-shrink: 0;
}

/* ---------- Icons (inline SVG uses currentColor) ---------- */
.icon{ width: 1em; height: 1em; display: inline-block; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg{ font-size: 28px; }

/* ---------- Reveal-on-scroll ---------- */
.reveal{ opacity: 0; transform: translateY(24px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.is-visible{ opacity: 1; transform: translateY(0); }
.reveal-delay-1{ transition-delay: 80ms; }
.reveal-delay-2{ transition-delay: 160ms; }
.reveal-delay-3{ transition-delay: 240ms; }
.reveal-delay-4{ transition-delay: 320ms; }

/* ---------- Progress / meters ---------- */
.meter{ width: 100%; height: 8px; border-radius: var(--r-full); background: var(--surface-container-high); overflow: hidden; }
.meter-fill{ height: 100%; border-radius: var(--r-full); background: var(--primary); width: 0%; transition: width 1.1s var(--ease-out); }

/* ---------- Footer ---------- */
.site-footer{
  background: var(--on-surface);
  color: var(--secondary-fixed);
  margin-top: auto;
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--sp-md);
  padding-block: var(--sp-lg);
}
@media (max-width: 820px){ .footer-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px){ .footer-grid{ grid-template-columns: 1fr; } }
.site-footer h4{ color: #fff; font-family: var(--font-display); font-size: 14px; margin-bottom: var(--sp-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.site-footer a{ color: var(--secondary-fixed-dim); display: block; padding-block: 6px; font-size: 14px; transition: color var(--dur-fast); }
.site-footer a:hover{ color: var(--primary-fixed-dim); }
.footer-bottom{
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-block: var(--sp-sm);
  font-size: 12px;
  color: var(--secondary-fixed-dim);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-social{ display: flex; gap: 10px; }
.footer-social a{
  width: 36px; height: 36px; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  padding: 0;
}
.footer-social a:hover{ background: var(--primary); color: #fff; }

/* ---------- Back to top ---------- */
.back-to-top{
  position: fixed;
  right: 20px; bottom: 20px;
  width: 48px; height: 48px;
  border-radius: var(--r-full);
  background: var(--on-surface);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--dur-mid), transform var(--dur-mid), visibility var(--dur-mid);
  z-index: 60;
}
.back-to-top.is-visible{ opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover{ background: var(--primary); }

/* ---------- Toast (form feedback) ---------- */
.toast{
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--on-surface);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600;
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-mid) var(--ease-out), transform var(--dur-mid) var(--ease-out), visibility var(--dur-mid);
  z-index: 200;
  max-width: min(90vw, 420px);
}
.toast.is-visible{ opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast .icon{ color: var(--primary-fixed-dim); flex-shrink: 0; }

/* ---------- Forms ---------- */
.field{ display: flex; flex-direction: column; gap: 6px; }
.field label{ font-size: 13px; font-weight: 600; color: var(--on-surface); }
.field .hint{ font-size: 12px; color: var(--on-surface-variant); }
.field .error-msg{ font-size: 12px; color: var(--error); display: none; }
.field.has-error .error-msg{ display: block; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea{ border-color: var(--error); }

.input, select.input, textarea.input{
  width: 100%;
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-md);
  padding: 13px 16px;
  font-size: 15px;
  color: var(--on-background);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input:focus, select.input:focus, textarea.input:focus{
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,108,73,0.15);
}
textarea.input{ resize: vertical; min-height: 100px; }
select.input{ appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233c4a42' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

.form-progress{ display: flex; gap: 8px; margin-bottom: 8px; }
.form-progress .step-bar{ height: 6px; flex: 1; border-radius: var(--r-full); background: var(--tertiary-fixed-dim); transition: background var(--dur-mid); }
.form-progress .step-bar.is-done, .form-progress .step-bar.is-active{ background: var(--primary); }
.form-steps-labels{ display: flex; justify-content: space-between; font-size: 12px; color: var(--secondary); margin-bottom: var(--sp-md); flex-wrap: wrap; gap: 4px; }
.form-steps-labels span.is-active{ color: var(--primary); font-weight: 700; }

.form-step{ display: none; }
.form-step.is-active{ display: block; animation: fadeInStep var(--dur-mid) var(--ease-out); }
@keyframes fadeInStep{ from{ opacity: 0; transform: translateX(12px); } to{ opacity: 1; transform: translateX(0); } }

/* ---------- Counters / stats ---------- */
.stat-num{ font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 4vw, 40px); }

/* ---------- Utility ---------- */
.rounded-2xl{ border-radius: var(--r-2xl); }
.overflow-hidden{ overflow: hidden; }
.relative{ position: relative; }
.mt-auto{ margin-top: auto; }
.sr-only{
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.mb-xs{ margin-bottom: var(--sp-xs); }
.mb-sm{ margin-bottom: var(--sp-sm); }
.mb-md{ margin-bottom: var(--sp-md); }
.max-w-prose{ max-width: 640px; }
.mx-auto{ margin-inline: auto; }
.hide-mobile{ display: none; }
@media (min-width: 640px){ .hide-mobile{ display: inline-flex; } }

/* ---------- Loading skeleton for images ---------- */
img[loading="lazy"]{ background: var(--surface-container-low); }

/* ---------- Page-specific hooks are declared inline where noted ---------- */
