/* ==========================================================================
   FERDOUS.AI — Design System v1
   Luxury + Technology + Minimalism (per Master Blueprint v1.0)
   ========================================================================== */

:root {
  --bg: #050505;
  --bg-2: #0d0d0f;
  --graphite: #151515;
  --line: rgba(216, 221, 227, 0.10);
  --line-strong: rgba(216, 221, 227, 0.22);
  --accent: #00a8ff;
  --accent-soft: rgba(0, 168, 255, 0.14);
  --silver: #d8dde3;
  --white: #ffffff;
  --text: #e9edf1;
  --muted: #9aa3ad;
  --radius: 14px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --max: 1180px;
  --pad: clamp(20px, 4vw, 48px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #001320; }

img { max-width: 100%; display: block; }

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

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

/* ---- Blueprint grid backdrop (brand signature) ---- */
.grid-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(216,221,227,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,221,227,0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
}
.glow-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 400px at 78% -8%, rgba(0,168,255,0.13), transparent 70%),
    radial-gradient(900px 500px at 12% 110%, rgba(0,168,255,0.05), transparent 70%);
  pointer-events: none;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--white);
  line-height: 1.12;
}
h1 { font-size: clamp(2.6rem, 6.5vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.lede { color: var(--muted); font-size: clamp(1.02rem, 1.6vw, 1.2rem); max-width: 62ch; }

/* ---- Layout ---- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.section-head { margin-bottom: clamp(36px, 5vw, 64px); display: grid; gap: 18px; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(5,5,5,0.72);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.06em;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(216,221,227,0.08), rgba(0,168,255,0.10));
}
.brand .dot-ai { color: var(--accent); }
.nav-links { display: flex; gap: clamp(14px, 2vw, 26px); list-style: none; align-items: center; }
.nav-links a {
  font-size: 0.86rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  transition: color 0.2s;
  padding: 6px 2px;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--white); }
.nav-links a[aria-current="page"] { border-bottom: 1px solid var(--accent); }
.nav-cta { display: flex; align-items: center; gap: 12px; }

.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  width: 42px; height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(.2,.8,.3,1), box-shadow 0.25s, background 0.25s, border-color 0.25s;
  will-change: transform;
}
.btn-primary {
  background: var(--accent);
  color: #001525;
  box-shadow: 0 0 0 rgba(0,168,255,0);
}
.btn-primary:hover { box-shadow: 0 8px 34px rgba(0,168,255,0.38); transform: translateY(-2px); }
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(216,221,227,0.03);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--white); transform: translateY(-2px); }
.btn-sm { padding: 9px 18px; font-size: 0.82rem; }

/* ---- Hero ---- */
.hero {
  min-height: calc(100svh - 68px);
  display: grid;
  align-content: center;
  padding: clamp(64px, 9vw, 110px) 0;
}
.hero-inner { display: grid; gap: 28px; max-width: 880px; }
.hero h1 { font-weight: 700; }
.hero .rotator {
  color: var(--accent);
  display: inline-block;
  min-width: 8ch;
  position: relative;
  text-shadow: 0 0 44px rgba(0,168,255,0.45);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-display);
  margin-top: 22px;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* ---- Cards & grids ---- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: linear-gradient(165deg, rgba(21,21,21,0.92), rgba(13,13,15,0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 34px);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(.2,.8,.3,1), border-color 0.3s;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 200px at var(--mx, 50%) var(--my, 0%), rgba(0,168,255,0.09), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.card:hover::after { opacity: 1; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.15rem;
  margin-bottom: 18px;
  border: 1px solid rgba(0,168,255,0.25);
}
.card-link {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 600;
}
.card-link .arr { transition: transform 0.25s; }
.card:hover .card-link .arr, .card-link:hover .arr { transform: translateX(5px); }

/* ---- Work / project tiles ---- */
.tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--graphite);
  transition: transform 0.3s cubic-bezier(.2,.8,.3,1), border-color 0.3s;
  display: flex;
  flex-direction: column;
}
.tile:hover { transform: translateY(-5px); border-color: rgba(0,168,255,0.4); }
.tile-visual {
  aspect-ratio: 16 / 10;
  position: relative;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(216,221,227,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,221,227,0.05) 1px, transparent 1px),
    linear-gradient(160deg, #101216, #08090b);
  background-size: 34px 34px, 34px 34px, 100% 100%;
  color: var(--silver);
  overflow: hidden;
}
.tile-visual .glyph { font-size: 2.4rem; opacity: 0.85; filter: drop-shadow(0 0 18px rgba(0,168,255,0.35)); }
.tile-visual .swap-note {
  position: absolute;
  bottom: 10px; right: 12px;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(216,221,227,0.34);
  font-family: var(--font-display);
}
.tile-body { padding: 22px 24px 26px; display: grid; gap: 8px; }
.tile-tag { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); font-family: var(--font-display); }
.tile-body h3 { font-size: 1.12rem; }
.tile-body p { color: var(--muted); font-size: 0.9rem; }

/* ---- Split sections ---- */
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 6vw, 72px); align-items: center; }

/* ---- Stats / trust ---- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat {
  border-left: 1px solid var(--line-strong);
  padding-left: 20px;
}
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  color: var(--white);
  font-weight: 700;
}
.stat span { color: var(--muted); font-size: 0.86rem; }

/* ---- Quote / testimonial ---- */
.quote {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--graphite);
  padding: clamp(26px, 3.4vw, 40px);
  display: grid;
  gap: 16px;
}
.quote p { font-size: 1.02rem; color: var(--text); }
.quote footer { color: var(--muted); font-size: 0.86rem; font-family: var(--font-display); letter-spacing: 0.04em; }
.quote footer b { color: var(--silver); }

/* ---- CTA band ---- */
.cta-band {
  border: 1px solid rgba(0,168,255,0.30);
  border-radius: 20px;
  background:
    radial-gradient(560px 260px at 85% 0%, rgba(0,168,255,0.16), transparent 70%),
    linear-gradient(160deg, #101216, #08090b);
  padding: clamp(40px, 6vw, 72px);
  display: grid;
  gap: 20px;
  text-align: center;
  justify-items: center;
}
.cta-band h2 { max-width: 20ch; }
.cta-band p { color: var(--muted); max-width: 56ch; }

/* ---- Tables (journal/research listing rows) ---- */
.row-list { display: grid; border-top: 1px solid var(--line); }
.row-item {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 26px 4px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}
.row-item:hover { background: rgba(216,221,227,0.025); }
.row-item .kicker { color: var(--accent); font-family: var(--font-display); font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase; }
.row-item h3 { font-size: 1.08rem; }
.row-item p { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.row-item .arr { color: var(--muted); font-size: 1.2rem; }

/* ---- Forms ---- */
.form-grid { display: grid; gap: 16px; }
.form-grid .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--silver); display: grid; gap: 8px; }
input, select, textarea {
  width: 100%;
  background: var(--graphite);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.96rem;
  padding: 13px 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,168,255,0.18);
}
textarea { min-height: 140px; resize: vertical; }

/* ---- Case study / article prose ---- */
.prose { max-width: 760px; display: grid; gap: 22px; }
.prose h2 { font-size: 1.6rem; margin-top: 18px; }
.prose p { color: #c4cbd2; }
.prose ul { padding-left: 20px; color: #c4cbd2; display: grid; gap: 8px; }
.prose .figure {
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: rgba(216,221,227,0.4);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background:
    linear-gradient(rgba(216,221,227,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,221,227,0.05) 1px, transparent 1px),
    linear-gradient(160deg, #101216, #08090b);
  background-size: 34px 34px, 34px 34px, 100% 100%;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  border-block: 1px solid var(--line);
  padding: 22px 0;
  margin: 10px 0 18px;
}
.meta-grid div span { display: block; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); font-family: var(--font-display); margin-bottom: 6px; }
.meta-grid div b { color: var(--silver); font-weight: 500; font-size: 0.94rem; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(48px, 7vw, 80px) 0 40px;
  background: linear-gradient(180deg, transparent, rgba(0,168,255,0.03));
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-grid h4 { font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--silver); margin-bottom: 16px; }
.footer-grid ul { list-style: none; display: grid; gap: 10px; }
.footer-grid a { color: var(--muted); font-size: 0.9rem; transition: color 0.2s; }
.footer-grid a:hover { color: var(--accent); }
.footer-note { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line); padding-top: 26px; }

/* ---- Reveal animation ---- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.8,.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---- Breadcrumb / page hero ---- */
.page-hero { padding: clamp(64px, 8vw, 104px) 0 clamp(28px, 4vw, 48px); display: grid; gap: 20px; }
.page-hero .lede { max-width: 68ch; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links {
    position: fixed;
    inset: 68px 0 auto 0;
    background: rgba(5,5,5,0.97);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 22px var(--pad) 30px;
    gap: 18px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .menu-btn { display: grid; place-items: center; }
  .nav-cta .btn { display: none; }
}
@media (max-width: 620px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .row-item { grid-template-columns: 1fr; gap: 8px; }
  .row-item .arr { display: none; }
  .form-grid .two { grid-template-columns: 1fr; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .tile { transition: none; }
}

/* ---- Hero logo ---- */
.hero-logo {
  width: clamp(96px, 12vw, 150px);
  height: auto;
  filter: drop-shadow(0 6px 30px rgba(0,168,255,0.35));
  animation: logo-float 5s ease-in-out infinite;
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 6px 30px rgba(0,168,255,0.35)); }
  50% { transform: translateY(-8px); filter: drop-shadow(0 14px 42px rgba(0,168,255,0.55)); }
}
@media (prefers-reduced-motion: reduce) { .hero-logo { animation: none; } }

/* ---- Hero grid with visual ---- */
.hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: clamp(30px, 5vw, 64px); align-items: center; display: grid; }
.hero .hl { color: var(--accent); text-shadow: 0 0 44px rgba(0,168,255,0.4); }
.hero-visual { position: relative; min-height: 320px; }
.hero-photo {
  width: 100%; height: 100%; max-height: 640px; object-fit: cover;
  border-radius: 20px; border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 60px rgba(0,168,255,0.10);
}
.hero-photo-fallback { display: none; }
.hero-visual.empty .hero-photo-fallback {
  display: grid; place-items: center; position: absolute; inset: 0;
  border: 1px dashed var(--line-strong); border-radius: 20px;
  color: rgba(216,221,227,0.4); font-family: var(--font-display);
  font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase;
  background: linear-gradient(160deg, #101216, #08090b);
}
.hero-coords {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 26px; color: var(--muted);
  font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.hero-coords b { color: var(--accent); font-weight: 600; }
.coord-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(0,168,255,0.9); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.coord-sep { opacity: 0.5; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } .hero-visual { order: -1; min-height: 0; } .hero-photo { max-height: 420px; } }

/* ---- Flagship tile ---- */
.tile-flagship { border-color: rgba(0,168,255,0.45); }
.tile-flagship .tile-visual { background:
  radial-gradient(300px 160px at 70% 30%, rgba(0,168,255,0.18), transparent 70%),
  linear-gradient(rgba(216,221,227,0.05) 1px, transparent 1px),
  linear-gradient(90deg, rgba(216,221,227,0.05) 1px, transparent 1px),
  linear-gradient(160deg, #101216, #08090b);
  background-size: 100% 100%, 34px 34px, 34px 34px, 100% 100%; }

/* ---- Typewriter (Rio page) ---- */
.type-line { font-family: var(--font-display); color: var(--accent); font-size: clamp(1rem, 2vw, 1.25rem); min-height: 1.6em; }
.type-line::after { content: "▌"; animation: pulse 1s steps(1) infinite; }

@media (prefers-reduced-motion: reduce) { .coord-dot { animation: none; } .type-line::after { animation: none; } }

/* ---- Photo tiles ---- */
.tile-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile:hover .tile-visual > img { transform: scale(1.04); transition: transform .5s cubic-bezier(.2,.8,.3,1); }

.prose .figure-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); display: block; }

/* ---- Coming-soon venture tiles ---- */
.tile-soon { border-style: dashed; border-color: var(--line-strong); cursor: default; }
.tile-soon:hover { transform: none; }
.tile-soon .tile-visual { background: linear-gradient(160deg, #0b0c0f, #060708); }
.soon-mark {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(3rem, 6vw, 4.5rem);
  color: transparent; -webkit-text-stroke: 1px rgba(0,168,255,0.4);
  letter-spacing: 0.05em;
}
