/* ==========================================================================
   Naebak — base design system
   Arabic-first · RTL · soft surfaces · mint/forest palette
   ========================================================================== */

:root {
  --ink-950: #03110a;
  --ink-900: #052015;
  --ink-800: #07301f;
  --ink-700: #0a4230;
  --ink-600: #0f5a41;
  --brand-700: #087a3e;
  --brand-600: #0a9950;
  --brand-500: #12b95f;
  --brand-400: #2fdd7d;
  --brand-300: #71f0a6;
  --brand-200: #b8ffd2;
  --brand-100: #e3fced;
  --brand-50: #f1fdf6;

  --mint: #9dffc4;
  --mint-soft: #c9ffdd;

  --paper: #f6faf7;
  --paper-2: #eef7f1;
  --surface: #ffffff;
  --surface-soft: #f9fcfb;
  --muted: #5d7268;
  --muted-2: #7b8f84;
  --line: rgba(6, 33, 23, 0.09);
  --line-strong: rgba(6, 33, 23, 0.16);

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-2xl: 40px;
  --pill: 999px;

  --shadow-xs: 0 1px 2px rgba(6, 33, 23, 0.05);
  --shadow-sm: 0 4px 14px -6px rgba(6, 33, 23, 0.12);
  --shadow-md: 0 18px 40px -22px rgba(6, 33, 23, 0.22);
  --shadow-lg: 0 34px 80px -40px rgba(6, 33, 23, 0.4);
  --shadow-glow: 0 18px 45px -16px rgba(18, 185, 95, 0.55);

  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --container: 1180px;
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-900);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.page-home,
body.page-inner {
  background: var(--paper);
}

body.page-home {
  overflow-x: hidden;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--ink-900);
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--brand-200);
  color: var(--ink-900);
}

:focus-visible {
  outline: 3px solid rgba(47, 221, 125, 0.55);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2rem);
}

.section {
  padding-block: clamp(4rem, 8vw, 7rem);
  position: relative;
}

.section-head {
  max-width: 700px;
  margin-bottom: clamp(2.2rem, 4vw, 3.4rem);
}

.section-head h2 {
  font-size: clamp(2rem, 3.8vw, 3rem);
  margin-bottom: 1rem;
}

.section-head p {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 620px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
  padding: 0.38rem 0.9rem;
  border-radius: var(--pill);
  background: var(--brand-50);
  border: 1px solid rgba(10, 153, 80, 0.16);
  color: var(--brand-700);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.6;
}

.eyebrow-light {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: #d8ffe7;
  backdrop-filter: blur(10px);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-400);
  box-shadow: 0 0 0 0 rgba(47, 221, 125, 0.5);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 221, 125, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(47, 221, 125, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 221, 125, 0); }
}

.text-gradient {
  background: linear-gradient(100deg, #d6ffe6 0%, #8bf3b4 34%, #36dd7f 72%, #b9ffd4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-gradient-dark {
  background: linear-gradient(100deg, #087a3e, #12b95f 55%, #0a7a55);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.icon {
  display: inline-block;
  vertical-align: -0.18em;
  flex: none;
}

.skip-link {
  position: fixed;
  inset-block-start: -100px;
  inset-inline-start: 1rem;
  z-index: 999;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  background: var(--ink-900);
  color: #fff;
  font-weight: 600;
  transition: inset-block-start 0.2s ease;
}

.skip-link:focus {
  inset-block-start: 1rem;
}

/* --------------------------------------------------------------------------
   Buttons — soft, pill-shaped, tactile
   -------------------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.92rem 1.55rem;
  border: 1px solid transparent;
  border-radius: var(--pill);
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  text-align: center;
  isolation: isolate;
  transition:
    transform 0.28s var(--ease),
    box-shadow 0.28s var(--ease),
    background-color 0.28s var(--ease),
    color 0.28s var(--ease),
    border-color 0.28s var(--ease);
}

.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn-primary {
  color: #04200f;
  background: linear-gradient(135deg, #b6ffd2 0%, #58e798 36%, #17bd64 100%);
  box-shadow:
    0 10px 26px -10px rgba(18, 185, 95, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -2px 6px rgba(4, 60, 30, 0.16);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 48%);
  opacity: 0.75;
  pointer-events: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 40px -14px rgba(18, 185, 95, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -2px 6px rgba(4, 60, 30, 0.16);
}

.btn-soft {
  color: #076236;
  background: var(--brand-50);
  border-color: rgba(10, 153, 80, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.btn-soft:hover {
  background: #e2f9ec;
  border-color: rgba(10, 153, 80, 0.34);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--ink-800);
  background: transparent;
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: var(--surface-soft);
  border-color: rgba(10, 153, 80, 0.3);
  color: var(--brand-700);
}

.btn-outline {
  color: var(--ink-800);
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(6, 33, 23, 0.18);
}

.btn-outline:hover {
  border-color: var(--brand-500);
  color: var(--brand-700);
  background: #fff;
}

.btn-glass {
  color: #ecfff4;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 1.08rem 1.9rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.68rem 1.15rem;
  font-size: 0.88rem;
}

.btn-xs {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  margin-bottom: 1.05rem;
}

.field > label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-800);
}

.field .req,
.field > label span {
  color: var(--brand-600);
}

.field-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-900);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.field-input::placeholder {
  color: #9aa9a0;
  font-weight: 400;
}

.field-input:hover {
  border-color: rgba(6, 33, 23, 0.26);
}

.field-input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(18, 185, 95, 0.13);
  background: #fff;
}

textarea.field-input {
  min-height: 130px;
  resize: vertical;
}

select.field-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 2.4rem;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--muted-2);
  line-height: 1.6;
}

.field-error {
  font-size: 0.8rem;
  color: #b42318;
  line-height: 1.6;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.field-link {
  font-size: 0.8rem;
  color: var(--brand-700);
  font-weight: 600;
}

.field-link:hover {
  text-decoration: underline;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.1rem;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.4rem 0 1rem;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--muted);
  cursor: pointer;
}

.check-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 0.22rem;
  accent-color: var(--brand-600);
  flex: none;
  cursor: pointer;
}

.check-field a {
  color: var(--brand-700);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-alert {
  padding: 0.85rem 1rem;
  margin-bottom: 1.1rem;
  border: 1px solid #f3c7c2;
  border-radius: var(--radius-sm);
  background: #fff5f4;
  color: #8f1d13;
  font-size: 0.86rem;
}

.form-alert p { margin: 0; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.form-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted-2);
}

.form-hint-center {
  justify-content: center;
  width: 100%;
  margin-top: 0.9rem;
}

/* --------------------------------------------------------------------------
   Affiliation ribbon + header
   -------------------------------------------------------------------------- */
.affiliation-ribbon {
  position: relative;
  z-index: 60;
  background: #04170e;
  color: #c9e7d5;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ribbon-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 38px;
  padding-block: 0.35rem;
  text-align: center;
  flex-wrap: wrap;
}

.ribbon-inner p {
  margin: 0;
  line-height: 1.6;
}

.ribbon-inner strong {
  color: #eafff2;
  font-weight: 600;
}

.ribbon-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, #1f8f56, #0c5f39);
  color: #eafff2;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  flex: none;
}

.ribbon-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #8ef0b4;
  font-weight: 600;
  white-space: nowrap;
}

.ribbon-link:hover {
  color: #ccffdd;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -24px rgba(6, 33, 23, 0.4);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(6, 33, 23, 0.14));
}

.brand-word {
  display: flex;
  flex-direction: column;
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink-900);
}

.brand-word small {
  font-size: 0.53rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--muted-2);
  margin-top: 2px;
}

.brand-light .brand-word {
  color: #f2fff8;
}

.brand-light .brand-word small {
  color: #8fb7a0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 1.9rem);
}

.main-nav a {
  position: relative;
  padding-block: 0.5rem;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0.1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-500);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s var(--ease);
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--ink-900);
}

.main-nav a:hover::after,
.main-nav a.is-active::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: none;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  padding: 11px 9px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-800);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(4, 20, 13, 0.45);
  backdrop-filter: blur(3px);
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  inset-block-start: 1.2rem;
  inset-inline-start: 50%;
  transform: translateX(50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(460px, calc(100vw - 2rem));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  line-height: 1.65;
  animation: toast-in 0.35s var(--ease) both;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: none;
  background: var(--brand-50);
  color: var(--brand-700);
}

.toast-text { flex: 1; padding-top: 0.12rem; }

.toast-close {
  border: 0;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 6px;
}

.toast-close:hover { background: var(--surface-soft); color: var(--ink-900); }

.toast-success { border-inline-start: 3px solid var(--brand-500); }
.toast-info { border-inline-start: 3px solid #3b82f6; }
.toast-warning { border-inline-start: 3px solid #e8a317; }
.toast-error { border-inline-start: 3px solid #d92d20; }
.toast-error .toast-icon { background: #fef3f2; color: #b42318; }
.toast-info .toast-icon { background: #eff6ff; color: #1d4ed8; }
.toast-warning .toast-icon { background: #fffaeb; color: #b54708; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  background:
    radial-gradient(900px 420px at 85% 0%, rgba(18, 185, 95, 0.14), transparent 62%),
    #04170e;
  color: #bcd9c8;
  padding-top: clamp(3.2rem, 6vw, 4.6rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.25fr;
  gap: clamp(1.6rem, 4vw, 3.4rem);
  padding-bottom: 2.8rem;
}

.footer-brand p {
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.9;
  color: #9dbfab;
  max-width: 320px;
}

.footer-legal-name {
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem !important;
  color: #7fa18e !important;
}

.footer-legal-name strong {
  color: #c9e7d5;
  font-weight: 600;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-col h3 {
  margin-bottom: 0.55rem;
  color: #eafff2;
  font-size: 0.92rem;
  font-weight: 600;
}

.footer-col a,
.footer-col p {
  font-size: 0.88rem;
  color: #9dbfab;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: #8ef0b4;
}

.footer-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.footer-note {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.7rem;
  color: #8ef0b4 !important;
  font-weight: 600;
}

.footer-cta:hover { color: #ccffdd !important; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: #7fa18e;
  flex-wrap: wrap;
}

.footer-bottom p { margin: 0; }

/* --------------------------------------------------------------------------
   Reveal + utilities
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: calc(var(--reveal-delay, 0) * 90ms);
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

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

/* --------------------------------------------------------------------------
   Responsive header / footer
   -------------------------------------------------------------------------- */
@media (max-width: 1020px) {
  .main-nav {
    position: fixed;
    inset-block-start: 0;
    inset-inline-start: 0;
    z-index: 55;
    width: min(340px, 86vw);
    height: 100dvh;
    padding: 5.5rem 1.6rem 2rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    background: #fff;
    box-shadow: -20px 0 60px -30px rgba(6, 33, 23, 0.4);
    transform: translateX(105%);
    transition: transform 0.35s var(--ease);
    overflow-y: auto;
  }

  body.nav-open .main-nav {
    transform: none;
  }

  .main-nav a {
    padding: 0.85rem 0.4rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
  }

  .main-nav a::after { display: none; }

  .nav-toggle { display: flex; }

  .header-actions .btn-ghost {
    display: none;
  }
}

@media (max-width: 760px) {
  .affiliation-ribbon { font-size: 0.72rem; }
  .ribbon-inner { gap: 0.4rem; }
  .ribbon-link { display: none; }
  .header-actions .btn-primary { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .brand-word { font-size: 1.15rem; }
  .brand-mark { width: 38px; height: 38px; }
}
