/* ==========================================================================
   Mintesnot Yimer — portfolio stylesheet

   Direction: an operations record. Almost every project here is the same act —
   instrument something, then read what it says. So the page borrows the
   discipline of the instruments rather than the look of a marketing site:
   aligned columns, hairline rules, field/value pairs, and figures set in
   monospace so they read as measurements. One accent colour, used as signal.

   No gradients, no card grid, no uppercase eyebrow labels.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   Light ("paper") is the primary design. Dark re-declares the same names.
   -------------------------------------------------------------------------- */
:root {
  /* cool technical paper, not warm cream */
  --paper: #eceef3;
  --paper-raised: #f7f8fa;
  --surface: #ffffff;

  --ink: #131a2a;
  --ink-soft: #3c465e;
  --muted: #5b6478;

  --accent: #1b34b8;          /* printed-matter ultramarine */
  --accent-ink: #142a9c;      /* accent as text on paper */
  --accent-wash: rgba(27, 52, 184, 0.06);
  --on-accent: #ffffff;

  --live: #16794a;            /* the availability dot, and nothing else */

  --rule: #ccd2df;            /* hairlines carry the structure */
  --rule-strong: #9aa5bd;

  --max: 1120px;
  --gutter: 1.75rem;
  --tap: 44px;

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

  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #0d1220;
  --paper-raised: #141b2c;
  --surface: #161e31;

  --ink: #e7eaf2;
  --ink-soft: #b3bccf;
  --muted: #909bb4;

  --accent: #8ea3ff;
  --accent-ink: #a8b8ff;
  --accent-wash: rgba(142, 163, 255, 0.09);
  --on-accent: #0d1220;

  --live: #4ac585;

  --rule: #28314a;
  --rule-strong: #414d6d;

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

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

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }

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

/* Figures are measurements: tabular, monospaced, never decorative. */
.fig {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.8rem 1.2rem;
  font-size: 0.9rem;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; text-decoration: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

.page { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* Section rhythm: rules between sections, not boxes around them. */
.band { border-top: 1px solid var(--rule); }
.band > .wrap { padding-block: 4.5rem; }

/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.5rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  min-height: var(--tap);
  flex: 0 1 auto;
  overflow: hidden;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand-name {
  font-family: var(--cond);
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-role { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

.nav-links { display: flex; align-items: center; gap: 1.5rem; font-size: 0.88rem; }
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--accent-ink); text-decoration: none; }
.nav-links a[aria-current="page"],
.nav-links a.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.nav-tools { display: flex; align-items: center; gap: 0.5rem; flex: 0 0 auto; }

/* Square controls: the chrome stays quiet and mechanical. */
.lang-switch { display: inline-flex; border: 1px solid var(--rule-strong); }
.lang-switch button {
  min-height: var(--tap);
  min-width: 42px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lang-switch button + button { border-left: 1px solid var(--rule-strong); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

.icon-btn {
  min-height: var(--tap);
  min-width: var(--tap);
  display: grid;
  place-items: center;
  border: 1px solid var(--rule-strong);
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.95rem;
  cursor: pointer;
}
.icon-btn:hover { color: var(--accent-ink); border-color: var(--accent); }

.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.nav-toggle { display: none; }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: var(--tap);
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--rule-strong);
  background: transparent;
  color: var(--ink);
  font: 500 0.88rem/1 var(--sans);
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }

/* --------------------------------------------------------------------------
   5. Hero — a specification block, readable in ten seconds
   -------------------------------------------------------------------------- */
.hero > .wrap { padding-block: 3.5rem 4rem; }

.hero-name {
  font-family: var(--cond);
  font-size: clamp(2.6rem, 10vw, 6.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 0.92;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}

.hero-role {
  font-family: var(--cond);
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  font-weight: 400;
  color: var(--ink-soft);
  padding-bottom: 1.4rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 2.25rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}

.hero-lede { font-size: 1.06rem; color: var(--ink-soft); max-width: 62ch; margin-bottom: 2rem; }
.hero-lede b { color: var(--ink); font-weight: 600; }

/* The record itself: field left, value right, hairline between. */
.spec { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); }
.spec > dt,
.spec > dd { padding: 0.7rem 0; border-top: 1px solid var(--rule); font-size: 0.93rem; }
.spec > dt { color: var(--muted); }
.spec > dd { color: var(--ink); }
.spec > dd b { font-weight: 600; }
.spec .fig { font-size: 0.9rem; }

.hero-aside { border: 1px solid var(--rule-strong); background: var(--paper-raised); padding: 1.5rem; }

.status {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 500;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.status .dot {
  width: 9px; height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--live);
  transform: translateY(-1px);
}

.aside-note { font-size: 0.88rem; color: var(--muted); margin-bottom: 1.25rem; }
.aside-actions { display: grid; gap: 0.55rem; }
.aside-actions .btn { justify-content: flex-start; }

/* --------------------------------------------------------------------------
   6. Section headings
   -------------------------------------------------------------------------- */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 2rem 3.5rem;
  align-items: end;
  margin-bottom: 2.5rem;
}
.section-head h2 {
  font-family: var(--cond);
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  letter-spacing: -0.01em;
}
.section-head p { font-size: 0.98rem; color: var(--muted); max-width: 58ch; }

/* --------------------------------------------------------------------------
   7. Prose and skills
   -------------------------------------------------------------------------- */
.prose { display: grid; gap: 1.15rem; max-width: 62ch; font-size: 1rem; color: var(--ink-soft); }
.prose b { color: var(--ink); font-weight: 600; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 3.5rem; align-items: start; }

.skill-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0 1.5rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
}
.skill-row:last-child { border-bottom: 1px solid var(--rule); }
.skill-row h3 { font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.skill-row ul { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }
.skill-row li { font-size: 0.9rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   8. Project register — rows in a log, not a grid of cards
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  border: 1px solid var(--rule-strong);
  width: fit-content;
}
.filter-btn {
  min-height: var(--tap);
  padding: 0.5rem 1.05rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 0.85rem/1 var(--sans);
  cursor: pointer;
}
.filter-btn + .filter-btn { border-left: 1px solid var(--rule-strong); }
.filter-btn:hover { color: var(--accent-ink); }
.filter-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

.register { border-top: 1px solid var(--rule-strong); }

.entry {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr) 13rem;
  gap: 0 2.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
}

.entry-rail { font-size: 0.83rem; color: var(--muted); line-height: 1.45; }
.entry-rail .rail-cat { color: var(--ink); font-weight: 500; }
.entry-rail .flag {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--rule-strong);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.entry-main { min-width: 0; }
.entry-main h2,
.entry-main h3 {
  font-family: var(--cond);
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  margin-bottom: 0.6rem;
}
.entry-summary { font-size: 0.95rem; color: var(--ink-soft); max-width: 62ch; margin-bottom: 0.9rem; }
.entry-role { font-size: 0.86rem; color: var(--muted); margin-bottom: 0.9rem; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 0.3rem 0.85rem; }
.entry-tags li { font-size: 0.82rem; color: var(--muted); }

/* Readings column: the numbers this project actually produced. */
.entry-side { display: grid; gap: 0.9rem; align-content: start; }
.readings { display: grid; gap: 0.6rem; }
/* Set as readings off an instrument, not as prose: tabular figures, so the
   numbers line up down the column. */
.reading {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding-left: 0.8rem;
  border-left: 2px solid var(--accent);
  line-height: 1.4;
}
.entry-link { display: inline-flex; align-items: center; gap: 0.45rem; min-height: var(--tap); font-size: 0.88rem; font-weight: 500; }
.entry-note { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }

/* The lead entry gets more room without becoming a different component. */
.entry.is-lead { padding-block: 2.75rem; }
.entry.is-lead .entry-main h2,
.entry.is-lead .entry-main h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
.entry.is-lead .entry-summary { font-size: 1.02rem; }

.empty-note { font-size: 0.95rem; color: var(--muted); padding: 2rem 0; }
.more-link { margin-top: 2.25rem; }

/* --------------------------------------------------------------------------
   9. Experience & education
   -------------------------------------------------------------------------- */
.record { border-top: 1px solid var(--rule-strong); }
.record-item {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 0 2.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.record-when { font-size: 0.86rem; color: var(--muted); }
.record-when .org { display: block; color: var(--ink); font-weight: 500; margin-bottom: 0.15rem; }
.record-item h3 { font-family: var(--cond); font-size: 1.18rem; margin-bottom: 0.65rem; }
.record-item ul { display: grid; gap: 0.35rem; }
.record-item li { font-size: 0.92rem; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   10. Contact
   -------------------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 3.5rem; align-items: start; }

.channels { border-top: 1px solid var(--rule); margin-top: 1.75rem; }
.channels a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 56px;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-size: 0.95rem;
  word-break: break-word;
}
.channels a:hover { color: var(--accent-ink); text-decoration: none; }
.channels .what { color: var(--muted); font-size: 0.82rem; flex: 0 0 5.5rem; }

.contact-form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-size: 0.86rem; color: var(--muted); }
.contact-form input,
.contact-form textarea {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  padding: 0.7rem 0.85rem;
  font: 400 0.95rem/1.5 var(--sans);
  color: var(--ink);
  resize: vertical;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--muted); opacity: 0.85; }
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.form-status { font-size: 0.88rem; min-height: 1.3em; }
.form-status.ok { color: var(--live); }
.form-status.err { color: #b3261e; }
[data-theme="dark"] .form-status.err { color: #ff8a80; }

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--rule-strong); }
.site-footer > .wrap {
  padding-block: 2rem 2.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer-links a { min-height: var(--tap); display: inline-flex; align-items: center; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   12. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .entry { grid-template-columns: 9rem minmax(0, 1fr); }
  .entry-side { grid-column: 2; margin-top: 1.1rem; }
  .readings { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
}

@media (max-width: 900px) {
  .hero-grid,
  .split,
  .contact-grid,
  .section-head { grid-template-columns: minmax(0, 1fr); }
  .section-head { gap: 0.75rem; align-items: start; }
  .hero-grid { gap: 2.5rem; }
  .band > .wrap { padding-block: 3.25rem; }
}

@media (max-width: 720px) {
  :root { --gutter: 1.15rem; }
  .brand-role { display: none; }
  .nav-toggle { display: grid; }

  /* Opaque panel: a translucent menu over page content is unreadable. */
  .nav-links {
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 var(--gutter) 0.75rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule-strong);
    box-shadow: 0 16px 24px rgba(19, 26, 42, 0.14);
    font-size: 1rem;
  }
  .nav-links[hidden] { display: none; }
  .nav-links a { padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a[aria-current="page"],
  .nav-links a.is-active { border-bottom-color: var(--rule); }

  .entry,
  .record-item,
  .skill-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .entry-rail { margin-bottom: 0.7rem; }
  .entry-rail .flag { margin-top: 0; margin-left: 0.5rem; }
  .entry-side { grid-column: 1; }
  .record-when { margin-bottom: 0.75rem; }
  .skill-row h3 { margin-bottom: 0.5rem; }
  .spec { grid-template-columns: minmax(0, 1fr); }
  .spec > dt { padding-bottom: 0; color: var(--muted); }
  .spec > dd { padding-top: 0.15rem; border-top: 0; }
  .filter-bar { width: 100%; }
  .filter-btn { flex: 1 1 auto; }
  .channels .what { flex-basis: 4.5rem; }
}

@media (max-width: 460px) {
  .brand-name { font-size: 1.05rem; }
  .footer-links { gap: 1.1rem; }
}

/* --------------------------------------------------------------------------
   13. Motion & print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header, .nav-tools, .contact-form, .filter-bar, .hero-aside, .site-footer { display: none !important; }
  body { background: #fff; color: #000; }
  .entry, .record-item { break-inside: avoid; }
}
