/* ============================================================
   Mickyas Tamiru Asfaw: robotics portfolio
   Dark engineering theme · accent: AETHER orange
   ============================================================ */
:root {
  --bg: #0d1117;
  --bg-soft: #131a23;
  --card: #161f2a;
  --card-edge: #223041;
  --text: #e6edf3;
  --text-dim: #9db0c0;
  --text-faint: #6b7f90;
  --accent: #e08a3c;
  --accent-soft: rgba(224, 138, 60, 0.14);
  --blue: #58a6ff;
  --teal: #2dd4bf;
  --radius: 14px;
  --maxw: 1120px;
  --font: "Inter", "Segoe UI", -apple-system, Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 17, 23, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-edge);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 28px;
}
.nav-logo {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  color: var(--text); letter-spacing: 0.5px;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo .tick { color: var(--accent); }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--text-dim); font-size: 14.5px; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
  border: 1px solid var(--accent); color: var(--accent) !important;
  padding: 6px 14px; border-radius: 8px; font-weight: 600;
}
.nav-cta:hover { background: var(--accent-soft); }

/* ---------- hero ---------- */
.hero { padding: 92px 0 70px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 10%, rgba(88, 166, 255, 0.07), transparent),
    radial-gradient(ellipse 50% 45% at 15% 85%, rgba(224, 138, 60, 0.06), transparent);
  pointer-events: none;
}
.hero-kicker {
  font-family: var(--mono); font-size: 14px; color: var(--accent);
  letter-spacing: 1.2px; margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px); line-height: 1.08;
  font-weight: 800; letter-spacing: -1px; max-width: 850px;
}
.hero h1 .grad {
  background: linear-gradient(92deg, var(--accent), #f2b26a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  margin-top: 22px; max-width: 640px;
  color: var(--text-dim); font-size: 18.5px;
}
.hero-meta {
  margin-top: 16px; color: var(--text-faint); font-size: 15px;
  display: flex; gap: 18px; flex-wrap: wrap;
}
.hero-actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 22px; border-radius: 10px; font-weight: 600; font-size: 15.5px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #14100a; }
.btn-primary:hover { box-shadow: 0 6px 24px rgba(224, 138, 60, 0.35); }
.btn-ghost { border: 1px solid var(--card-edge); color: var(--text); background: var(--bg-soft); }
.btn-ghost:hover { border-color: var(--text-faint); }

/* ---------- sections ---------- */
section { padding: 72px 0; }
.sec-kicker {
  font-family: var(--mono); font-size: 13.5px; color: var(--accent);
  letter-spacing: 1.4px; text-transform: uppercase; margin-bottom: 10px;
}
.sec-title { font-size: clamp(26px, 3.2vw, 36px); font-weight: 750; letter-spacing: -0.5px; }
.sec-lead { margin-top: 12px; color: var(--text-dim); max-width: 700px; }

/* ---------- featured (AETHER-1) ---------- */
.featured {
  margin-top: 38px; background: var(--card);
  border: 1px solid var(--card-edge); border-radius: var(--radius);
  overflow: hidden;
  display: grid; grid-template-columns: 1.25fr 1fr;
}
.featured-media { position: relative; min-height: 340px; }
.featured-media img, .featured-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.featured-body { padding: 36px 36px 30px; display: flex; flex-direction: column; }
.featured-tag {
  font-family: var(--mono); font-size: 12.5px; color: var(--accent);
  letter-spacing: 1px; margin-bottom: 12px;
}
.featured-body h3 { font-size: 27px; font-weight: 750; letter-spacing: -0.4px; }
.featured-body p { margin-top: 12px; color: var(--text-dim); font-size: 15.5px; }
.fact-row { margin-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fact {
  background: var(--bg-soft); border: 1px solid var(--card-edge);
  border-radius: 10px; padding: 10px 12px;
}
.fact b { display: block; font-size: 16.5px; color: var(--text); font-weight: 700; }
.fact span { font-size: 12px; color: var(--text-faint); line-height: 1.35; display: block; margin-top: 2px; }
.featured-foot { margin-top: 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lock-note { font-size: 13px; color: var(--text-faint); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- project grid ---------- */
.grid {
  margin-top: 38px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px;
}
.card {
  background: var(--card); border: 1px solid var(--card-edge);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.card:hover { transform: translateY(-4px); border-color: #31465e; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35); }
.card-media { aspect-ratio: 16 / 9.4; background: #0a0e13; position: relative; }
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; }
.card-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.card-media.pattern {
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(rgba(13,17,23,0.55), rgba(13,17,23,0.55)),
    repeating-linear-gradient(45deg, #141c26 0 14px, #101720 14px 28px);
}
.card-media.pattern span {
  font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--text-faint);
  letter-spacing: 2px;
}
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card-body h4 { font-size: 18.5px; font-weight: 700; letter-spacing: -0.2px; }
.card-body p { margin-top: 8px; color: var(--text-dim); font-size: 14.5px; flex: 1; }
.tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-dim);
  border: 1px solid var(--card-edge); border-radius: 999px; padding: 3px 10px;
  background: var(--bg-soft);
}
.card-foot { margin-top: 16px; display: flex; gap: 14px; align-items: center; font-size: 14px; font-weight: 600; }
.card-foot .private { color: var(--text-faint); font-weight: 500; font-size: 13px; }

/* ---------- skills ---------- */
.skill-groups { margin-top: 34px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.skill-group {
  background: var(--card); border: 1px solid var(--card-edge);
  border-radius: var(--radius); padding: 22px;
}
.skill-group h5 {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 13px;
}
.skill-group .tags { margin-top: 0; }

/* ---------- experience / publications / education ---------- */
.timeline { margin-top: 38px; display: flex; flex-direction: column; gap: 18px; }
.exp {
  background: var(--card); border: 1px solid var(--card-edge);
  border-radius: var(--radius); padding: 24px 26px;
  border-left: 3px solid var(--accent);
}
.exp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.exp-head h4 { font-size: 18.5px; font-weight: 700; letter-spacing: -0.2px; }
.exp-org { margin-top: 3px; color: var(--accent); font-size: 14.5px; font-weight: 600; }
.exp-meta { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.exp-date { font-family: var(--mono); font-size: 13px; color: var(--text); }
.exp-loc { font-size: 13px; color: var(--text-faint); }
.exp ul { margin: 14px 0 0 20px; color: var(--text-dim); font-size: 14.5px; }
.exp li { margin-top: 6px; }
.exp-links { margin-top: 14px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }

.exp-split { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.sub-head { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 16px; }

.pub {
  background: var(--card); border: 1px solid var(--card-edge);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
}
.pub-body h4 { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text); }
.pub-meta { margin-top: 8px; font-size: 13px; color: var(--text-faint); font-family: var(--mono); }
.badge {
  flex-shrink: 0; font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}
.badge-ok { color: var(--teal); border: 1px solid rgba(45, 212, 191, 0.4); background: rgba(45, 212, 191, 0.1); }
.badge-wip { color: var(--accent); border: 1px solid rgba(224, 138, 60, 0.4); background: var(--accent-soft); }
.badge-sub { color: var(--blue); border: 1px solid rgba(88, 166, 255, 0.4); background: rgba(88, 166, 255, 0.1); }

.edu {
  background: var(--card); border: 1px solid var(--card-edge);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px;
}
.edu h4 { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text); }
.edu-org { margin-top: 5px; font-size: 13.5px; color: var(--text-dim); }
.edu-note { margin-top: 3px; font-size: 13px; color: var(--text-faint); font-family: var(--mono); }

.foot-social { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-social a { color: var(--text-dim); }

/* ---------- about / contact ---------- */
.about-flex { margin-top: 30px; display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }
.about-flex p + p { margin-top: 14px; }
.about-flex p { color: var(--text-dim); }
.about-side {
  background: var(--card); border: 1px solid var(--card-edge);
  border-radius: var(--radius); padding: 24px;
}
.about-side h5 { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: 1px; margin-bottom: 12px; }
.about-side ul { list-style: none; }
.about-side li { padding: 7px 0; border-bottom: 1px solid var(--card-edge); font-size: 14.5px; color: var(--text-dim); }
.about-side li:last-child { border-bottom: none; }
.about-side li b { color: var(--text); font-weight: 600; }

.contact { text-align: center; padding: 84px 0 90px; }
.contact .sec-title { margin-top: 6px; }
.contact p { margin-top: 14px; color: var(--text-dim); max-width: 560px; margin-left: auto; margin-right: auto; }
.contact .hero-actions { justify-content: center; }

footer {
  border-top: 1px solid var(--card-edge); padding: 26px 0 34px;
  color: var(--text-faint); font-size: 13.5px;
}
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
footer a { color: var(--text-dim); }

/* ---------- project detail page ---------- */
.detail-hero { position: relative; }
.detail-hero img, .detail-hero video { width: 100%; max-height: 520px; object-fit: cover; border-radius: 0 0 18px 18px; display: block; }
.detail-hero iframe { width: 100%; height: clamp(240px, 42vw, 520px); border: 0; display: block; border-radius: 0 0 18px 18px; }
.detail-body { max-width: 860px; margin: 0 auto; padding: 46px 24px 80px; }
.detail-body h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.8px; }
.detail-body .lede { margin-top: 14px; font-size: 18.5px; color: var(--text-dim); }
.detail-body h2 { margin-top: 46px; font-size: 24px; letter-spacing: -0.3px; }
.detail-body p { margin-top: 12px; color: var(--text-dim); }
.detail-body ul { margin: 12px 0 0 22px; color: var(--text-dim); }
.detail-body li { margin-top: 6px; }
.detail-body figure { margin-top: 22px; }
.detail-body figure img { border-radius: 12px; border: 1px solid var(--card-edge); }
.detail-body figcaption { margin-top: 9px; font-size: 13.5px; color: var(--text-faint); }

.results-table { width: 100%; margin-top: 22px; border-collapse: collapse; font-size: 14.5px; }
.results-table th, .results-table td {
  padding: 10px 12px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--card-edge);
}
.results-table th { color: var(--text-dim); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.results-table td { color: var(--text-dim); }
.results-table td b { color: var(--text); }
.back-link { font-family: var(--mono); font-size: 14px; }
.media16 {
  position: relative; aspect-ratio: 16 / 9; margin-top: 22px;
  background: #0a0e13; border: 1px solid var(--card-edge);
  border-radius: 12px; overflow: hidden;
}
.media16 video, .media16 img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-body .lock-note { margin-top: 20px; }
.notice {
  margin-top: 26px; background: var(--accent-soft); border: 1px solid rgba(224, 138, 60, 0.4);
  border-radius: 10px; padding: 14px 18px; font-size: 14.5px; color: var(--text-dim);
}

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.on { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .featured { grid-template-columns: 1fr; }
  .featured-media { min-height: 250px; }
  .about-flex { grid-template-columns: 1fr; }
  .exp-split { grid-template-columns: 1fr; gap: 30px; }
  .exp-head { flex-direction: column; gap: 4px; }
  .exp-meta { text-align: left; }
  .nav-links a:not(.nav-cta) { display: none; }
}
@media (max-width: 560px) {
  .fact-row { grid-template-columns: 1fr 1fr; }
  section { padding: 54px 0; }
  .hero { padding: 64px 0 50px; }
}

/* ---------- additive: engineering-narrative detail pages (subsection headings) ---------- */
.detail-body h3 { margin-top: 30px; font-size: 19px; font-weight: 700; letter-spacing: -0.2px; }

/* ---------- additive: inline code on detail pages (aether-1 narrative) ---------- */
.detail-body code {
  font-family: var(--mono); font-size: 0.86em; color: var(--teal);
  background: var(--bg-soft); border: 1px solid var(--card-edge);
  border-radius: 6px; padding: 1px 6px; white-space: nowrap;
}

/* ---------- additive: breakout width for wide technical diagrams ----------
   Wide, densely-labelled diagrams (pipeline / architecture / challenge /
   reward-trap style) are far wider than the ~860px prose column, so in-column
   they scale down until their labels are unreadable. `.wide` breaks them out of
   the column and centres them on the viewport (relies on .detail-body being
   horizontally centred, margin: 0 auto), then falls back to horizontal scroll
   on small screens. */
.detail-body figure.wide {
  width: min(94vw, 1320px);
  margin-left: 50%;
  transform: translateX(-50%);
}
.detail-body figure.wide img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--card-edge);
}
@media (max-width: 760px) {
  .detail-body figure.wide { width: 96vw; overflow-x: auto; }
  .detail-body figure.wide img { min-width: 680px; }
}
