/* Skill Shelf — one stylesheet, no framework.
   Dark, lean, terminal-flavored. RTL handled with logical properties
   (margin-inline / text-align:start) so an Arabic post flips on its own. */

:root {
  /* Near-black with a slight cool bias, so the terminal green reads as light
     rather than as paint. Cards sit just above the page and are separated by
     the border, not by brightness — the steps are small on purpose. */
  --bg:        #06080b;
  --bg-soft:   #0e1319;
  --bg-card:   #0b0f14;
  --border:    #1c232b;
  --text:      #dde3ea;
  --text-dim:  #8d9aa7;
  --text-faint:#5d6773;
  --accent:    #7ee787;   /* terminal green */
  --accent-2:  #6cb6ff;   /* link blue */
  --tag-bg:    #1b2530;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
  --measure: 42rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- header ---- */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: var(--measure);
  width: 100%;
  margin: 0 auto;
  padding: 1.6rem 1.25rem 0.8rem;
}
.brand {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: #fff; }
.prompt { color: var(--accent); }
.site-head nav { display: flex; gap: 1.1rem; }
.site-head nav a { color: var(--text-dim); font-family: var(--mono); font-size: 0.85rem; }
.site-head nav a:hover { color: var(--text); text-decoration: none; }

/* ---- main column ---- */
main {
  flex: 1;
  max-width: var(--measure);
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem;
}

/* ---- home hero ---- */
.hero { padding: 1.6rem 0 1.2rem; border-bottom: 1px solid var(--border); margin-bottom: 1.4rem; }
.hero h1 { font-size: 2rem; margin: 0 0 0.3rem; letter-spacing: -0.02em; }
.tagline { color: var(--text-dim); margin: 0; font-family: var(--mono); font-size: 0.95rem; }

/* ---- home intro ----
   The front page opens as an introduction, not as a list. Someone who lands
   cold gets who / what / what's being learned before the first card. */
.intro { padding: 1.4rem 0 0.6rem; }
.intro h1 { font-size: 2.3rem; margin: 0; letter-spacing: -0.03em; line-height: 1.12; }
.intro .role { margin: 0.35rem 0 0; font-family: var(--mono); font-size: 0.92rem; color: var(--accent); }
.lede { margin: 1rem 0 0; color: var(--text-dim); font-size: 1.02rem; max-width: 54ch; }
.lede strong { color: var(--text); font-weight: 550; }
.intro-note {
  margin: 0.9rem 0 0; color: var(--text-faint);
  font-family: var(--mono); font-size: 0.82rem; max-width: 58ch;
}

/* ---- the way down to the writeups ----
   One deliberate door at the bottom of the front page. The writeups are the
   evidence behind everything above them, so the link says that rather than
   just naming the section. */
.deeper {
  display: flex; align-items: baseline; gap: 0.9rem;
  margin-top: 2.6rem; padding: 1rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  transition: border-color 0.2s ease;
}
.deeper:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); }
.deeper-label {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); white-space: nowrap;
}
.deeper-text { color: var(--text-dim); font-size: 0.94rem; flex: 1; }
.deeper-arrow { color: var(--text-faint); font-family: var(--mono); transition: transform 0.2s ease, color 0.2s ease; }
.deeper:hover .deeper-arrow { transform: translateX(3px); color: var(--accent); }

/* status chip — used by the intro and by project cards. Only ever shows text
   the author put in front matter or site.yaml, so it can't overstate. */
.status-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  border-radius: 999px; padding: 0.2rem 0.65rem;
  white-space: nowrap;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.intro .status-pill { margin-bottom: 1.1rem; }

/* ---- section rule ----
   A mono label with a hairline running to the edge. This is what lets one page
   hold projects and writeups without reading as two pages stapled together. */
h2.rule {
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-faint);
  margin: 2.4rem 0 1rem;
}
h2.rule::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---- project cards ----
   Deliberately no left accent rail: that stays the chapter row's signature, so
   a project and a series never read as the same kind of thing. */
.cards { display: flex; flex-direction: column; gap: 0.7rem; }
.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  color: var(--text);
  transition: border-color 0.2s ease;
}
.card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); }
.card-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.8rem; flex-wrap: wrap;
}
.card-title { font-weight: 650; font-size: 1.08rem; transition: color 0.12s; }
.card:hover .card-title { color: var(--accent); }
.card-summary { display: block; color: var(--text-dim); margin-top: 0.35rem; font-size: 0.94rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.65rem; }
.chip {
  font-family: var(--mono); font-size: 0.7rem; color: var(--accent);
  background: var(--tag-bg); border: 1px solid var(--border);
  padding: 0.08rem 0.5rem; border-radius: 999px;
}

/* ---- writeup list ---- */
.posts { list-style: none; margin: 0; padding: 0; }
.post-row { padding: 1.05rem 0; border-bottom: 1px solid var(--border); }
.post-row:last-child { border-bottom: 0; }
.post-link {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; color: var(--text);
}
.post-link:hover { text-decoration: none; }
.post-link:hover .post-title { color: var(--accent); }
.post-title { font-weight: 600; font-size: 1.1rem; transition: color .12s; }
.post-date { color: var(--text-faint); font-family: var(--mono); font-size: 0.8rem; white-space: nowrap; }
.post-summary { color: var(--text-dim); margin: 0.35rem 0 0; font-size: 0.95rem; }
.empty { color: var(--text-dim); }
.empty code { font-size: 0.85em; }

/* ---- chapters ---- */
/* A chapter row stands slightly off the timeline so it reads as a container,
   not as one more post. Left rule + card tint, nothing louder than that. */
.chapter-row {
  background: var(--bg-card);
  border-inline-start: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding-inline: 0.9rem;
}
.chapter-row .post-date { color: var(--accent); }
.chapter-latest {
  margin: 0.5rem 0 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
}
.chapter-count {
  margin: 0.4rem 0 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* previous/next inside a chapter */
.seq-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 2.5rem; padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}
.seq-nav a { display: flex; flex-direction: column; gap: 0.15rem; max-width: 48%; color: var(--text); }
.seq-nav a:hover { text-decoration: none; }
.seq-nav a:hover .seq-title { color: var(--accent); }
.seq-next { text-align: end; margin-inline-start: auto; }
.seq-label { font-family: var(--mono); font-size: 0.78rem; color: var(--text-faint); }
.seq-title { font-size: 0.95rem; font-weight: 600; transition: color .12s; }

/* ---- tags ---- */
.tags { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.tag {
  font-family: var(--mono); font-size: 0.72rem; color: var(--accent);
  background: var(--tag-bg); border: 1px solid var(--border);
  padding: 0.08rem 0.5rem; border-radius: 999px;
}

/* ---- shelf page ----
   A capability list is scanned, not read, so it's laid out as blocks and chips
   rather than prose. Every chip carries a qualifier in --text-dim: the name
   alone ("TypeScript") says nothing about how far the knowledge goes. */




.craft { display: flex; flex-direction: column; gap: 0.7rem; }
.craft-item {
  display: flex; flex-direction: column; gap: 0.3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  transition: border-color 0.2s ease;
}
.craft-item:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.craft-title {
  font-weight: 650; font-size: 1.02rem; color: var(--text);
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.craft-desc { color: var(--text-dim); font-size: 0.94rem; max-width: 58ch; }
.craft-desc a { color: var(--accent-2); }

/* numbered variant — the counter sits in its own column so the title and the
   line under it stay aligned with each other */
.craft-item.numbered {
  display: grid;
  grid-template-columns: 2.1rem 1fr;
  gap: 0.25rem 0.9rem;
  align-items: baseline;
}
.craft-num {
  grid-row: span 2;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 480px) {
  .craft-item.numbered { grid-template-columns: 1.7rem 1fr; gap: 0.25rem 0.7rem; }
}

/* an in-progress chip is grey, not green — it shouldn't read as a credential */
.status-pill.idle { color: var(--text-faint); border-color: var(--border); }

.stack-group { margin-bottom: 1.5rem; }
.stack-group:last-child { margin-bottom: 0; }
.group-label {
  font-family: var(--mono); font-size: 0.74rem;
  color: var(--text-faint); margin-bottom: 0.55rem;
}
.chip-lg {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  font-family: var(--sans); font-size: 0.88rem; font-weight: 550;
  color: var(--text); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.45rem 0.7rem;
  transition: border-color 0.2s ease;
}
.chip-lg:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.chip-lg small {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 400;
  color: var(--text-dim);
}

/* ---- writeup / page ---- */
.writeup-head, .page > h1 { margin-bottom: 1.4rem; }
.back { font-family: var(--mono); font-size: 0.82rem; color: var(--text-dim); }
.writeup-head h1, .page h1 { font-size: 1.9rem; margin: 0.6rem 0 0.5rem; letter-spacing: -0.02em; line-height: 1.2; }
.writeup-meta { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; color: var(--text-faint); font-family: var(--mono); font-size: 0.82rem; }

/* ---- prose ---- */
.prose { font-size: 1.06rem; }
.prose h2 { font-size: 1.35rem; margin: 2rem 0 0.6rem; letter-spacing: -0.01em; }
.prose h3 { font-size: 1.12rem; margin: 1.6rem 0 0.5rem; color: var(--text); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.05rem; }
.prose ul, .prose ol { padding-inline-start: 1.4rem; }
.prose li { margin: 0.3rem 0; }
.prose a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: #fff; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); }

.prose blockquote {
  margin: 1.2rem 0; padding: 0.2rem 1rem;
  border-inline-start: 3px solid var(--accent);
  color: var(--text-dim); background: var(--bg-soft);
  border-radius: 0 6px 6px 0;
}

/* inline code */
.prose :not(pre) > code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 0.1em 0.4em; border-radius: 5px; color: #e6c07b;
}

/* code blocks (Pygments fills in token colors via code.css) */
.prose pre, .codehilite {
  background: #030507 !important;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 0 0 1.15rem;
}
.prose pre code { font-family: var(--mono); background: none; border: 0; padding: 0; }
.codehilite pre { margin: 0; background: none !important; }

/* tables */
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1.15rem; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: start; }
.prose th { background: var(--bg-soft); font-family: var(--mono); font-size: 0.85rem; }

/* ---- footer ---- */
.site-foot {
  max-width: var(--measure); width: 100%; margin: 2.5rem auto 0;
  padding: 1.3rem 1.25rem 2rem; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 1.1rem;
}
.foot-meta { color: var(--text-faint); font-family: var(--mono); font-size: 0.75rem; }

/* contact rows: label / value / hint / arrow. Says what each link is before
   it's clicked, which a row of bare words can't. */
.contact { display: flex; flex-direction: column; gap: 0.1rem; }
.linkrow {
  display: flex; align-items: baseline; gap: 0.9rem;
  padding: 0.6rem 0.75rem; margin-inline: -0.75rem;
  border-radius: 9px; color: var(--text);
  transition: background 0.18s ease;
}
.linkrow:hover { text-decoration: none; background: var(--bg-soft); }
.lr-label {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--text-faint); min-width: 5.5rem;
}
.lr-value { font-size: 0.92rem; font-weight: 550; }
.lr-hint { font-size: 0.8rem; color: var(--text-faint); margin-inline-start: auto; display: none; }
.lr-arrow { color: var(--text-faint); font-family: var(--mono); font-size: 0.82rem; transition: color 0.18s ease; }
.linkrow:hover .lr-arrow { color: var(--accent); }
@media (min-width: 620px) { .lr-hint { display: inline; } }

/* ---- load motion ----
   Everything rises a few pixels as the page settles. Two rules about how this
   is written, both deliberate:

   1. It's inside `prefers-reduced-motion: no-preference`, not disabled inside
      `reduce`. The difference matters: the animation starts at opacity 0, so if
      it were the default and anything stopped it running — an old browser, a
      reduced-motion setting, the stylesheet arriving late — the page would be
      blank. Written this way, no motion means the page is simply already there.
   2. It's CSS, so the output stays zero-JavaScript. Nothing here needs a script.

   Delays overlap on purpose. Elements are far apart vertically, so a strict
   queue reads as slow; overlapping reads as one movement. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes ss-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  main > *,
  main > .intro > * {
    animation: ss-rise 0.5s cubic-bezier(0.21, 0.61, 0.35, 1) both;
  }
  /* the intro is a container for its own stagger, so it doesn't move itself —
     animating both would fade its children in twice */
  main > .intro { animation: none; }

  main > .intro > *:nth-child(1) { animation-delay: 0.04s; }
  main > .intro > *:nth-child(2) { animation-delay: 0.09s; }
  main > .intro > *:nth-child(3) { animation-delay: 0.14s; }
  main > .intro > *:nth-child(4) { animation-delay: 0.19s; }
  main > .intro > *:nth-child(5) { animation-delay: 0.24s; }

  main > *:nth-child(1) { animation-delay: 0.04s; }
  main > *:nth-child(2) { animation-delay: 0.12s; }
  main > *:nth-child(3) { animation-delay: 0.18s; }
  main > *:nth-child(4) { animation-delay: 0.24s; }
  main > *:nth-child(5) { animation-delay: 0.30s; }
  main > *:nth-child(6) { animation-delay: 0.36s; }
  main > *:nth-child(7) { animation-delay: 0.42s; }
  main > *:nth-child(8) { animation-delay: 0.48s; }
  main > *:nth-child(n + 9) { animation-delay: 0.54s; }

  /* The "available for work" dot breathes. It's the one thing on the page that
     claims something is true *right now*, so it's the one thing still moving
     after the page has settled. The card status chips stay still. */
  .intro .status-pill .dot {
    animation: ss-pulse 2.6s ease-in-out 1.2s infinite;
  }
  @keyframes ss-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
    50%      { opacity: 0.65; box-shadow: 0 0 0 5px transparent; }
  }
}

/* ---- RTL: Arabic posts render right-to-left and read in a serifless Arabic face ---- */
[dir="rtl"] .prose, article.rtl .prose { font-family: "Noto Naskh Arabic", "Segoe UI", var(--sans); }
article.rtl .writeup-meta, article.rtl .writeup-head { text-align: start; }
/* code always reads left-to-right, even inside an RTL post */
article.rtl pre, [dir="rtl"] pre,
article.rtl .codehilite, [dir="rtl"] .codehilite { direction: ltr; text-align: left; }
article.rtl :not(pre) > code, [dir="rtl"] :not(pre) > code { direction: ltr; unicode-bidi: embed; }

/* ---- small screens ---- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 1.7rem; }
  .intro h1 { font-size: 1.95rem; }
  .lr-label { min-width: 4.5rem; }
  .post-link { flex-direction: column; gap: 0.15rem; }
  .post-date { order: -1; }
  .seq-nav { flex-direction: column; gap: 1.2rem; }
  .seq-nav a { max-width: 100%; }
  .seq-next { text-align: start; margin-inline-start: 0; }
}
