/* ============================================================
   Semere Wubshet Berhanu — Portfolio
   Design system (light primary + dark)
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans:  'Public Sans', system-ui, -apple-system, sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* light (primary) */
  --bg:          oklch(0.992 0.003 95);
  --surface:     #ffffff;
  --surface-2:   oklch(0.975 0.004 95);
  --ink:         oklch(0.24 0.012 260);
  --ink-soft:    oklch(0.40 0.012 260);
  --muted:       oklch(0.55 0.012 260);
  --faint:       oklch(0.70 0.010 260);
  --border:      oklch(0.915 0.005 260);
  --border-soft: oklch(0.945 0.004 260);
  --accent:      oklch(0.50 0.108 256);
  --accent-soft: oklch(0.95 0.03 256);
  --accent-ink:  oklch(0.44 0.115 256);

  --ring:      oklch(0.50 0.108 256 / 0.35);
  --shadow:    0 1px 2px oklch(0.2 0.02 260 / 0.04), 0 8px 24px -12px oklch(0.2 0.02 260 / 0.10);
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 260 / 0.05);

  --maxw:      1080px;
  --radius:    14px;
  --radius-sm: 9px;
}

[data-theme="dark"] {
  --bg:          oklch(0.185 0.01 260);
  --surface:     oklch(0.222 0.012 260);
  --surface-2:   oklch(0.245 0.012 260);
  --ink:         oklch(0.95 0.006 95);
  --ink-soft:    oklch(0.82 0.01 260);
  --muted:       oklch(0.66 0.014 260);
  --faint:       oklch(0.52 0.012 260);
  --border:      oklch(0.33 0.014 260);
  --border-soft: oklch(0.28 0.012 260);
  --accent:      oklch(0.72 0.12 256);
  --accent-soft: oklch(0.32 0.06 256);
  --accent-ink:  oklch(0.78 0.12 256);

  --ring:      oklch(0.72 0.12 256 / 0.45);
  --shadow:    0 1px 2px oklch(0 0 0 / 0.3), 0 12px 28px -14px oklch(0 0 0 / 0.5);
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 28px; }
.section { padding-block: clamp(28px, 4vw, 40px); }
.divider { height: 1px; background: var(--border-soft); border: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border-soft);
  transition: box-shadow .2s ease;
}
.site-header.scrolled { box-shadow: 0 1px 6px oklch(0.2 0.02 260 / 0.06); }

.nav {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
.brand .dot {
  color: var(--accent);
  margin-right: 3px;
}

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color .2s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

.nav-right { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: color .2s, border-color .2s, background .2s;
  padding: 0;
}
.icon-btn:hover { color: var(--ink); border-color: var(--faint); }
.icon-btn svg { width: 17px; height: 17px; }
.sun { display: none; }
[data-theme="dark"] .sun  { display: block; }
[data-theme="dark"] .moon { display: none; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform .15s ease, background .2s, border-color .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
[data-theme="dark"] .btn-primary { color: oklch(0.18 0.01 260); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--faint); color: var(--ink); }

.btn-sm { padding: 8px 14px; font-size: 13.5px; }

/* ---------- Status pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}
.pill .led {
  width: 7px; height: 7px; border-radius: 999px;
  background: oklch(0.62 0.16 150);
  box-shadow: 0 0 0 3px oklch(0.62 0.16 150 / 0.18);
}
.pill .led.loc {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}

/* ---------- Tag chips ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--ink-soft);
}
.tag.accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: transparent;
}

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(32px, 5vw, 56px); padding-bottom: clamp(24px, 3vw, 36px); }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.hero-photo {
  width: clamp(190px, 22vw, 248px);
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  object-fit: cover;
  object-position: 50% 18%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero-photo-circle { display: none; }

.hero-name {
  font-size: clamp(40px, 6.4vw, 68px);
  letter-spacing: -0.025em;
  line-height: 1.0;
}
.hero-role {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2.6vw, 27px);
  color: var(--accent-ink);
  margin-top: 12px;
}
.hero-bio {
  font-size: clamp(16px, 1.5vw, 17.5px);
  color: var(--ink-soft);
  max-width: 46ch;
  margin-top: 20px;
  text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ============================================================
   SELECTED PROJECTS (cards)
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.proj-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 22px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.proj-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--faint);
}
.proj-card .meta-row {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.proj-card h3 { font-size: 20px; line-height: 1.15; }
.proj-card .sub { font-size: 14px; color: var(--muted); margin-top: -4px; }
.proj-card .spacer { flex: 1; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 15px;
}
.text-link svg { width: 16px; height: 16px; transition: transform .2s; }
.text-link:hover svg { transform: translateX(4px); }

/* ============================================================
   TIMELINE (experience + education)
   ============================================================ */
.timeline { display: flex; flex-direction: column; }
.tl-item {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 28px;
  padding: 15px 0;
  border-top: 1px solid var(--border-soft);
}
.tl-item:first-child { border-top: 0; }
.tl-date {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  padding-top: 4px;
  letter-spacing: 0.01em;
}
.tl-title { font-size: 20px; line-height: 1.2; }
.tl-org { font-size: 14.5px; color: var(--accent-ink); font-weight: 600; margin-top: 3px; }
.tl-org .place { color: var(--muted); font-weight: 400; }
.tl-points { margin-top: 11px; display: flex; flex-direction: column; gap: 5px; }
.tl-points li {
  position: relative;
  padding-left: 18px;
  font-size: 14.5px;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.tl-points li::before {
  content: "–";
  position: absolute; left: 0;
  color: var(--faint);
}
.tl-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.tl-note .star { color: var(--accent); }

/* ============================================================
   QUIET BLOCKS (skills / achievements / langs / interests)
   ============================================================ */
.quiet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); }

.deflist { display: grid; grid-template-columns: 1fr; }
.deflist .row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 11px 0;
  border-top: 1px solid var(--border-soft);
  align-items: baseline;
}
.deflist .row:first-child { border-top: 0; }
.deflist dt {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.deflist dd { font-size: 14.5px; color: var(--ink-soft); }

.ach-list { display: flex; flex-direction: column; }
.ach-list .row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
}
.ach-list .row:first-child { border-top: 0; }
.ach-list .what { font-weight: 600; font-size: 15px; color: var(--ink); }
.ach-list .where { font-size: 13.5px; color: var(--muted); margin-left: auto; text-align: right; }

.mini-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 56px); }
/* Second row inside the combined quiet block (languages + interests) */
.quiet-row { margin-top: clamp(24px, 3vw, 36px); padding-top: clamp(24px, 3vw, 36px); border-top: 1px solid var(--border-soft); }
.lang-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-top: 1px solid var(--border-soft); font-size: 15px;
}
.lang-row:first-child { border-top: 0; }
.lang-level { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); }
.interest-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.interest-tags .tag { padding: 6px 13px; border-radius: 999px; font-size: 13.5px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding-block: 32px;
}
.footer-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 28px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 18px;
}
.footer-name { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { font-size: 14px; color: var(--muted); transition: color .2s; }
.footer-links a:hover { color: var(--ink); }
.footer-copy { font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* ============================================================
   PROJECTS PAGE
   ============================================================ */
.page-head { padding-bottom: 18px; }
.page-title { font-size: clamp(40px, 6vw, 64px); letter-spacing: -0.025em; }

.proj-layout { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start; }

.proj-nav { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 10px; }
.proj-nav-item {
  text-align: left;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .2s, background .2s;
}
.proj-nav-item:hover { border-color: var(--faint); }
.proj-nav-item.active { border-color: var(--accent); background: var(--accent-soft); }
.proj-nav-item .pn-title { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); }
.proj-nav-item.active .pn-title { color: var(--accent-ink); }
.proj-nav-item .pn-date { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 4px; }

.proj-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(26px, 4vw, 40px);
  box-shadow: var(--shadow-sm);
  display: none;
}
.proj-detail.visible { display: block; }
.proj-detail .pd-loc {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-ink);
}
.proj-detail h2 { font-size: clamp(28px, 4vw, 38px); margin-top: 12px; }
.proj-detail .pd-sub { font-size: 16px; color: var(--muted); margin-top: 8px; }
.proj-detail .tags { margin-top: 18px; }
.proj-detail .pd-body { font-size: 16px; color: var(--ink-soft); margin-top: 22px; max-width: 64ch; text-wrap: pretty; }
.proj-detail .pd-points { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.proj-detail .pd-points li {
  position: relative; padding-left: 22px;
  font-size: 15.5px; color: var(--ink-soft); text-wrap: pretty;
}
.proj-detail .pd-points li::before {
  content: "▸"; position: absolute; left: 0; color: var(--accent); font-size: 12px; top: 2px;
}
.pd-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pd-gallery a {
  display: block;
  border-radius: var(--radius-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.pd-gallery a:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.pd-gallery img {
  height: 84px;
  width: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.pd-links {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 28px; padding-top: 22px;
  border-top: 1px solid var(--border-soft);
}
.pd-links .btn svg { width: 16px; height: 16px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .card-grid { grid-template-columns: 1fr; }
  .quiet-grid { grid-template-columns: 1fr; gap: 40px; }
  .proj-layout { grid-template-columns: 1fr; }
  /* Mobile: drop the tab nav and stack every project expanded */
  .proj-nav { display: none; }
  .proj-detail { display: block !important; margin-bottom: 16px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}

@media (max-width: 680px) {
  .nav-links { gap: 18px; }
  .brand { font-size: 16px; }
  .hero { padding-top: 36px; text-align: center; }
  .hero-grid { grid-template-columns: 1fr; gap: 22px; justify-items: center; }
  .hero-photo { display: none; }
  .hero-photo-circle {
    display: block;
    width: 116px; height: 116px;
    border-radius: 999px;
    object-fit: cover;
    object-position: 50% 16%;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .hero-bio { margin-inline: auto; }
  .hero-actions, .hero-meta { justify-content: center; }
  .tl-item { grid-template-columns: 1fr; gap: 8px; }
  .tl-date { padding-top: 0; }
  .deflist .row { grid-template-columns: 130px 1fr; gap: 14px; }
  .mini-cols { grid-template-columns: 1fr; gap: 36px; }
  .ach-list .where { margin-left: 0; }
}

@media (max-width: 460px) {
  .wrap, .nav, .footer-inner { padding-inline: 20px; }
  .nav { gap: 12px; }
  .brand { font-size: 15px; }
  /* Reclaim header space on the smallest screens — email lives in the footer */
  .nav-right .btn-primary { display: none; }
  .deflist .row { grid-template-columns: 1fr; gap: 2px; }
  .ach-list .row { flex-direction: column; gap: 2px; }
  .ach-list .where { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
