/* ------------------------------------------------------------------
   Ferkat Jawdat - proof of work
   Aesthetic: dark-tech editorial. Native CSS, no framework, no build.
   Theme is locked dark by brand decision (Section 4.11 page theme lock).
   Radius system: single value (--r) on every container and control.
   Accent: one color (--acc), used identically in every section.
   ------------------------------------------------------------------ */

:root {
  --bg:         #0A0B0D;
  --bg-2:       #101216;
  --bg-3:       #14171C;
  --line:       #23272E;
  --line-soft:  #191C21;
  --text:       #EDEFF2;
  --text-dim:   #98A0AB;
  --text-faint: #69717C;
  --acc:        #BEEE4A;
  --acc-deep:   #90B739;
  --acc-wash:   rgba(190, 238, 74, 0.09);
  --acc-line:   rgba(190, 238, 74, 0.28);

  --r: 10px;

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1180px;
  --pad: 28px;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- shared type ---------- */

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.06;
  text-wrap: balance;
}

h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.05rem; letter-spacing: -0.012em; line-height: 1.3; }

p { margin: 0 0 1em; max-width: 66ch; }

.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--acc);
  margin: 0 0 20px;
}

.lede {
  font-size: clamp(1.02rem, 1.5vw, 1.16rem);
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 58ch;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 68px;
  display: flex;
  align-items: center;
  background: rgba(10, 11, 13, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-name {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}
.nav-name b { font-weight: 500; }
.nav-name span { color: var(--text-faint); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  white-space: nowrap;
}
.nav-links a {
  font-size: 13.5px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.18s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:focus-visible,
.btn:focus-visible,
.card-link:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 0.14s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:active { transform: translateY(1px); }

.btn-acc {
  background: var(--acc);
  color: #0A0B0D;             /* dark ink on lime, contrast well past AA */
  font-weight: 600;
}
.btn-acc:hover { background: #CDF864; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--text-faint); background: var(--bg-2); }

.btn-sm { height: 38px; padding: 0 15px; font-size: 13.5px; }

/* ---------- hero ---------- */

.hero {
  padding: clamp(56px, 8vw, 92px) 0 clamp(48px, 6vw, 72px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -280px;
  right: -180px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(190, 238, 74, 0.07) 0%, transparent 66%);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.05rem);
  line-height: 1.02;
  max-width: 15ch;
  margin-bottom: 22px;
}
.hero .lede { margin-bottom: 30px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.portrait {
  position: relative;
  justify-self: end;
  width: min(100%, 260px);
}
.portrait img {
  width: 100%;
  border-radius: var(--r);
  border: 1px solid var(--line);
  filter: grayscale(1) contrast(1.05);
}
.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  background: linear-gradient(180deg, transparent 52%, rgba(10, 11, 13, 0.5) 100%);
  pointer-events: none;
}

/* ---------- stat band ---------- */

.stats {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-2);
}
.stats .wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: 30px clamp(18px, 2.6vw, 30px);
  border-left: 1px solid var(--line-soft);
}
.stat:first-child { border-left: none; padding-left: 0; }
.stat:last-child { padding-right: 0; }
.stat .n {
  font-family: var(--mono);
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--acc);
  line-height: 1.1;
  margin-bottom: 8px;
}
.stat .l {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
}

/* ---------- generic section ---------- */

section { padding: clamp(72px, 9vw, 118px) 0; }
section.tight { padding-top: clamp(56px, 7vw, 86px); }

.sec-head { margin-bottom: 44px; max-width: 62ch; }
.sec-head p { margin-top: 16px; color: var(--text-dim); }

/* ---------- thesis (editorial manifesto) ---------- */

.thesis {
  border-top: 1px solid var(--line-soft);
  background:
    radial-gradient(ellipse 80% 100% at 12% 0%, rgba(190, 238, 74, 0.045), transparent 60%),
    var(--bg);
}
.thesis h2 {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  max-width: 19ch;
  margin-bottom: 30px;
}
.thesis-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 52px);
}
.thesis-body p { font-size: 1.02rem; color: var(--text-dim); }
.thesis-body p:last-child { margin-bottom: 0; }
.thesis-body strong { color: var(--text); font-weight: 500; }

/* ---------- risk bento ---------- */

.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.cell {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px 26px 28px;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.cell:hover { border-color: var(--acc-line); transform: translateY(-2px); }

.cell.feature {
  grid-column: span 2;
  background:
    radial-gradient(ellipse 90% 70% at 100% 0%, rgba(190, 238, 74, 0.13), transparent 62%),
    linear-gradient(165deg, var(--bg-3), var(--bg-2));
}
.cell.feature p { max-width: 54ch; }
.cell.tinted {
  background: linear-gradient(165deg, rgba(190, 238, 74, 0.055), var(--bg-2) 70%);
}

.cell .axis {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--acc);
}
.cell h3 { margin: 0; }
.cell.feature h3 { font-size: 1.5rem; letter-spacing: -0.022em; }
.cell p {
  margin: 0;
  font-size: 13.8px;
  color: var(--text-dim);
  line-height: 1.55;
}
.cell .tools {
  margin-top: auto;
  padding-top: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
  border-top: 1px solid var(--line-soft);
}
.cell .tools b { color: var(--text-dim); font-weight: 400; }

/* ---------- diagram ---------- */

.diagram-panel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  padding: 8px;
  overflow-x: auto;
}
.diagram-panel svg { display: block; min-width: 880px; width: 100%; height: auto; }

.chain-note {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 40px);
  margin-top: 34px;
}
.chain-note h3 { margin-bottom: 8px; font-size: 0.97rem; }
.chain-note p { font-size: 13.8px; color: var(--text-dim); margin: 0; }

/* ---------- capabilities ---------- */

.caps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
}
.cap {
  background: var(--bg);
  padding: 30px clamp(22px, 3vw, 34px);
}
.cap h3 { margin-bottom: 14px; }
.cap .items {
  font-family: var(--mono);
  font-size: 12.6px;
  line-height: 2;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

/* ---------- experience ---------- */

.role {
  display: grid;
  grid-template-columns: 16.5rem 1fr;
  gap: clamp(20px, 4vw, 52px);
  padding: 38px 0;
  border-top: 1px solid var(--line);
}
.sec-head + .role { border-top: none; padding-top: 0; }

.role .when {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--acc);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.role .where { font-size: 13.5px; color: var(--text-faint); line-height: 1.5; }
.role h3 { margin-bottom: 6px; font-size: 1.12rem; }

.role ul { margin: 14px 0 0; padding: 0; list-style: none; }
.role ul li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.58;
}
.role ul li:last-child { margin-bottom: 0; }
.role ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 1px;
  background: var(--acc-deep);
}

/* ---------- projects (asymmetric trio) ---------- */

.projects {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
}
.proj {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.proj:hover { border-color: var(--acc-line); transform: translateY(-2px); }
.proj-lead {
  grid-row: span 2;
  justify-content: flex-end;
  background:
    radial-gradient(ellipse 80% 60% at 90% 8%, rgba(190, 238, 74, 0.12), transparent 60%),
    linear-gradient(170deg, var(--bg-3), var(--bg-2));
}
.proj .kind {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.proj h3 { margin: 0; }
.proj-lead h3 { font-size: 1.45rem; letter-spacing: -0.022em; }
.proj p { margin: 0; font-size: 13.8px; color: var(--text-dim); line-height: 1.55; }
.proj .stack {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ---------- contact ---------- */

.contact {
  border-top: 1px solid var(--line-soft);
  background:
    radial-gradient(ellipse 70% 100% at 50% 100%, rgba(190, 238, 74, 0.06), transparent 62%),
    var(--bg);
  text-align: center;
}
.contact h2 { max-width: 22ch; margin: 0 auto 18px; }
.contact .lede { margin: 0 auto 32px; }
.contact-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

footer {
  border-top: 1px solid var(--line-soft);
  padding: 26px 0 34px;
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}
footer a { color: var(--text-dim); text-decoration: none; transition: color 0.18s ease; }
footer a:hover { color: var(--acc); }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- motion ---------- */

.rise {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.rise.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; transition-duration: 0.01ms !important; }
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .stats .wrap { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; padding-left: 0; }
  .stat:nth-child(2) { padding-right: 0; }
  .stat:nth-child(3), .stat:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell.feature { grid-column: span 2; }
  .chain-note { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .portrait { justify-self: start; width: 128px; order: -1; }
  .hero h1 { max-width: 100%; }
  .thesis-body { grid-template-columns: 1fr; gap: 0; }
  .caps { grid-template-columns: 1fr; }
  .role { grid-template-columns: 1fr; gap: 14px; }
  .projects { grid-template-columns: 1fr; }
  .proj-lead { grid-row: auto; }
  .nav-links a.hide-sm { display: none; }
}

@media (max-width: 560px) {
  :root { --pad: 18px; }
  body { font-size: 15.5px; }
  .stats .wrap { grid-template-columns: 1fr; }
  .stat { border-left: none; border-top: 1px solid var(--line-soft); padding-left: 0; padding-right: 0; }
  .stat:first-child { border-top: none; }
  .bento { grid-template-columns: 1fr; }
  .cell.feature { grid-column: auto; }
  .hero-cta .btn, .contact-cta .btn { flex: 1 1 auto; }
}
