/* ==========================================================================
   Abdi Ayana — portfolio
   Plain CSS, no build step.

   Design note: the visual language is a route manifest — hairline rules,
   monospaced time columns, dispatch-board status pills. Sequence markers
   appear only where sequence is real (the chronological timeline).
   ========================================================================== */

/* --- tokens ------------------------------------------------------------- */

:root {
  --paper:      #f2f4f2;   /* neutrals carry a faint green-grey bias */
  --surface:    #ffffff;
  --surface-2:  #e8ece9;
  --ink:        #121614;
  --ink-2:      #333b37;
  --muted:      #545b57;
  --line:       #dce0dc;
  --line-2:     #c3cac5;

  --accent:     #0e6b4f;   /* countinghouse green */
  --accent-ink: #ffffff;
  --accent-bg:  #e2efe9;

  --signal:     #8a5d05;   /* semantic status only, never decoration */
  --signal-bg:  #f7edda;

  --radius:   4px;
  --radius-s: 3px;
  --maxw:     1120px;

  --display: "Bricolage Grotesque", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sans:    "IBM Plex Sans", ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #0f1211;
    --surface:    #171b19;
    --surface-2:  #1d2220;
    --ink:        #e9ede9;
    --ink-2:      #ccd3ce;
    --muted:      #8e9791;
    --line:       #262c29;
    --line-2:     #363e3a;
    --accent:     #5cc79c;
    --accent-ink: #0b1210;
    --accent-bg:  #14251f;
    --signal:     #e0a64a;
    --signal-bg:  #2a2113;
  }
}

:root[data-theme="dark"] {
  --paper:      #0f1211;
  --surface:    #171b19;
  --surface-2:  #1d2220;
  --ink:        #e9ede9;
  --ink-2:      #ccd3ce;
  --muted:      #8e9791;
  --line:       #262c29;
  --line-2:     #363e3a;
  --accent:     #5cc79c;
  --accent-ink: #0b1210;
  --accent-bg:  #14251f;
  --signal:     #e0a64a;
  --signal-bg:  #2a2113;
}

/* --- base --------------------------------------------------------------- */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--surface-2);
  border-radius: var(--radius-s);
  padding: 1px 5px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 0; top: 0; }

/* --- shared ------------------------------------------------------------- */

/* manifest-style section label: a rule, a monospaced tag, a rule */
.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 26px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--accent);
  flex: none;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.section { padding: 92px 0; border-top: 1px solid var(--line); }

.section-title { font-size: clamp(27px, 3.8vw, 38px); max-width: 22ch; margin-bottom: 18px; }

.lede { font-size: clamp(16.5px, 1.9vw, 18.5px); color: var(--ink-2); max-width: 64ch; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn svg { width: 16px; height: 16px; flex: none; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 3px 8px;
}

/* --- header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }

.brand {
  display: inline-flex; align-items: center; gap: 11px;
  text-decoration: none; margin-right: auto;
  font-family: var(--display); font-weight: 600; letter-spacing: -.01em;
}
.brand .mark {
  width: 30px; height: 30px; flex: none;
  border-radius: var(--radius-s);
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em;
}

.nav { display: flex; gap: 2px; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  padding: 7px 11px;
  border-radius: var(--radius-s);
  transition: color .16s ease, background .16s ease;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }

.theme-toggle {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer; flex: none;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-2); }
.theme-toggle svg { width: 16px; height: 16px; }

.icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun  { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}
:root[data-theme="dark"] .icon-sun  { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
:root[data-theme="light"] .icon-sun  { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }

@media (max-width: 760px) { .nav { display: none; } }

/* --- hero --------------------------------------------------------------- */

.hero { padding: 68px 0 84px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr);
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(37px, 6vw, 64px);
  letter-spacing: -0.035em;
  font-weight: 700;
  margin-bottom: 22px;
}
.hero h1 em { font-style: normal; color: var(--accent); }

/* dispatch-style status line */
.hero-kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 5px 12px 5px 10px;
  background: var(--surface);
}
.hero-kicker .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
  flex: none;
}

.hero p.intro {
  font-size: clamp(16.5px, 1.85vw, 19px);
  color: var(--ink-2);
  max-width: 58ch;
  margin-bottom: 30px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 9px 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { width: 14px; height: 14px; opacity: .8; }

/* Circular portrait. The square head-and-shoulders JPEG is keyed against a
   PNG whose alpha channel carries the cutout, so the theme-coloured disc shows
   through behind the subject instead of a baked-in background. CSS masks read
   alpha, not luminance — an opaque black/white PNG would mask nothing. */
.portrait {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-bg);
  box-shadow: inset 0 0 0 1px var(--line);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: url("../img/abdi-portrait-mask.png");
          mask-image: url("../img/abdi-portrait-mask.png");
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .portrait { grid-row: 1; max-width: 190px; justify-self: start; }
  .hero { padding: 40px 0 60px; }
}
/* on a phone the portrait reads as an avatar, not a hero image — the
   headline should be reachable without scrolling past it */
@media (max-width: 560px) {
  .hero-grid { gap: 22px; }
  .portrait { max-width: 132px; }
  .hero { padding: 28px 0 52px; }
  .section { padding: 68px 0; }
  .project-featured .body, .project-grid .body, figure.quote { padding: 24px; }
  .project-featured .figure { padding: 22px; }
}

/* --- work --------------------------------------------------------------- */

.project {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.project-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  margin-bottom: 24px;
}
.project-featured .body { padding: 38px; }
.project-featured .figure {
  border-left: 1px solid var(--line);
  background: var(--surface-2);
  padding: 32px;
  display: grid;
  place-items: center;
}
.project-featured .figure svg { width: 100%; height: auto; }

.project-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 6px; }
.project h3 { font-size: 23px; }
.project-featured h3 { font-size: 28px; }

.status {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--signal);
  background: var(--signal-bg);
  border: 1px solid color-mix(in srgb, var(--signal) 32%, transparent);
  border-radius: var(--radius-s);
  padding: 3px 9px;
  white-space: nowrap;
}

.role {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 18px;
}

.project ul.points { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 12px; }
.project ul.points li {
  position: relative;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.58;
}
.project ul.points li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 9px; height: 1px;
  background: var(--accent);
}
.project ul.points strong { color: var(--ink); font-weight: 600; }

.project-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.project-links a {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono);
  font-size: 12.5px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-s);
  padding: 7px 12px;
  transition: border-color .16s ease, background .16s ease;
}
.project-links a:hover { border-color: var(--ink); background: var(--surface-2); }
.project-links svg { width: 14px; height: 14px; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.project-grid .project { display: flex; flex-direction: column; }
.project-grid .body { padding: 28px; display: flex; flex-direction: column; flex: 1; }
.project-grid .tags { margin-top: auto; }

/* practice cards lead with a mono spec line instead of a screenshot */
.card-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.project-grid h3 { margin-bottom: 16px; }

.practice-note { font-size: 14px; color: var(--muted); margin: 22px 0 0; max-width: 70ch; }

@media (max-width: 940px) {
  .project-featured { grid-template-columns: 1fr; }
  .project-featured .figure { border-left: 0; border-top: 1px solid var(--line); }
  .project-featured .body { padding: 28px; }
  .project-grid { grid-template-columns: 1fr; }
}

/* --- experience: a real chronological sequence, so it gets the rail ------ */

.timeline { margin-top: 8px; }

.role-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 34px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.role-row:first-child { border-top: 0; padding-top: 6px; }

.role-when {
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding-top: 4px;
  white-space: nowrap;
  position: relative;
}
.role-when::before {
  content: "";
  position: absolute;
  left: -16px; top: 11px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--line-2);
}
.role-row:first-child .role-when::before { background: var(--accent); }

.role-row h3 { font-size: 18.5px; margin-bottom: 3px; }
.role-where { color: var(--accent); font-size: 14.5px; font-weight: 500; margin: 0 0 10px; }
.role-row p { font-size: 15px; color: var(--ink-2); max-width: 68ch; }
.role-row.is-pivot .role-where { color: var(--muted); }

.pivot-note {
  margin-top: 12px;
  font-size: 14.5px;
  color: var(--ink-2);
  background: var(--accent-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
}

@media (max-width: 700px) {
  .role-row { grid-template-columns: 1fr; gap: 8px; }
  .role-when::before { display: none; }
}

/* --- skills ------------------------------------------------------------- */

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(224px, 1fr));
  gap: 28px 32px;
  margin-top: 12px;
}
.skill-col h3 {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.skill-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.skill-col li { font-size: 15px; color: var(--ink-2); }

.skill-aside {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  color: var(--muted);
  max-width: 78ch;
}

/* --- recommendations ---------------------------------------------------- */

.quote-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 12px; }

figure.quote {
  margin: 0;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
figure.quote blockquote {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
}
figure.quote figcaption { margin-top: auto; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
figure.quote .who { font-weight: 600; font-size: 14.5px; }
figure.quote .what { font-family: var(--mono); font-size: 12px; color: var(--muted); }

@media (max-width: 760px) { .quote-grid { grid-template-columns: 1fr; } }

/* --- contact ------------------------------------------------------------ */

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(30px, 5vw, 54px);
}
.contact h2 { font-size: clamp(27px, 4.2vw, 42px); margin-bottom: 16px; max-width: 20ch; }
.contact p { color: var(--ink-2); max-width: 58ch; margin-bottom: 26px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* --- footer ------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 44px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex; flex-wrap: wrap; gap: 14px 24px;
  align-items: center; justify-content: space-between;
}
.social { display: flex; gap: 6px; }
.social a {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color .16s ease, border-color .16s ease;
}
.social a:hover { color: var(--ink); border-color: var(--line-2); }
.social svg { width: 16px; height: 16px; }

/* --- reveal ------------------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(12px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
