/* ===================================================================
   Sylvesters Ochieng Oyim — portfolio
   Dark hero with a live CYP2C9 backbone, light editorial body.
=================================================================== */

:root {
  --ink:        #0b1c27;
  --paper:      #f6f7f5;
  --surface:    #ffffff;
  --text:       #16242e;
  --muted:      #5a6b77;
  --line:       #dfe5e6;
  --teal:       #0f8f81;
  --teal-lit:   #2fd6bf;

  --maxw:       min(1560px, 94vw);
  --gutter:     clamp(20px, 4vw, 56px);
  --radius:     16px;
  --shadow:     0 18px 50px -24px rgba(11, 28, 39, 0.28);
  --font:       'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif:      'Spectral', "Iowan Old Style", Georgia, serif;
  --mono:       ui-monospace, "SF Mono", "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  font-family: var(--font); color: var(--text); background: var(--paper);
  line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--teal-lit); color: var(--ink); }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* monospace labels: kickers, indices, figure notes */
.section__kicker, .hero__eyebrow, .research__index, .figure__note {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
}

/* ===== Navigation ===== */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 60; color: #eaf4f3;
  border-bottom: 1px solid transparent;
  transition: background .35s, border-color .35s, color .35s;
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.nav__brand { display: flex; align-items: center; gap: 12px; font-weight: 650; }
.nav__mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  font-family: var(--mono); font-size: 13px; letter-spacing: .06em;
  background: linear-gradient(145deg, var(--teal), #0a6d63); color: #fff;
}
.nav__links { display: flex; gap: clamp(18px, 2.4vw, 36px); }
.nav__links a { font-size: 15px; font-weight: 500; opacity: .82; transition: opacity .2s; }
.nav__links a:hover { opacity: 1; }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; color: inherit; }
.nav.is-stuck {
  background: rgba(246, 247, 245, 0.86); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line); color: var(--text);
}

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100svh; display: grid; align-items: center;
  background:
    radial-gradient(120% 90% at 78% 12%, #17475a 0%, transparent 55%),
    radial-gradient(90% 80% at 12% 90%, #0d5a54 0%, transparent 60%),
    linear-gradient(170deg, #071620 0%, #0b1c27 55%, #081a24 100%);
  color: #e9f3f2; overflow: hidden; isolation: isolate;
}
#molecule { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
/* hairline grid + vignette: makes the molecule read as a figure, not wallpaper */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.028) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.028) 0 1px, transparent 1px 88px),
    radial-gradient(75% 65% at 50% 45%, transparent 38%, rgba(4, 12, 18, .74) 100%);
}
.hero__inner { position: relative; z-index: 2; padding: 128px 0 92px; }
.hero__eyebrow { color: var(--teal-lit); margin-bottom: 22px; }
.hero__title {
  font-family: var(--serif); font-weight: 600; font-size: clamp(42px, 7.2vw, 104px);
  line-height: 1.02; letter-spacing: -0.02em; margin-bottom: 26px;
}
.hero__lead { max-width: 62ch; font-size: clamp(17px, 1.35vw, 21px); color: #c9dcdb; }
.hero__lead strong { color: #fff; font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 38px 0 56px; }
.hero__meta {
  list-style: none; display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius); overflow: hidden; backdrop-filter: blur(12px) saturate(1.2);
  max-width: 820px;
}
.hero__meta li { background: rgba(10, 26, 36, .42); padding: 20px 24px; font-size: 17px; font-weight: 550; color: #fff; }
.hero__meta span {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--teal-lit); margin-bottom: 6px; font-weight: 400;
}
.hero__figure { position: absolute; z-index: 2; right: var(--gutter); bottom: 28px; max-width: 34ch; text-align: right; color: #8fa8ac; }
.figure__note { display: block; line-height: 1.7; letter-spacing: .1em; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 26px; border-radius: 999px;
  font-weight: 600; font-size: 15px; border: 1px solid transparent;
  transition: transform .18s, background .2s, border-color .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--teal-lit); color: #05221f; }
.btn--primary:hover { background: #4fe3ce; }
.btn--ghost { border-color: rgba(255,255,255,.28); color: inherit; }
.btn--ghost:hover { border-color: var(--teal-lit); color: var(--teal-lit); }
.section .btn--primary { background: var(--teal); color: #fff; }
.section .btn--primary:hover { background: #0b7a6e; }
.section .btn--ghost { border-color: var(--line); color: var(--text); }
.section .btn--ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ===== Sections ===== */
.section { padding: clamp(80px, 9vw, 150px) 0; position: relative; }
.section--alt {
  background:
    repeating-linear-gradient(0deg, rgba(11,28,39,.022) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(90deg, rgba(11,28,39,.022) 0 1px, transparent 1px 72px),
    #f1f3f1;
  border-block: 1px solid var(--line);
}
.section__kicker { color: var(--teal); margin-bottom: 14px; }
.section__title {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em;
  font-size: clamp(30px, 3.6vw, 52px); line-height: 1.12; margin-bottom: 18px; max-width: 26ch;
}
.section__intro { max-width: 68ch; color: var(--muted); font-size: clamp(16px, 1.15vw, 19px); }

/* ===== About ===== */
.about {
  margin-top: 56px; display: grid; gap: clamp(28px, 4vw, 64px);
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .9fr); align-items: start;
}
.about__body p { font-size: clamp(16px, 1.2vw, 19.5px); margin-bottom: 22px; max-width: 70ch; }
.about__body p:first-child::first-letter {
  font-family: var(--serif); font-size: 3.4em; line-height: .86; float: left;
  padding: 6px 12px 0 0; color: var(--teal);
}
.about__card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); position: sticky; top: 104px;
}
.about__card h3 { font-family: var(--serif); font-size: 21px; margin-bottom: 18px; }
.about__card dl > div { padding: 13px 0; border-top: 1px solid var(--line); }
.about__card dl > div:first-of-type { border-top: 0; padding-top: 0; }
.about__card dt {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 3px;
}
.about__card dd { font-weight: 550; }

/* ===== Research ===== */
.research { margin-top: 56px; display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.research__card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 30px 28px; position: relative; overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.research__card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--teal-lit));
  transform: scaleX(0); transform-origin: left; transition: transform .35s;
}
.research__card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #cfdad9; }
.research__card:hover::before { transform: scaleX(1); }
.research__index { color: var(--teal); display: block; margin-bottom: 14px; }
.research__card h3 { font-family: var(--serif); font-size: clamp(20px, 1.6vw, 26px); margin-bottom: 12px; }
.research__card p { color: var(--muted); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tags li {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em;
  padding: 5px 11px; border-radius: 999px; background: #eef4f3; color: #2c5d58;
}

/* ===== Skills ===== */
.skills { margin-top: 56px; display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.skills__group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.skills__group h3 {
  font-family: var(--serif); font-size: 20px; margin-bottom: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.skills__group ul { list-style: none; display: flex; flex-wrap: wrap; gap: 9px; }
.skills__group li {
  font-size: 14.5px; font-weight: 500; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: #fbfcfb;
}

/* ===== Projects ===== */
.projects { margin-top: 56px; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.repo {
  display: flex; flex-direction: column; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.repo:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #cfdad9; }
.repo__name { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.repo__desc { color: var(--muted); font-size: 15px; flex: 1; }
.repo__meta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-family: var(--mono);
  font-size: 11.5px; letter-spacing: .06em; color: var(--muted);
  padding-top: 14px; border-top: 1px solid var(--line);
}
.repo__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); display: inline-block; margin-right: 7px; }
.projects__state { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.projects__link { margin-top: 40px; }

/* ===== Contact / footer ===== */
.contact__links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.footer { background: var(--ink); color: #9fb4b8; padding: 40px 0; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 14.5px; }
.footer a:hover { color: var(--teal-lit); }

/* ===== Scroll reveal ===== */
/* only hidden when JS is running, so content is never lost if a script fails */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== Small screens ===== */
@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
  .about__card { position: static; }
  .hero__figure { position: static; text-align: left; max-width: none; margin-top: 34px; }
  .nav__links {
    position: fixed; inset: 76px 0 auto; flex-direction: column; gap: 0; display: none;
    background: rgba(246,247,245,.97); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 18px; color: var(--text);
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 13px 0; border-bottom: 1px solid var(--line); opacity: 1; }
  .nav__toggle { display: grid; gap: 5px; }
  .nav__toggle span { width: 24px; height: 2px; background: currentColor; border-radius: 2px; }
}

/* language label inside a repo card */
.repo__lang { display: inline-flex; align-items: center; }
.repo__name { display: flex; align-items: center; gap: 9px; }
