/* ------------------------------------------------------------------
   abdelmather.com
   Personal site. Plain HTML + CSS, no build step.

   Type: Lora (display), Work Sans (text), Geist Mono (labels).
   Palette: warm off-white, near-black, grey, one orange accent.
   ------------------------------------------------------------------ */

:root {
  --bg: #fcfcf9;
  --bg-2: #f7f7f4;
  --bg-3: #ededed;
  --ink: #0e0e0a;
  --ink-2: #26251d;
  --grey: #545454;
  --grey-2: #8a8a85;
  --line: #e4e4df;
  --line-2: #d9d9d9;
  --accent: #ff4200;
  --accent-soft: #fcdbcc;
  --maxw: 1088px;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Work Sans", "Suisse Intl", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", "Suisse Intl Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
p { margin: 0; }

/* ---------- Background grid ---------- */

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(60% 45% at 40% 18%, rgba(0,0,0,.9), transparent 100%);
  -webkit-mask-image: radial-gradient(60% 45% at 40% 18%, rgba(0,0,0,.9), transparent 100%);
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wordmark::before {
  content: "";
  width: 22px; height: 12px;
  border-radius: 6px;
  background: var(--accent);
  box-shadow: inset 6px 0 0 0 var(--bg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  color: var(--ink-2);
}

.nav-links a:hover { color: var(--accent); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 500; }

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

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  background: var(--bg-3);
  color: var(--ink);
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.btn:hover { background: #e2e2dd; }
.btn:active { transform: translateY(1px); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }

.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }

.btn-linkedin { background: #0a66c2; color: #fff; }
.btn-linkedin:hover { background: #0958a8; }

.btn-accent { background: var(--accent); color: #fff; }
.btn-back::before { content: "\2190"; }
.btn-accent:hover { background: #e63b00; }

.icon { width: 15px; height: 15px; }

/* ---------- Eyebrow labels:  |  ·  LABEL  ·  |  ---------- */

.eyebrow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before { content: "|"; color: var(--grey-2); }
.eyebrow::after  { content: "|"; color: var(--grey-2); }

/* ---------- Frame + cells ---------- */

.frame {
  max-width: var(--maxw);
  margin: 40px auto 0;
  padding: 0 16px;
}

.frame-inner {
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}

.cell {
  border-top: 1px solid var(--line-2);
  padding: 72px 48px;
}

.cell:first-child { border-top: 0; }

.cell-center { text-align: center; }

.cell-tight { padding: 0; }

/* ---------- Type ---------- */

h1, h2, .serif {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0;
}

h1 {
  font-size: clamp(42px, 6.6vw, 76px);
  line-height: 1.05;
  margin: 22px 0 24px;
}

h2 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.06;
  margin: 18px 0 18px;
}

h3.serif {
  font-size: 23px;
  line-height: 1.25;
  margin: 0 0 6px;
}

.sub {
  font-size: 19px;
  line-height: 1.5;
  color: var(--grey);
  max-width: 34em;
}

.cell-center .sub { margin: 0 auto; }

.sub a { color: var(--ink); border-bottom: 1px solid var(--line-2); }
.sub a:hover { border-color: var(--accent); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.cell-center .actions { justify-content: center; }

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

.hero {
  min-height: calc(100svh - 104px);   /* viewport minus nav (64px) and frame gap (40px) */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 64px;
  padding-bottom: 64px;
}
.hero h1 { margin-top: 0; }
.intro { display: flex; flex-direction: column; gap: 16px; max-width: 36em; margin: 0 auto; }
.intro .sub { max-width: none; font-weight: 400; letter-spacing: -0.012em; color: var(--ink-2); }

.avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 18%;
  margin: 0 auto 26px;
  outline: 1px solid var(--line-2);
  outline-offset: 4px;
}

/* ---------- Role rows ---------- */

.rows { border-top: 1px solid var(--line); margin-top: 30px; }

.row {
  display: grid;
  grid-template-columns: 96px 1fr 1.35fr;
  gap: 28px;
  align-items: start;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.company {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-2);
}

.years { color: var(--grey-2); }
.years::before { content: "·"; margin: 0 8px 0 4px; }

/* ---------- Logos ---------- */

.logo {
  width: 96px;
  height: 60px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  flex: 0 0 auto;
}

.logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

.logo-text span {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.row .company a { color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.row .company a:hover { color: var(--accent); border-color: var(--accent); }

.row p.desc { color: var(--grey); font-size: 16.5px; max-width: 36em; }

/* ---------- Two-up cells (Current) ---------- */

.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.two-up .panel {
  padding: 44px 48px;
  position: relative;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.two-up .panel + .panel { border-left: 1px solid var(--line-2); }

.panel .company { display: block; margin-bottom: 10px; }
.panel h3.serif { font-size: 26px; }
.panel p.desc { color: var(--grey); margin-top: 10px; max-width: 30em; }

.corner {
  position: absolute;
  top: 14px; right: 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--grey-2);
}

.panel:hover .corner { color: var(--accent); }

.section-head { padding: 56px 48px 0; text-align: center; }
.section-head + .two-up { margin-top: 34px; border-top: 1px solid var(--line-2); }

/* ---------- Contact ---------- */

.contact .sub { margin-bottom: 4px; }

/* ---------- Essay with chapter nav (Tabflow page) ---------- */

.essay {
  display: grid;
  grid-template-columns: 260px 1fr;
}

.chapters, .prose { min-width: 0; }

.chapters {
  border-right: 1px solid var(--line-2);
}

.chapters-inner {
  position: sticky;
  top: 64px;                     /* below the site nav */
  padding: 40px 32px;
}

.chapters-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-2);
  margin-bottom: 16px;
}

.chapter-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.chapter-list a {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--grey);
  transition: color .15s;
}

.chapter-list li:last-child a { border-bottom: 1px solid var(--line); }
.chapter-list a:hover { color: var(--ink); }
.chapter-list a.active { color: var(--ink); font-weight: 500; }

.chapter-list .n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--grey-2);
  flex: 0 0 auto;
}

.chapter-list a.active .n { color: var(--accent); }

.chapters-cta { width: 100%; justify-content: center; }

.prose {
  padding: 40px 64px 72px;
  max-width: 44em;
}

.chapter { padding: 32px 0 40px; scroll-margin-top: 80px; }
.chapter + .chapter { border-top: 1px solid var(--line); }

.chapter-n {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.chapter h2 {
  font-size: clamp(28px, 3.2vw, 36px);
  margin: 8px 0 22px;
}

.chapter p {
  font-size: 17.5px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 18px;
}

.chapter p:last-child { margin-bottom: 0; }

.chapter p.emph {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
}

.flow {
  list-style: none;
  margin: 8px 0 26px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.flow li {
  padding: 14px 18px 14px 44px;
  position: relative;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
  border-top: 1px solid var(--line);
}

.flow li:first-child { border-top: 0; }

.flow li::before {
  content: "\2193";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}

.flow li:first-child::before { content: "\2022"; }

.pull {
  margin: 8px 0 26px;
  padding: 22px 26px;
  border-left: 3px solid var(--accent);
  background: var(--bg-2);
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.3;
  color: var(--ink);
}

.chapter .actions { margin-top: 30px; }

/* ---------- Footer ---------- */

.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 16px 48px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--grey-2);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.footer a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .cell { padding: 52px 28px; }
  .hero { padding-top: 60px; padding-bottom: 60px; }
  .two-up { grid-template-columns: 1fr; }
  .two-up .panel { padding: 32px 28px; flex-direction: column; gap: 16px; }
  .two-up .panel + .panel { border-left: 0; border-top: 1px solid var(--line-2); }
  .section-head { padding: 44px 28px 0; }
  .row { grid-template-columns: 1fr; gap: 12px; padding: 24px 0; }
  .hero { min-height: calc(100svh - 96px); }
  .essay { grid-template-columns: 1fr; }
  .chapters { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .chapters-inner { position: sticky; top: 56px; padding: 14px 20px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 5; }
  .chapters-label, .chapters-cta { display: none; }
  .chapter-list { flex-direction: row; gap: 6px; overflow-x: auto; max-width: 100%; margin: 0; padding-bottom: 2px; scrollbar-width: none; }
  .chapter-list::-webkit-scrollbar { display: none; }
  .chapter-list a, .chapter-list li:last-child a { border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; white-space: nowrap; font-size: 13px; background: var(--bg); }
  .chapter-list a.active { border-color: var(--ink); }
  .prose { padding: 8px 28px 48px; }
  .chapter { scroll-margin-top: 120px; }
}

@media (max-width: 520px) {
  .nav-inner { gap: 12px; height: 56px; }
  .nav-links { gap: 14px; font-size: 14px; }
  .nav-cta .btn:not(.btn-dark):not(.btn-back) { display: none; }
  .wordmark { font-size: 21px; gap: 8px; }
  .wordmark::before { width: 18px; height: 10px; box-shadow: inset 5px 0 0 0 var(--bg); }
  .cell { padding: 44px 20px; }
  .two-up .panel { padding: 28px 20px; }
  .section-head { padding: 40px 20px 0; }
  .prose { padding: 8px 20px 40px; }
  .pull { font-size: 22px; padding: 18px 20px; }
  .footer { flex-direction: column; }
  h3.serif, .panel h3.serif { font-size: 22px; }
}
