/* Load the brand families into the CSS closure (same families used by the
   --font-* tokens — not substitutes). The site also preconnects + links
   these in index.html; this @import ensures the @font-face rules live in
   the stylesheet too. */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=JetBrains+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&display=swap');

/* ============================================================
   Safa Othman — Portfolio
   Visual system: technical editorial / engineered
   ============================================================ */

:root {
  /* --- Color: ink & paper --- */
  --ink-900: #08090B;   /* deepest background */
  --ink-850: #0C0E11;
  --ink-800: #111418;   /* card surfaces */
  --ink-700: #181C22;   /* raised surfaces */
  --ink-600: #232930;   /* hairlines hover */
  --line:    #20262E;   /* hairline borders */
  --line-soft: #171B21;

  --fg-1: #F3F1EA;      /* primary text (warm white) */
  --fg-2: #A7ADB6;      /* secondary text */
  --fg-3: #6B727C;      /* tertiary / captions */
  --fg-4: #444B54;      /* faint */

  /* --- Accent: electric signal (theme-able: set --accent, rest derives) --- */
  --accent: #C6F24E;        /* signal lime */
  --accent-press: color-mix(in oklab, var(--accent), #000 16%);
  --accent-ink: #0B0D08;    /* text on accent */
  --accent-glow: color-mix(in srgb, var(--accent) 22%, transparent);

  /* --- Type --- */
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* --- Spacing scale --- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 140px;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --maxw: 1240px;
  --gutter: 40px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* @kind other */
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink-900);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* ---------- Modern, sleek on-brand scrollbar ---------- */
/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(198, 242, 78, 0.35) transparent;
}
/* WebKit / Chromium */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(198, 242, 78, 0.45), rgba(168, 214, 54, 0.30));
  border-radius: 100px;
  transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-press));
}
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

/* subtle grain + vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(198,242,78,0.05), transparent 55%),
    radial-gradient(100% 60% at 100% 110%, rgba(198,242,78,0.03), transparent 60%);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- Layout helpers ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.section {
  padding: var(--sp-10) 0;
  border-top: 1px solid var(--line-soft);
  position: relative;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.section-title em {
  font-style: normal;
  color: var(--accent);
}

.section-lead {
  color: var(--fg-2);
  max-width: 44ch;
  font-size: 18px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  font-weight: 500;
  padding: 14px 22px;
  border-radius: 100px;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-press); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-ghost {
  background: transparent;
  color: var(--fg-1);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-ghost:active { transform: translateY(0) scale(0.98); }

/* ============================================================
   HEADER
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  transition: transform 0.4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-2);
  padding: 8px 14px;
  border-radius: 100px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-links a:hover { color: var(--fg-1); background: var(--ink-700); }

.nav-cta { display: flex; align-items: center; gap: 14px; }

.nav-burger { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; color: var(--fg-1); }
.nav-burger svg { width: 20px; height: 20px; margin: 0 auto; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-top: 180px;
  padding-bottom: var(--sp-9);
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: var(--sp-8);
  align-items: center;
}
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-2);
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  margin-bottom: var(--sp-6);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 9px rgba(198,242,78,0); }
  100% { box-shadow: 0 0 0 0 rgba(198,242,78,0); }
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 8.2vw, 104px);
  line-height: 0.94;
  letter-spacing: -0.035em;
}
.hero h1 .accent { color: var(--accent); }
.hero-role {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: var(--sp-5) 0 var(--sp-5);
  flex-wrap: wrap;
}
.role-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-1);
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--ink-800);
}
.hero-tagline {
  font-size: clamp(18px, 2vw, 22px);
  color: var(--fg-2);
  max-width: 46ch;
  margin-bottom: var(--sp-7);
  text-wrap: pretty;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual { position: relative; }
.hero-avatar {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-800);
}
image-slot { display: block; }
.hero-frame-tag {
  position: absolute;
  bottom: 18px; left: 18px; right: 18px;
  background: rgba(8,9,11,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-2);
}
.hero-frame-tag b { color: var(--accent); font-weight: 500; }

/* marquee of skills under hero */
.marquee {
  margin-top: var(--sp-9);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 22px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 56px;
  width: max-content;
  animation: scroll 26s linear infinite;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-3);
  letter-spacing: 0.04em;
}
.marquee-track span { display: inline-flex; align-items: center; gap: 56px; }
.marquee-track span::after { content: "✦"; color: var(--accent); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: var(--sp-8);
}
.about-body p { color: var(--fg-2); font-size: 18px; margin-bottom: var(--sp-5); }
.about-body p strong { color: var(--fg-1); font-weight: 600; }
.about-body .lead { font-size: 22px; color: var(--fg-1); font-weight: 500; line-height: 1.45; }

.expertise { list-style: none; margin-top: var(--sp-6); }
.expertise li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-1);
}
.expertise li span.idx { color: var(--accent); font-size: 12px; }
.expertise li span.tag { margin-left: auto; color: var(--fg-3); font-size: 12px; }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: var(--sp-6);
}
.stat { background: var(--ink-850); padding: var(--sp-6) var(--sp-5); }
.stat .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 5vw, 58px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--fg-1);
}
.stat .num .suf { color: var(--accent); }
.stat .lbl {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
  letter-spacing: 0.05em;
  margin-top: 10px;
  text-transform: uppercase;
}

/* ============================================================
   SERVICES
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.service {
  background: var(--ink-850);
  padding: var(--sp-7) var(--sp-6);
  position: relative;
  transition: background 0.3s var(--ease);
  overflow: hidden;
}
.service:hover { background: var(--ink-800); }
.service::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s var(--ease);
}
.service:hover::after { transform: scaleY(1); }
.service-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-4);
  letter-spacing: 0.1em;
}
.service-ic {
  width: 50px; height: 50px;
  border-radius: 13px;
  background: var(--ink-700);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  margin: var(--sp-5) 0 var(--sp-5);
  color: var(--accent);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.service:hover .service-ic { transform: translateY(-3px); }
.service-ic svg { width: 24px; height: 24px; }
.service h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 25px;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.service p { color: var(--fg-2); font-size: 15.5px; max-width: 40ch; }
.service-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-5); }
.service-tags span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-3);
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
}

/* ============================================================
   PRODUCTS (Vertex)
   ============================================================ */
.vertex-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-1);
  padding: 8px 16px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--ink-800);
}
.vertex-badge .vx {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--fg-1); color: var(--ink-900);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.product {
  background: var(--ink-850);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
  display: flex;
  flex-direction: column;
}
.product:hover { transform: translateY(-6px); border-color: var(--line); }
.product-media {
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(120% 100% at 50% 0%, var(--ink-700), var(--ink-850));
  position: relative;
  border-bottom: 1px solid var(--line-soft);
}
.product-media image-slot { width: 100%; height: 100%; }
.product-tagn {
  position: absolute;
  top: 14px; left: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  background: rgba(8,9,11,0.55);
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 100px;
  z-index: 3;
}
.product-info { padding: var(--sp-5); display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-info h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.product-info p { color: var(--fg-2); font-size: 14.5px; flex: 1; }
.product-brands { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.product-brands span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--sp-8);
}
.contact-info { display: flex; flex-direction: column; gap: 4px; }
.contact-channels { margin-top: var(--sp-6); display: flex; flex-direction: column; }
.channel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--line-soft);
  transition: padding 0.3s var(--ease);
}
.channel:hover { padding-left: 8px; }
.channel-ic {
  width: 44px; height: 44px;
  border-radius: 11px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.channel-ic svg { width: 20px; height: 20px; }
.channel .k { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-3); letter-spacing: 0.06em; text-transform: uppercase; }
.channel .v { font-size: 16px; color: var(--fg-1); font-weight: 500; }

.form {
  background: var(--ink-850);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: var(--sp-7);
}
.field { margin-bottom: var(--sp-5); }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.field input, .field textarea {
  width: 100%;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: 16px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--ink-850);
}
.field input::placeholder, .field textarea::placeholder { color: var(--fg-4); }
.field textarea { resize: vertical; min-height: 130px; }
.form .btn-primary { width: 100%; justify-content: center; }
.form-note { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); margin-top: 14px; text-align: center; }
.form-note.ok { color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: var(--sp-9) 0 var(--sp-7);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--sp-7);
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid var(--line-soft);
}
.footer-bigname {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 76px);
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.footer-bigname .accent { color: var(--accent); }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col a { color: var(--fg-2); font-size: 15px; transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-6);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-3);
  flex-wrap: wrap;
  gap: var(--sp-4);
}
.socials { display: flex; gap: 10px; }
.social {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--fg-2);
  transition: all 0.25s var(--ease);
}
.social:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.social svg { width: 18px; height: 18px; }

/* ============================================================
   Reveal animation
   ============================================================ */
/* Hidden state only applies when JS is active (see inline head script).
   If main.js fails to load, content stays fully visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  :root { --gutter: 26px; }
  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-7); }
  .hero-visual { max-width: 380px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr; gap: var(--sp-6); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .nav-burger { display: grid; place-items: center; }
  .nav .btn-ghost { display: none; }
  .section { padding: var(--sp-9) 0; }
  .services-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(8,9,11,0.97);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: var(--gutter);
  transform: translateY(-100%);
  transition: transform 0.45s var(--ease);
}
.mobile-menu.open { transform: none; }
.mobile-menu a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 36px;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.mobile-menu a:active { color: var(--accent); }
.mobile-close { position: absolute; top: 22px; right: 26px; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 12px; color: var(--fg-1); display: grid; place-items: center; }
.mobile-close svg { width: 22px; height: 22px; }
