/* ═══════════════════════════════════════════════════════════════════
   Noor Al-Sadi — personal site
   Palette carried over from the CV: #A6365D and its tints.
   ═══════════════════════════════════════════════════════════════════ */

:root{
  color-scheme: light;

  --accent:      #A6365D;
  --accent-deep: #732641;
  --accent-mid:  #C05F82;
  --accent-line: #E6C7D1;
  --accent-tint: #FAEDF2;
  --accent-wash: #FDF7F9;

  --ink:       #15181c;
  --ink-soft:  #3b4149;
  --ink-faint: #6b727c;
  --ink-mute:  #939aa4;

  --paper:     #ffffff;
  --paper-alt: #FBF9F8;
  --rule:      #e8e4e6;

  --ff-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --ff-ui:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --wrap: 1120px;
  --measure: 40rem;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(21,24,28,.05), 0 4px 14px rgba(21,24,28,.05);
  --shadow-md: 0 2px 6px rgba(21,24,28,.06), 0 18px 44px rgba(115,38,65,.10);

  --step: clamp(1rem, .9rem + .4vw, 1.125rem);
}

*,*::before,*::after{ box-sizing:border-box; }

html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *,*::before,*::after{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--ff-serif);
  font-size:var(--step);
  line-height:1.65;
  font-optical-sizing:auto;
  -webkit-font-smoothing:antialiased;
}

img{ max-width:100%; height:auto; display:block; }
a{ color:var(--accent-deep); text-underline-offset:.18em; text-decoration-thickness:.06em; }
a:hover{ color:var(--accent); }

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

.wrap{ width:100%; max-width:var(--wrap); margin-inline:auto; padding-inline:clamp(1.15rem, 4vw, 2.5rem); }

.skip{
  position:absolute; left:-9999px; top:0; z-index:99;
  background:var(--accent); color:#fff; padding:.7rem 1.1rem;
  font-family:var(--ff-ui); font-size:.9rem; border-radius:0 0 var(--r-sm) 0;
}
.skip:focus{ left:0; color:#fff; }

/* ─── Header ─────────────────────────────────────────────────────── */

.site-head{
  position:sticky; top:0; z-index:40;
  background:rgba(255,255,255,.88);
  backdrop-filter:saturate(1.6) blur(14px);
  -webkit-backdrop-filter:saturate(1.6) blur(14px);
  border-bottom:1px solid var(--rule);
}
.head-inner{ display:flex; align-items:center; justify-content:space-between; gap:1rem; min-height:72px; }

.brand{ text-decoration:none; color:inherit; display:grid; gap:1px; line-height:1.15; }
.brand-name{ font-family:var(--ff-serif); font-size:1.24rem; font-weight:600; letter-spacing:-.015em; }
.brand-role{
  font-family:var(--ff-ui); font-size:.66rem; font-weight:600;
  letter-spacing:.13em; text-transform:uppercase; color:var(--accent);
}

.nav{ display:flex; gap:.35rem; align-items:center; }
.nav a{
  font-family:var(--ff-ui); font-size:.88rem; font-weight:500;
  color:var(--ink-soft); text-decoration:none;
  padding:.5rem .8rem; border-radius:999px;
  transition:background .18s, color .18s;
}
.nav a:hover{ background:var(--accent-tint); color:var(--accent-deep); }
.nav a[aria-current="page"]{ color:var(--accent-deep); background:var(--accent-tint); font-weight:600; }

.nav-toggle{
  display:none; width:42px; height:42px; border:1px solid var(--rule);
  background:var(--paper); border-radius:var(--r-sm); cursor:pointer;
  padding:0; place-items:center; gap:4px;
}
.nav-toggle span{ display:block; width:17px; height:1.8px; background:var(--ink); border-radius:2px; transition:transform .22s, opacity .18s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform:translateY(5.8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity:0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform:translateY(-5.8px) rotate(-45deg); }

@media (max-width: 760px){
  .nav-toggle{ display:grid; }
  .nav{
    position:absolute; inset:72px 0 auto; flex-direction:column; align-items:stretch;
    gap:0; background:var(--paper); border-bottom:1px solid var(--rule);
    padding:.5rem clamp(1.15rem,4vw,2.5rem) 1rem;
    box-shadow:var(--shadow-sm);
    display:none;
  }
  .nav.open{ display:flex; }
  .nav a{ padding:.8rem .7rem; border-radius:var(--r-sm); font-size:.98rem; }
}

/* ─── Hero ───────────────────────────────────────────────────────── */

.hero{ position:relative; overflow:hidden; background:var(--accent-wash); border-bottom:1px solid var(--accent-line); }
.hero::before{
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(60% 70% at 88% 18%, rgba(166,54,93,.10), transparent 62%),
    radial-gradient(48% 60% at 6% 92%, rgba(166,54,93,.07), transparent 60%);
  pointer-events:none;
}
.hero-inner{
  position:relative;
  display:grid; grid-template-columns:1.15fr .85fr; gap:clamp(2rem,5vw,4.5rem);
  align-items:center;
  padding-block:clamp(3rem,7vw,5.5rem);
}

.eyebrow{
  display:inline-flex; align-items:center; gap:.6rem;
  font-family:var(--ff-ui); font-size:.72rem; font-weight:600;
  letter-spacing:.14em; text-transform:uppercase; color:var(--accent);
  margin:0 0 1.1rem;
}
.eyebrow::before{ content:""; width:26px; height:2px; background:var(--accent); border-radius:2px; }

.hero h1{
  font-size:clamp(2.35rem, 1.5rem + 3.6vw, 4rem);
  line-height:1.04; letter-spacing:-.025em; font-weight:500;
  margin:0 0 1.15rem;
}
.hero h1 em{ font-style:italic; color:var(--accent-deep); }

.hero-lede{
  font-size:clamp(1.06rem, 1rem + .35vw, 1.28rem);
  line-height:1.6; color:var(--ink-soft);
  max-width:34rem; margin:0 0 1.9rem;
}

.hero-actions{ display:flex; flex-wrap:wrap; gap:.7rem; }

.btn{
  display:inline-flex; align-items:center; gap:.5rem;
  font-family:var(--ff-ui); font-size:.92rem; font-weight:600;
  padding:.78rem 1.4rem; border-radius:999px;
  text-decoration:none; border:1.5px solid transparent; cursor:pointer;
  transition:background .2s, color .2s, border-color .2s, transform .12s, box-shadow .2s;
}
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:var(--accent); color:#fff; box-shadow:0 2px 10px rgba(166,54,93,.28); }
.btn-primary:hover{ background:var(--accent-deep); color:#fff; box-shadow:0 4px 18px rgba(166,54,93,.34); }
.btn-ghost{ border-color:var(--accent-line); color:var(--accent-deep); background:rgba(255,255,255,.7); }
.btn-ghost:hover{ border-color:var(--accent); background:#fff; color:var(--accent-deep); }

.hero-figure{ position:relative; justify-self:center; width:min(100%, 380px); }
.hero-figure img{
  width:100%; border-radius:var(--r-lg);
  box-shadow:var(--shadow-md);
  position:relative; z-index:1;
}
.hero-figure::after{
  content:""; position:absolute; inset:auto -20px -20px auto;
  width:58%; height:58%; border:1.5px solid var(--accent-line);
  border-radius:var(--r-lg); z-index:0;
}

@media (max-width: 880px){
  .hero-inner{ grid-template-columns:1fr; gap:2.4rem; }
  .hero-figure{ order:-1; }
  .hero-figure{ width:min(78%, 300px); margin-inline:auto; }
  .hero-figure::after{ display:none; }
  .hero-lede{ max-width:none; }
}

/* ─── Sections ───────────────────────────────────────────────────── */

.section{ padding-block:clamp(3rem, 6vw, 5rem); }
.section-alt{ background:var(--paper-alt); border-block:1px solid var(--rule); }

.section-head{ margin-bottom:2.2rem; }
.section-head.row{ display:flex; align-items:flex-end; justify-content:space-between; gap:1.5rem; flex-wrap:wrap; }

.kicker{
  font-family:var(--ff-ui); font-size:.7rem; font-weight:600;
  letter-spacing:.15em; text-transform:uppercase; color:var(--accent);
  margin:0 0 .55rem; display:flex; align-items:center; gap:.55rem;
}
.kicker::before{ content:""; width:16px; height:2px; background:var(--accent); border-radius:2px; }

h2.section-title{
  font-size:clamp(1.7rem, 1.35rem + 1.5vw, 2.4rem);
  line-height:1.15; letter-spacing:-.02em; font-weight:500; margin:0;
}
.section-sub{ color:var(--ink-soft); max-width:var(--measure); margin:.7rem 0 0; }

.more-link{
  font-family:var(--ff-ui); font-size:.9rem; font-weight:600;
  text-decoration:none; color:var(--accent-deep);
  display:inline-flex; align-items:center; gap:.4rem; white-space:nowrap;
}
.more-link span{ transition:transform .2s; }
.more-link:hover span{ transform:translateX(4px); }

/* ─── Focus areas ────────────────────────────────────────────────── */

.focus-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:1.1rem; }
.focus{
  background:var(--paper); border:1px solid var(--rule);
  border-radius:var(--r-md); padding:1.5rem 1.4rem;
  transition:border-color .2s, box-shadow .2s, transform .2s;
}
.focus:hover{ border-color:var(--accent-line); box-shadow:var(--shadow-sm); transform:translateY(-2px); }
.focus-num{
  font-family:var(--ff-ui); font-size:.7rem; font-weight:600; letter-spacing:.1em;
  color:var(--accent); display:block; margin-bottom:.7rem;
}
.focus h3{ font-size:1.16rem; font-weight:600; letter-spacing:-.01em; margin:0 0 .5rem; line-height:1.3; }
.focus p{ margin:0; color:var(--ink-soft); font-size:.97rem; line-height:1.6; }

/* ─── Post cards ─────────────────────────────────────────────────── */

.post-list{ display:grid; gap:1.1rem; }
.post-list.cols{ grid-template-columns:repeat(auto-fit, minmax(290px, 1fr)); }

.card{
  display:flex; flex-direction:column;
  background:var(--paper); border:1px solid var(--rule); border-radius:var(--r-md);
  overflow:hidden; text-decoration:none; color:inherit;
  transition:border-color .2s, box-shadow .2s, transform .2s;
}
.card:hover{ border-color:var(--accent-line); box-shadow:var(--shadow-md); transform:translateY(-3px); color:inherit; }
.card-cover{ aspect-ratio:16/9; background:var(--accent-tint); overflow:hidden; }
.card-cover img{ width:100%; height:100%; object-fit:cover; transition:transform .5s; }
.card:hover .card-cover img{ transform:scale(1.035); }
.card-body{ padding:1.3rem 1.35rem 1.45rem; display:flex; flex-direction:column; flex:1; }
.card h3{ font-size:1.22rem; font-weight:600; line-height:1.28; letter-spacing:-.012em; margin:0 0 .5rem; }
.card p{ margin:0 0 1.1rem; color:var(--ink-soft); font-size:.97rem; line-height:1.58; }
.card .meta{ margin-top:auto; }

.meta{
  font-family:var(--ff-ui); font-size:.76rem; font-weight:500;
  color:var(--ink-mute); display:flex; align-items:center; gap:.5rem; flex-wrap:wrap;
}
.meta .dot{ width:3px; height:3px; border-radius:50%; background:currentColor; opacity:.55; }
.meta .tick{ width:14px; height:2px; background:var(--accent); border-radius:2px; }

/* row layout for the blog index */
.card.row-card{ flex-direction:row; align-items:stretch; }
.card.row-card .card-cover{ flex:0 0 232px; aspect-ratio:auto; }
@media (max-width: 720px){
  .card.row-card{ flex-direction:column; }
  .card.row-card .card-cover{ flex:none; aspect-ratio:16/9; }
}

/* ─── Tag pills — same language as the CV skills ─────────────────── */

.tags{ display:flex; flex-wrap:wrap; gap:.45rem; }
.tag{
  font-family:var(--ff-ui); font-size:.76rem; font-weight:500; line-height:1.2;
  color:var(--accent-deep); background:var(--accent-tint);
  border:1px solid var(--accent-line); border-radius:999px;
  padding:.33rem .75rem; text-decoration:none;
  transition:background .18s, border-color .18s, color .18s;
}
.tag:hover{ background:var(--accent); border-color:var(--accent); color:#fff; }
.tag[aria-current="true"]{ background:var(--accent); border-color:var(--accent); color:#fff; }
.tag .n{ opacity:.6; margin-left:.3rem; font-variant-numeric:tabular-nums; }

/* ─── Article ────────────────────────────────────────────────────── */

.article-head{ padding-block:clamp(2.4rem,5vw,3.6rem) 1.9rem; }
.article-head .wrap{ max-width:var(--measure); }
.article-head h1{
  font-size:clamp(2rem, 1.45rem + 2.4vw, 3.05rem);
  line-height:1.12; letter-spacing:-.025em; font-weight:500; margin:.9rem 0 1rem;
}
.article-lede{ font-size:1.14rem; color:var(--ink-soft); line-height:1.6; margin:0 0 1.3rem; }

.article-cover{ margin-block:.2rem 2.4rem; }
.article-cover img{ width:100%; border-radius:var(--r-md); box-shadow:var(--shadow-sm); }

.prose{ max-width:var(--measure); margin-inline:auto; padding-bottom:1rem; }
.prose > *{ margin-block:0 1.15em; }
.prose h2{ font-size:1.66rem; font-weight:600; letter-spacing:-.018em; line-height:1.25; margin-block:2.1em .55em; }
.prose h3{ font-size:1.28rem; font-weight:600; letter-spacing:-.012em; line-height:1.3;  margin-block:1.7em .5em; }
.prose h4{ font-size:1.08rem; font-weight:600; margin-block:1.5em .45em; }
.prose p{ line-height:1.75; }
.prose ul,.prose ol{ padding-left:1.35em; }
.prose li{ margin-bottom:.45em; line-height:1.7; }
.prose li::marker{ color:var(--accent); }
.prose a{ color:var(--accent-deep); text-decoration:underline; }
.prose strong{ font-weight:600; color:var(--ink); }
.prose hr{ border:0; height:1px; background:var(--rule); margin-block:2.6em; }

.prose blockquote{
  margin-block:1.8em; padding:.3em 0 .3em 1.5em;
  border-left:3px solid var(--accent);
  font-style:italic; color:var(--ink-soft); font-size:1.08em;
}
.prose blockquote p:last-child{ margin-bottom:0; }

.prose code{
  font-family:ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size:.87em; background:var(--accent-tint); color:var(--accent-deep);
  padding:.15em .38em; border-radius:4px; border:1px solid var(--accent-line);
}
.prose pre{
  background:#1b1418; color:#f4eaee; padding:1.15rem 1.3rem;
  border-radius:var(--r-md); overflow-x:auto; font-size:.88rem; line-height:1.6;
}
.prose pre code{ background:none; border:0; color:inherit; padding:0; font-size:1em; }

.prose figure{ margin-block:2em; }
.prose figure img{ width:100%; border-radius:var(--r-md); }
.prose figcaption{
  font-family:var(--ff-ui); font-size:.82rem; color:var(--ink-mute);
  margin-top:.6rem; text-align:center;
}

.article-foot{
  max-width:var(--measure); margin:2.5rem auto 0;
  padding-top:1.8rem; border-top:1px solid var(--rule);
}

.post-nav{ display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin-top:1.8rem; }
.post-nav a{
  display:block; padding:1.1rem 1.2rem; border:1px solid var(--rule);
  border-radius:var(--r-md); text-decoration:none; color:inherit;
  transition:border-color .2s, background .2s;
}
.post-nav a:hover{ border-color:var(--accent-line); background:var(--accent-wash); }
.post-nav .dir{
  font-family:var(--ff-ui); font-size:.7rem; font-weight:600;
  letter-spacing:.11em; text-transform:uppercase; color:var(--accent);
  display:block; margin-bottom:.35rem;
}
.post-nav .t{ font-weight:600; line-height:1.35; font-size:1rem; }
.post-nav .next{ text-align:right; }
@media (max-width: 620px){ .post-nav{ grid-template-columns:1fr; } }

/* ─── About ──────────────────────────────────────────────────────── */

.about-top{ display:grid; grid-template-columns:.82fr 1.18fr; gap:clamp(2rem,5vw,4rem); align-items:start; }
.about-photo img{ width:100%; border-radius:var(--r-lg); box-shadow:var(--shadow-md); }
.about-body{ max-width:var(--measure); }
.about-body p{ margin:0 0 1.1rem; }
.about-body p.lead{ font-size:1.18rem; line-height:1.6; color:var(--ink); }
@media (max-width: 860px){
  .about-top{ grid-template-columns:1fr; }
  .about-photo img{ max-width:320px; }
}

.timeline{ margin-top:.5rem; border-left:2px solid var(--accent-line); padding-left:1.6rem; }
.tl-item{ position:relative; padding-bottom:1.7rem; }
.tl-item:last-child{ padding-bottom:0; }
.tl-item::before{
  content:""; position:absolute; left:calc(-1.6rem - 6px); top:.55rem;
  width:10px; height:10px; border-radius:50%;
  background:var(--accent); border:2.5px solid var(--paper-alt);
}
.tl-when{
  font-family:var(--ff-ui); font-size:.75rem; font-weight:600;
  letter-spacing:.05em; color:var(--ink-mute); display:block; margin-bottom:.2rem;
}
.tl-what{ font-weight:600; font-size:1.06rem; line-height:1.35; margin:0 0 .25rem; }
.tl-where{ color:var(--ink-soft); font-size:.96rem; margin:0; }

/* ─── Contact ────────────────────────────────────────────────────── */

.contact-grid{ display:grid; grid-template-columns:1fr 1fr; gap:clamp(2rem,5vw,3.5rem); align-items:start; }
@media (max-width: 800px){ .contact-grid{ grid-template-columns:1fr; } }

.field{ display:grid; gap:.4rem; margin-bottom:1.05rem; }
.field label{ font-family:var(--ff-ui); font-size:.84rem; font-weight:600; color:var(--ink-soft); }
.field input, .field textarea, .field select{
  font-family:var(--ff-ui); font-size:.96rem; color:var(--ink);
  padding:.72rem .85rem; border:1.5px solid var(--rule); border-radius:var(--r-sm);
  background:var(--paper); width:100%; transition:border-color .18s, box-shadow .18s;
}
.field textarea{ min-height:150px; resize:vertical; line-height:1.55; }
.field input:focus, .field textarea:focus, .field select:focus{
  outline:none; border-color:var(--accent); box-shadow:0 0 0 3.5px var(--accent-tint);
}
.hp{ position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }

.notice{
  font-family:var(--ff-ui); font-size:.92rem; padding:.85rem 1.05rem;
  border-radius:var(--r-sm); margin-bottom:1.3rem; border:1px solid;
}
.notice.ok{ background:#f0f8f2; border-color:#bfe0ca; color:#1f5c33; }
.notice.warn{ background:var(--accent-tint); border-color:var(--accent-line); color:var(--accent-deep); }

.contact-aside .row{ display:flex; gap:.85rem; padding:1.05rem 0; border-bottom:1px solid var(--rule); }
.contact-aside .row:last-child{ border-bottom:0; }
.contact-aside .k{
  font-family:var(--ff-ui); font-size:.72rem; font-weight:600; letter-spacing:.1em;
  text-transform:uppercase; color:var(--accent); flex:0 0 86px; padding-top:.2rem;
}
.contact-aside .v{ margin:0; }

/* ─── Empty state / 404 ──────────────────────────────────────────── */

.empty{
  text-align:center; padding:clamp(2.5rem,6vw,4.5rem) 1.5rem;
  border:1.5px dashed var(--accent-line); border-radius:var(--r-md);
  background:var(--accent-wash);
}
.empty h3{ font-size:1.35rem; font-weight:600; margin:0 0 .5rem; }
.empty p{ color:var(--ink-soft); margin:0 auto; max-width:34rem; }

.center-page{ text-align:center; padding-block:clamp(4rem,10vw,7rem); }
.center-page h1{ font-size:clamp(2.2rem,1.6rem+2.5vw,3.2rem); font-weight:500; letter-spacing:-.025em; margin:0 0 .8rem; }

/* ─── Footer ─────────────────────────────────────────────────────── */

.site-foot{ border-top:1px solid var(--rule); background:var(--paper-alt); padding-block:2.8rem 2.2rem; margin-top:0; }
.foot-inner{ display:grid; grid-template-columns:1.2fr 1fr 1fr; gap:1.8rem; align-items:start; }
.foot-name{ font-size:1.12rem; font-weight:600; margin:0 0 .15rem; letter-spacing:-.01em; }
.foot-name .comma{ color:var(--ink-mute); }
.foot-name .foot-role{ color:var(--accent); font-weight:500; }
.foot-note{ margin:0; color:var(--ink-mute); font-size:.92rem; }
.foot-nav, .foot-links{ display:grid; gap:.45rem; }
.foot-nav a, .foot-links a{
  font-family:var(--ff-ui); font-size:.88rem; color:var(--ink-soft);
  text-decoration:none; width:fit-content;
}
.foot-nav a:hover, .foot-links a:hover{ color:var(--accent-deep); text-decoration:underline; }
.copy{
  grid-column:1/-1; margin:1.6rem 0 0; padding-top:1.4rem; border-top:1px solid var(--rule);
  font-family:var(--ff-ui); font-size:.8rem; color:var(--ink-mute);
}
@media (max-width: 720px){
  .foot-inner{ grid-template-columns:1fr; gap:1.4rem; }
}
