/* alaradi.net — Kareem Alaradi personal profile. Dark ink + amber "modem LED" signal. */
:root {
  --ink: #0b0d10;
  --ink-2: #12161b;
  --ink-3: #1a2027;
  --line: #262d36;
  --text: #ece8e1;
  --muted: #a39d93;
  --faint: #6f6a62;
  --amber: #f2a541;
  --amber-2: #ffcf7a;
  --amber-glow: rgba(242, 165, 65, .16);
  --radius: 20px;
  --font: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --wrap: 1180px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
html[lang="en"] { --font: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 1.85;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
html[lang="en"] body { line-height: 1.7; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--amber); color: var(--ink); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--amber); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { inset-inline-start: 12px; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 16, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.hdr.scrolled { border-bottom-color: var(--line); }
.hdr .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--amber-2), var(--amber)); color: var(--ink);
  font-weight: 700; font-size: 19px; line-height: 1;
}
.nav { display: flex; gap: 30px; font-size: 15px; color: var(--muted); }
.nav a { transition: color .2s; }
.nav a:hover { color: var(--text); }
.hdr-end { display: flex; align-items: center; gap: 10px; }
.lang {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; transition: .2s;
}
.lang:hover { color: var(--text); border-color: var(--faint); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 16px;
  transition: transform .2s, background .2s, border-color .2s, color .2s; cursor: pointer; border: 0;
}
.btn svg { width: 19px; height: 19px; flex: none; }
.btn-amber { background: var(--amber); color: var(--ink); }
.btn-amber:hover { background: var(--amber-2); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber-2); }
.hdr .btn { padding: 9px 18px; font-size: 14px; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 96px 0 40px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(236, 232, 225, .07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.35fr 1fr; gap: 64px; align-items: center; }
.kicker { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 14px; color: var(--amber); margin-bottom: 22px; }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 0 var(--amber-glow); animation: led 2.4s infinite; }
@keyframes led { 0%, 100% { box-shadow: 0 0 0 0 rgba(242,165,65,.5); } 50% { box-shadow: 0 0 0 8px rgba(242,165,65,0); } }
h1 { font-size: clamp(46px, 7vw, 92px); line-height: 1.12; margin: 0 0 26px; font-weight: 700; letter-spacing: -.01em; }
html[lang="en"] h1 { letter-spacing: -.03em; line-height: 1.02; }
h1 .soft { color: var(--muted); font-weight: 300; display: block; font-size: .42em; letter-spacing: 0; margin-top: 14px; }
.lead { font-size: clamp(19px, 2vw, 23px); color: var(--muted); max-width: 34em; margin: 0 0 38px; }
.lead strong { color: var(--text); font-weight: 600; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; }

.portrait { position: relative; justify-self: center; width: min(400px, 100%); }
.portrait-frame {
  aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden; position: relative;
  background: radial-gradient(circle at 30% 20%, #2a2219, var(--ink-2) 60%);
  border: 1px solid var(--line); display: grid; place-items: center;
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.monogram { font-size: 190px; font-weight: 700; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px rgba(242,165,65,.55); user-select: none; }
.portrait-tag {
  position: absolute; inset-inline-start: -22px; bottom: 34px;
  background: var(--ink-3); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 18px; font-size: 14px; box-shadow: 0 20px 40px rgba(0,0,0,.45);
}
.portrait-tag .mono { color: var(--amber); font-size: 12px; display: block; margin-bottom: 2px; }

/* the signal line — 2000/56K → today/AI */
.signal { position: relative; margin-top: 76px; padding: 26px 0 8px; border-top: 1px solid var(--line); }
.signal-track { position: relative; height: 2px; background: var(--line); border-radius: 2px; margin: 0 6px; }
.signal-track i {
  position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--amber), var(--amber-2));
  transition: width 2.6s cubic-bezier(.2,.7,.2,1);
}
html[dir="rtl"] .signal-track i { background: linear-gradient(270deg, var(--amber), var(--amber-2)); }
.signal.on .signal-track i { width: 100%; }
.signal-pts { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 16px; gap: 8px; }
.signal-pts div { font-size: 14px; color: var(--muted); }
.signal-pts div:last-child { text-align: end; }
.signal-pts b { display: block; font-family: var(--mono); color: var(--text); font-size: 15px; font-weight: 500; }

/* ---------- sections ---------- */
section { padding: 110px 0; }
.sec-head { max-width: 720px; margin-bottom: 56px; }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--amber); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; display: block; }
h2 { font-size: clamp(32px, 4vw, 50px); line-height: 1.25; margin: 0 0 18px; font-weight: 700; }
html[lang="en"] h2 { letter-spacing: -.02em; line-height: 1.15; }
.sec-head p { color: var(--muted); font-size: 19px; margin: 0; }
h3 { font-size: 23px; margin: 0 0 10px; line-height: 1.4; }

/* stats */
.stats { padding: 0 0 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 34px 30px; border-inline-end: 1px solid var(--line); }
.stat:last-child { border-inline-end: 0; }
.stat-v { font-family: var(--mono); font-size: 44px; font-weight: 500; color: var(--amber-2); line-height: 1.1; }
.stat-l { color: var(--muted); font-size: 15px; margin-top: 10px; line-height: 1.6; }

/* story */
.story-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 72px; align-items: start; }
.quote {
  position: sticky; top: 110px; margin: 0; padding: 40px; border-radius: var(--radius);
  background: linear-gradient(160deg, #1d1810, var(--ink-2) 55%); border: 1px solid #3a2f1f;
}
.quote p { font-size: 24px; line-height: 1.75; margin: 0 0 22px; font-weight: 500; }
html[lang="en"] .quote p { line-height: 1.5; }
.quote p::before { content: "“"; color: var(--amber); font-size: 1.6em; line-height: 0; vertical-align: -.35em; margin-inline-end: 6px; }
html[dir="rtl"] .quote p::before { content: "”"; }
.quote cite { font-style: normal; color: var(--muted); font-size: 15px; }
.story-body p { margin: 0 0 22px; color: #d4cfc6; font-size: 18px; }
.story-body p:first-child::first-line { color: var(--text); }
.story-body strong { color: var(--text); }

/* building now */
.build-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.build {
  position: relative; padding: 40px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--ink-2); overflow: hidden; transition: border-color .3s, transform .3s;
  display: flex; flex-direction: column;
}
.build:hover { border-color: #4a3c26; transform: translateY(-4px); }
.build-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.build-logo { height: 34px; width: auto; }
.build-word { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.build-word em { font-style: normal; color: var(--amber); }
.chip { font-family: var(--mono); font-size: 12px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.live { color: #8fe0a8; border-color: #24452f; background: #0f1d14; }
.chip.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #5fd48a; margin-inline-end: 7px; vertical-align: 1px; }
.build p { color: var(--muted); margin: 0 0 22px; }
.ticks { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 10px; }
.ticks li { position: relative; padding-inline-start: 26px; font-size: 16px; }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .78em; width: 12px; height: 2px; background: var(--amber); }
.build .more { margin-top: auto; color: var(--amber-2); font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }
.build .more:hover { gap: 12px; }
.arrow { transition: transform .2s; }
html[dir="rtl"] .arrow { transform: scaleX(-1); }

/* work */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.work { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--ink-2); transition: border-color .3s; display: flex; flex-direction: column; }
.work:hover { border-color: #4a3c26; }
.work-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--ink-3); border-bottom: 1px solid var(--line); }
.work-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.work:hover .work-img img { transform: scale(1.04); }
.work-body { padding: 28px 30px 30px; display: flex; flex-direction: column; flex: 1; }
.work-type { font-family: var(--mono); font-size: 12px; color: var(--amber); margin-bottom: 10px; }
.work-body p { color: var(--muted); margin: 0 0 18px; font-size: 16px; }
.work-metrics { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 18px; }
.work-metrics span { font-size: 14px; color: var(--muted); }
.work-metrics b { font-family: var(--mono); color: var(--text); font-weight: 500; margin-inline-end: 6px; }
.work-link { margin-top: auto; font-family: var(--mono); font-size: 14px; color: var(--text); display: inline-flex; gap: 8px; align-items: center; }
.work-link:hover { color: var(--amber-2); }

/* skills */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skill { background: var(--ink); padding: 36px 32px; }
.skill-n { font-family: var(--mono); color: var(--faint); font-size: 13px; display: block; margin-bottom: 16px; }
.skill h3 { font-size: 20px; }
.skill p { color: var(--muted); margin: 0; font-size: 15.5px; line-height: 1.8; }

/* timeline */
.tl { position: relative; max-width: 860px; }
.tl::before { content: ""; position: absolute; inset-inline-start: 7px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--amber), var(--line) 85%); }
.tl-item { position: relative; padding-inline-start: 52px; padding-bottom: 46px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; inset-inline-start: 0; top: 9px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 2px solid var(--amber); }
.tl-item.now::before { background: var(--amber); box-shadow: 0 0 0 6px var(--amber-glow); }
.tl-year { font-family: var(--mono); color: var(--amber); font-size: 14px; margin-bottom: 6px; display: block; }
.tl-item h3 { font-size: 21px; margin-bottom: 6px; }
.tl-item p { color: var(--muted); margin: 0; font-size: 16px; }

/* writing */
.writing {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center;
  padding: 56px; border-radius: 28px; border: 1px solid var(--line);
  background: radial-gradient(circle at 0% 0%, #1b1710, var(--ink-2) 60%);
}
.writing h2 { margin-bottom: 14px; }
.writing > div > p { color: var(--muted); margin: 0 0 28px; }
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.posts a { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; padding: 18px 4px; border-bottom: 1px solid var(--line); transition: color .2s, padding .2s; }
.posts li:last-child a { border-bottom: 0; }
.posts a:hover { color: var(--amber-2); padding-inline-start: 12px; }
.posts .mono { color: var(--faint); font-size: 13px; white-space: nowrap; }

/* contact */
.contact { text-align: center; padding: 130px 0; position: relative; }
.contact::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 100%, rgba(242,165,65,.13), transparent 60%); pointer-events: none; }
.contact h2 { font-size: clamp(38px, 5.5vw, 68px); max-width: 15em; margin: 0 auto 20px; }
.contact > .wrap > p { color: var(--muted); font-size: 19px; max-width: 36em; margin: 0 auto 40px; }
.contact .cta { justify-content: center; }
.contact-alt { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 34px; margin-top: 40px; font-family: var(--mono); font-size: 15px; color: var(--muted); }
.contact-alt a:hover { color: var(--amber-2); }

/* footer */
.ftr { border-top: 1px solid var(--line); padding: 56px 0 40px; color: var(--muted); font-size: 15px; }
.ftr-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.ftr h4 { color: var(--text); font-size: 15px; margin: 0 0 16px; font-weight: 600; }
.ftr ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ftr a:hover { color: var(--amber-2); }
.ftr-about p { margin: 14px 0 0; max-width: 24em; line-height: 1.8; }
.ftr-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; }
.ftr-bar nav { display: flex; gap: 22px; flex-wrap: wrap; }
.credit a { color: var(--text); }

/* mobile tab bar (app feel) */
.tabbar { display: none; }

/* legal pages */
.legal { padding: 70px 0 110px; }
.legal .wrap { max-width: 800px; }
.legal h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: 10px; }
.legal .updated { font-family: var(--mono); color: var(--faint); font-size: 14px; margin-bottom: 44px; display: block; }
.legal h2 { font-size: 23px; margin: 42px 0 12px; }
.legal p, .legal li { color: #d4cfc6; }
.legal a { color: var(--amber-2); text-decoration: underline; text-underline-offset: 3px; }

/* 404 */
.nf { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.nf .mono { font-size: 90px; color: var(--amber); line-height: 1; }

/* reveal (only when JS is on) */
.js .rv { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .nav { display: none; }
  .hero-grid, .story-grid, .writing { grid-template-columns: 1fr; gap: 48px; }
  .portrait { width: min(340px, 82%); }
  .quote { position: static; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .ftr-grid { grid-template-columns: 1fr 1fr; }
  .ftr-about { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  body { font-size: 16px; padding-bottom: calc(76px + var(--safe-b)); }
  section { padding: 76px 0; }
  .wrap { width: calc(100% - 32px); }
  .hdr .wrap { height: 62px; }
  .hdr .btn { display: none; }
  .hero { padding: 48px 0 20px; }
  .hero-grid { gap: 40px; }
  .portrait { order: -1; width: min(240px, 66%); justify-self: start; }
  .monogram { font-size: 120px; }
  .portrait-tag { inset-inline-start: auto; inset-inline-end: -28px; bottom: 18px; padding: 10px 14px; font-size: 13px; }
  .cta .btn { flex: 1 1 100%; }
  .signal { margin-top: 48px; }
  .signal-pts { grid-template-columns: repeat(3, 1fr); row-gap: 16px; }
  .signal-pts div:nth-child(2), .signal-pts div:nth-child(4) { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 24px 20px; border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-inline-end: 0; }
  .stat:nth-child(n+3) { border-bottom: 0; }
  .stat-v { font-size: 34px; }
  .quote { padding: 28px; }
  .quote p { font-size: 20px; }
  .build-grid, .work-grid, .skills-grid { grid-template-columns: 1fr; }
  .build { padding: 28px; }
  .work-body { padding: 22px 22px 24px; }
  .skill { padding: 28px 24px; }
  .writing { padding: 30px 22px; border-radius: 22px; }
  .posts a { flex-direction: column; gap: 2px; }
  .contact { padding: 90px 0; }
  .ftr-grid { grid-template-columns: 1fr; gap: 30px; }
  .ftr-bar { flex-direction: column; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
    padding: 8px 8px calc(8px + var(--safe-b));
    background: rgba(18, 22, 27, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); padding: 6px 0; border-radius: 12px; }
  .tabbar a.on { color: var(--amber-2); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .wa { color: var(--ink); background: var(--amber); margin: 0 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv { opacity: 1; transform: none; }
  .signal-track i { width: 100%; }
}

/* Arabic: never letter-space joined script; mono face has no Arabic glyphs */
html[dir="rtl"] .eyebrow, html[dir="rtl"] .kicker, html[dir="rtl"] .work-type,
html[dir="rtl"] .portrait-tag .mono, html[dir="rtl"] .skill-n { font-family: var(--font); letter-spacing: 0; font-weight: 500; }
html[dir="rtl"] .eyebrow { font-size: 14px; }
h1 .soft, h2 { text-wrap: balance; }
