/* ali.al-hammadi.bh — shared styles
   Palette: deep petrol (Gulf water at night) + amber phosphor accent */

:root {
  --bg: #13202a;
  --surface: #182a36;
  --term: #0d171e;
  --line: #27394a;
  --text: #e7e2d8;
  --muted: #93a3ae;
  --accent: #e9a23b;
  --accent-soft: rgba(233, 162, 59, 0.14);

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --measure: 44rem;
  --wide: 68rem;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef2f4;
    --surface: #e2e9ed;
    --term: #13202a;
    --line: #c5d1d8;
    --text: #13202a;
    --muted: #4f626e;
    --accent: #9a5b00;
    --accent-soft: rgba(154, 91, 0, 0.1);
    color-scheme: light;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "tnum" 0;
}

a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 0.75rem; z-index: 10; }

.wrap { width: min(100% - 2.5rem, var(--wide)); margin-inline: auto; }

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.brand { font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.nav { display: flex; gap: 1.5rem; font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 40rem) { .nav { gap: 1rem; } .nav .hide-sm { display: none; } }

/* ---------- hero ---------- */
.hero { padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5rem); }
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0 0 1.25rem;
  max-width: 14ch;
}
.hero .lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 38rem; margin: 0 0 2.75rem; }
.hero .lede strong { color: var(--text); font-weight: 500; }

/* the terminal: the one loud element on the page */
.term {
  background: var(--term);
  border: 1px solid var(--line);
  border-radius: 10px;
  max-width: 46rem;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}
.term-bar {
  display: flex; justify-content: space-between;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font: 0.8rem/1 var(--mono);
  color: #6f8391;
}
.term .screen {
  padding: 1.25rem 1.25rem 1.5rem;
  font: 0.95rem/1.75 var(--mono);
  color: #e7e2d8;
  min-height: 16.5rem;
}
.term .line { display: block; white-space: pre-wrap; word-break: break-word; }
.term .p { color: #e9a23b; }
.term .p b { font-weight: 400; color: #7fa7bf; }
.term .out { color: #b9c4cb; }
.term .dim { color: #6f8391; }
.term .line[hidden] { display: none; }
.cursor {
  display: inline-block; width: 0.6em; height: 1.1em; vertical-align: -0.2em;
  background: #e9a23b; margin-left: 2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* ---------- sections ---------- */
section { padding-block: clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--line); }
section > .wrap { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2rem 3rem; }
@media (max-width: 52rem) { section > .wrap { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; } }
section h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.015em; margin: 0; line-height: 1.3; }
.body { max-width: var(--measure); }
.body > p:first-child { margin-top: 0; }
.muted { color: var(--muted); }

/* ---------- experience timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 0.6rem; bottom: 0.6rem; width: 1px; background: var(--line); }
.role { position: relative; padding-left: 2rem; padding-bottom: 2.5rem; }
.role:last-child { padding-bottom: 0; }
.role::before {
  content: ""; position: absolute; left: 0; top: 0.5rem;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--muted);
}
.role.current::before { border-color: var(--accent); background: var(--accent); }
.role h3 { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.35; }
.role .org { margin: 0.15rem 0 0; color: var(--text); }
.role .when { margin: 0.1rem 0 0.9rem; color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.role .note { color: var(--muted); font-size: 0.95rem; }
.role ul { margin: 0; padding-left: 1.1rem; }
.role li { margin-bottom: 0.45rem; }
.role li::marker { color: var(--muted); }
.role + .role.sub { padding-top: 0; }

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 2.5rem; margin: 0; }
@media (max-width: 36rem) { .skills { grid-template-columns: 1fr; } }
.skills dt { font-weight: 600; margin-bottom: 0.3rem; }
.skills dd { margin: 0; color: var(--muted); }

/* ---------- homelab teaser ---------- */
.teaser { background: var(--surface); border-radius: 10px; padding: clamp(1.5rem, 4vw, 2.25rem); }
.teaser p { margin: 0 0 1rem; }
.teaser .go { font-weight: 500; }

/* ---------- credentials ---------- */
.creds { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 2rem; }
.creds h3 { font-size: 1rem; font-weight: 600; margin: 0 0 0.75rem; color: var(--muted); }
.creds ul { list-style: none; margin: 0; padding: 0; }
.creds li { margin-bottom: 1rem; }
.creds li span { display: block; color: var(--muted); font-size: 0.95rem; }

/* ---------- contact ---------- */
.contact-links { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 0.6rem; }
.contact-links b { display: inline-block; width: 6rem; font-weight: 500; color: var(--muted); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: 2rem 3rem; color: var(--muted); font-size: 0.9rem; }
.site-foot code { font-family: var(--mono); font-size: 0.85rem; }

/* ---------- article (homelab page) ---------- */
.article-head { padding-block: clamp(3rem, 8vw, 5.5rem) 2rem; }
.article-head h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.03em; font-weight: 600; margin: 0 0 1rem; max-width: 18ch; }
.article-head .lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; margin: 0; }
.back { display: inline-block; margin-bottom: 2rem; color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.back:hover { color: var(--text); }

.diagram { margin: 1rem 0 0; padding-block: 1rem 3rem; }
.diagram .frame { background: var(--term); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 720px; height: auto; }
.diagram figcaption { color: var(--muted); font-size: 0.95rem; margin-top: 0.75rem; max-width: var(--measure); }

.prose { max-width: var(--measure); padding-bottom: 2rem; }
.prose h2 { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.015em; margin: 3rem 0 0.75rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--muted); }
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--surface); padding: 0.1em 0.35em; border-radius: 4px; }
