/* nasser.dev: personal site styles */

:root {
  color-scheme: light dark;
  --bg: #F4F2ED;
  --surface: #FFFFFF;
  --surface-2: #ECE9E2;
  --line: #DCD7CC;
  --ink: #131313;
  --muted: #5E5A53;
  --accent: #E0461B;
  --accent-soft: rgba(224, 70, 27, .1);
  --accent-ink: #FFFFFF;
  --grid: rgba(19, 19, 19, .045);
  --shadow: 0 1px 2px rgba(19, 19, 19, .04), 0 14px 34px -18px rgba(19, 19, 19, .22);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;

  --wrap: 1160px;
  --gutter: 16px;
  --radius: 22px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0E10;
    --surface: #17171A;
    --surface-2: #1F1F24;
    --line: #2B2B31;
    --ink: #F2F0EB;
    --muted: #A29F98;
    --accent: #FF6A3D;
    --accent-soft: rgba(255, 106, 61, .12);
    --accent-ink: #1A0B05;
    --grid: rgba(242, 240, 235, .04);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -20px rgba(0, 0, 0, .7);
  }
}

@media (min-width: 640px) { :root { --gutter: 28px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  font: 17px/1.6 var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; letter-spacing: -.025em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, dl, dd { margin: 0; padding: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 10px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -.01em; }
.accent { color: var(--accent); }

/* ---------- Header ---------- */

.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; letter-spacing: -.02em; font-size: 18px; }
.mark svg { width: 34px; height: 34px; }
.mark .dot { color: var(--accent); }
.links { display: flex; align-items: center; gap: 2px; list-style: none; }
.links a { display: block; padding: 8px 12px; border-radius: 999px; text-decoration: none; font-size: 15px; font-weight: 550; color: var(--muted); }
.links a:hover { color: var(--ink); background: var(--surface-2); }
.links .hide-sm { display: none; }
@media (min-width: 820px) { .links .hide-sm { display: block; } }
.links .cta { color: var(--bg); background: var(--ink); margin-left: 6px; }
.links .cta:hover { color: var(--accent-ink); background: var(--accent); }

/* ---------- Buttons ---------- */

.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 22px; border-radius: 999px; font: 650 16px/1 var(--sans); text-decoration: none; border: 1px solid transparent; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { filter: brightness(1.05); }
.btn-line { border-color: var(--line); background: var(--surface); }
.btn-line:hover { border-color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */

.hero { position: relative; padding: 48px 0 32px; }
@media (min-width: 960px) { .hero { padding: 88px 0 48px; } }
.hero::before { content: ""; position: absolute; inset: -68px 0 0; z-index: -1; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(80% 70% at 30% 20%, #000 30%, transparent 75%); mask-image: radial-gradient(80% 70% at 30% 20%, #000 30%, transparent 75%); }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.35fr 1fr; gap: 64px; } }

.hello { font-family: var(--mono); font-size: 13.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 10px; }
.hello::before { content: ""; width: 26px; height: 1.5px; background: currentColor; }
.hero h1 { font-size: clamp(50px, 9.6vw, 108px); font-weight: 830; letter-spacing: -.05em; line-height: .94; margin: 20px 0 0; }
.hero h1 .serif { display: block; font-weight: 500; letter-spacing: -.035em; color: var(--accent); }
.fullname { font-family: var(--mono); font-size: 13.5px; color: var(--muted); margin-top: 16px; }
.role-line { font-size: clamp(20px, 2.6vw, 27px); font-weight: 680; letter-spacing: -.02em; margin-top: 26px; }
.role-line span { color: var(--muted); font-weight: 500; }
.hero .lede { font-size: clamp(17px, 2vw, 19.5px); color: var(--muted); max-width: 34em; margin: 16px 0 30px; }
.hero .lede b { color: var(--ink); font-weight: 650; }

/* Profile / qualifications card */
.profile { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); overflow: hidden; }
.profile-top { display: flex; align-items: center; gap: 16px; padding: 24px; background: var(--ink); color: var(--bg); position: relative; overflow: hidden; }
.profile-top::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; border: 28px solid color-mix(in srgb, var(--accent) 55%, transparent); opacity: .5; }
@media (prefers-color-scheme: dark) { .profile-top { background: var(--surface-2); color: var(--ink); } }
.avatar { width: 64px; height: 64px; border-radius: 18px; flex: none; position: relative; z-index: 1; color: var(--accent); box-shadow: 0 10px 24px -10px var(--accent); }
.profile-top b { display: block; font-size: 19px; letter-spacing: -.02em; position: relative; z-index: 1; }
.profile-top span { font-size: 14px; opacity: .72; position: relative; z-index: 1; }
.facts { display: grid; }
.facts div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line); align-items: baseline; }
.facts div:first-child { border-top: 0; }
.facts dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { font-size: 15.5px; font-weight: 600; line-height: 1.45; }
.facts dd small { display: block; font-weight: 400; color: var(--muted); font-size: 13.5px; }

/* Stats strip */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 56px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats div { background: var(--surface); padding: 22px; }
.stats b { display: block; font-size: clamp(30px, 4vw, 44px); font-weight: 820; letter-spacing: -.045em; line-height: 1; margin-bottom: 8px; }
.stats b small { font-size: .55em; color: var(--accent); font-weight: 760; }
.stats span { color: var(--muted); font-size: 14.5px; line-height: 1.4; display: block; }

/* ---------- Sections ---------- */

.section { padding: 88px 0; }
@media (min-width: 960px) { .section { padding: 112px 0; } }
.head { display: grid; gap: 16px; margin-bottom: 44px; }
@media (min-width: 960px) { .head { grid-template-columns: 1fr 1fr; align-items: end; gap: 64px; } }
.eyebrow { font-family: var(--mono); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: currentColor; }
.head h2 { font-size: clamp(34px, 5.4vw, 60px); font-weight: 800; letter-spacing: -.04em; }
.head p { color: var(--muted); font-size: 18px; max-width: 32em; }

/* Expertise */
.expertise { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .expertise { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .expertise { grid-template-columns: repeat(3, 1fr); } }
.area { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease; min-width: 0; }
.area:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.area .top-row { display: flex; align-items: center; justify-content: space-between; }
.area .ico { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.area .ico svg { width: 25px; height: 25px; }
.area .num { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.area h3 { font-size: 23px; font-weight: 770; letter-spacing: -.03em; }
.area p { color: var(--muted); font-size: 15.5px; }
.area ul { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 6px; }
.area li { font-family: var(--mono); font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.area.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.area.dark p { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.area.dark li { background: color-mix(in srgb, var(--bg) 10%, transparent); border-color: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); }
.area.dark .num { color: color-mix(in srgb, var(--bg) 60%, transparent); }
@media (prefers-color-scheme: dark) { .area.dark { background: var(--surface-2); color: var(--ink); border-color: var(--line); } .area.dark p, .area.dark .num { color: var(--muted); } .area.dark li { color: var(--ink); background: var(--surface); border-color: var(--line); } }

/* Experience timeline */
.timeline { display: grid; border-top: 1px solid var(--line); }
.job { display: grid; gap: 10px 40px; padding: 32px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 860px) { .job { grid-template-columns: 240px 1fr; } }
.job .when { font-family: var(--mono); font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.job .when b { display: block; color: var(--ink); font-family: var(--sans); font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 4px; }
.roles { display: grid; gap: 26px; }
.role { position: relative; padding-left: 26px; }
.role::before { content: ""; position: absolute; left: 0; top: 8px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg); }
.role:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 24px; bottom: -22px; width: 1.5px; background: var(--line); }
.role.latest::before { background: var(--accent); }
.role h3 { font-size: 20px; font-weight: 740; letter-spacing: -.02em; }
.role .dates { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 4px 0 10px; display: block; }
.role ul { list-style: none; display: grid; gap: 8px; }
.role li { position: relative; padding-left: 18px; color: var(--muted); font-size: 15.5px; }
.role li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 1.5px; background: var(--accent); }
.role li b { color: var(--ink); font-weight: 650; }

/* Impact strip */
.impact { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; grid-template-columns: 1fr; margin-top: 48px; }
@media (min-width: 640px) { .impact { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .impact { grid-template-columns: repeat(4, 1fr); } }
.impact div { background: var(--surface); padding: 24px; }
.impact b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; margin-bottom: 6px; }
.impact b .arrow { color: var(--accent); }
.impact span { color: var(--muted); font-size: 14.5px; }

/* Education + awards */
.duo { display: grid; gap: 16px; }
@media (min-width: 900px) { .duo { grid-template-columns: 1fr 1.1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.panel h2 { font-size: 28px; font-weight: 780; letter-spacing: -.03em; margin-bottom: 22px; }
.edu { list-style: none; display: grid; gap: 22px; }
.edu li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; }
.edu .cap { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.edu .cap svg { width: 24px; height: 24px; }
.edu b { display: block; font-size: 17.5px; letter-spacing: -.01em; line-height: 1.3; }
.edu span { color: var(--muted); font-size: 15px; display: block; margin-top: 4px; }
.edu em { font-style: normal; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 4px; }
.awards { list-style: none; display: grid; }
.awards li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.awards li:first-child { border-top: 0; padding-top: 0; }
.awards b { font-size: 17px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.awards b svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.awards span { font-family: var(--mono); font-size: 13px; color: var(--muted); text-align: right; }

/* Contact */
.contact { background: var(--ink); color: var(--bg); border-radius: 32px; padding: 56px 24px; position: relative; overflow: hidden; }
@media (min-width: 760px) { .contact { padding: 88px 64px; } }
.contact::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(color-mix(in srgb, var(--bg) 7%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--bg) 7%, transparent) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(70% 80% at 100% 0%, #000, transparent 70%); mask-image: radial-gradient(70% 80% at 100% 0%, #000, transparent 70%); }
.contact > * { position: relative; }
.contact h2 { font-size: clamp(36px, 6.4vw, 76px); font-weight: 820; letter-spacing: -.045em; line-height: 1; max-width: 14ch; }
.contact p { color: color-mix(in srgb, var(--bg) 70%, transparent); margin: 22px 0 32px; max-width: 34em; font-size: 18px; }
.contact .btn-line { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 30%, transparent); }
.contact .btn-line:hover { border-color: var(--bg); }
.contact .mail { display: inline-block; margin-top: 28px; font-family: var(--mono); font-size: clamp(15px, 2.4vw, 20px); color: var(--bg); text-decoration: none; border-bottom: 1.5px solid var(--accent); overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) { .contact { background: var(--surface); color: var(--ink); border: 1px solid var(--line); } .contact p { color: var(--muted); } .contact .btn-line, .contact .mail { color: var(--ink); } .contact .btn-line { border-color: var(--line); } .contact::before { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); } }

/* Footer */
.footer { padding: 40px 0 56px; color: var(--muted); font-size: 14.5px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); text-decoration: underline; }

@media print {
  .top, .hero::before, .contact::before, .cta-row { display: none !important; }
  body { background: #fff; color: #000; }
  .area, .profile, .panel { box-shadow: none; }
}
