/* Abdulrazaq Olanipekun — portfolio
   One stylesheet shared by index.html and elvyn/index.html. */


:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --rule: #e2e8f0;
  --accent: #4338ca;
  --on-ink: #f8fafc;
  --focus: #4338ca;
  --tint: #eef2f7;
  --tint-accent: #eceeff;

  --display: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 66ch;
  --wrap: 1080px;
  --gutter: clamp(1rem, 4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1117;
    --surface: #151a23;
    --ink: #e8eaf0;
    --muted: #9aa3b2;
    --rule: #262c38;
    --accent: #9aa1ff;
    --on-ink: #0e1117;
    --focus: #9aa1ff;
    --tint: #121721;
    --tint-accent: #171a2e;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "ss01" 0;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--accent); }

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

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--ink);
  color: var(--on-ink);
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip:focus { top: 0.75rem; color: var(--on-ink); }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}
.site-nav a { text-decoration: none; color: var(--muted); padding: 0.35rem 0; display: inline-block; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0;
}
h1 { font-size: clamp(2.4rem, 6vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1rem; max-width: var(--measure); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.85rem; }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}
.hero .role {
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  color: var(--accent);
  margin: 0.75rem 0 1.25rem;
}
.hero .lede { font-size: 1.15rem; color: var(--ink); }
.hero .portrait {
  width: min(240px, 60vw);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--rule);
}
.availability {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 1.5rem 0 0;
  padding-left: 0.9rem;
  border-left: 2px solid var(--accent);
  max-width: none;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 1rem; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.98rem;
  text-decoration: none;
  line-height: 1.2;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-secondary { background: transparent; color: var(--ink); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.social { display: flex; gap: 1.25rem; font-size: 0.95rem; margin: 0; }

@media (min-width: 760px) {
  .hero-grid { grid-template-columns: 1fr 240px; gap: 3.5rem; }
}

/* ---------- Sections ---------- */
section { padding: clamp(2.5rem, 6vw, 4.25rem) 0; border-top: 1px solid var(--rule); }
.section-head { margin-bottom: 2rem; }
.section-head p { color: var(--muted); margin-top: 0.75rem; }

/* Section bands */
#elvyn { background: var(--tint-accent); }
#skills, #about { background: var(--tint); }

/* ---------- Flagship ---------- */
.flagship {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
.logo-frame {
  background: #f6f8fb;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-frame img { width: min(100%, 360px); }
.status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}
.flagship h3 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin-bottom: 0.75rem; }
.points { margin: 1.25rem 0; padding-left: 1.1rem; max-width: var(--measure); }
.points li { margin-bottom: 0.6rem; padding-left: 0.2rem; }
.points li::marker { color: var(--accent); }
.stack { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); max-width: var(--measure); }

@media (min-width: 860px) {
  .flagship { grid-template-columns: 340px 1fr; gap: 3rem; align-items: start; }
}

/* ---------- Featured project: RepoRescue ---------- */
.showcase { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.showcase h3 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin-bottom: 0.75rem; }
.fact-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  align-self: start;
}
.fact-card div { padding: 0.8rem 0; border-top: 1px solid var(--rule); }
.fact-card div:first-child { border-top: 0; }
.fact-card dt { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.fact-card dd { margin: 0.2rem 0 0; }
.showcase-figure { margin-top: 2.5rem; }
.shot-main { margin: 2.5rem 0 0; }
.shot-main img, .shots img { border: 1px solid var(--rule); border-radius: 8px; width: 100%; }
.shots { display: grid; gap: 0 2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .shots { grid-template-columns: 1fr 1fr; align-items: start; } }
@media (min-width: 860px) {
  .showcase { grid-template-columns: 1.6fr 1fr; gap: 3rem; align-items: start; }
}

/* ---------- Elvyn app screenshots ---------- */
.phones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 260px));
  justify-content: center;
  gap: 2.5rem;
  margin: 2.5rem 0 0;
  padding: 2.25rem 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
}
.phones figure { margin: 0; }
.bezel {
  background: #0b0d14;
  padding: 7px;
  border-radius: 34px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.22), 0 2px 6px rgba(15, 23, 42, 0.18);
}
.phones img { width: 100%; height: auto; border-radius: 27px; border: 0; }
.phones figcaption { font-size: 0.9rem; color: var(--muted); margin: 1.1rem auto 0; text-align: center; max-width: 24ch; }
.swipe-hint { display: none; }
.article .phones { background: var(--tint-accent); margin: 2rem 0 0; }

@media (max-width: 699px) {
  /* Keep the same three-across arrangement as on wide screens, scaled down. */
  .phones {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    padding: 1.25rem 0.8rem 1rem;
    border-radius: 12px;
  }
  .bezel { padding: 4px; border-radius: 18px; box-shadow: 0 8px 16px rgba(15, 23, 42, 0.2); }
  .phones img { border-radius: 14px; }
  /* Under each phone show just its title; the longer caption is for wide screens. */
  .phones figcaption { font-size: 0; margin-top: 0.7rem; max-width: none; }
  .phones figcaption strong { font-size: 0.72rem; font-weight: 600; color: var(--ink); display: block; }
  .swipe-hint { display: none; }
}
@media (min-width: 860px) {
  .flagship .logo-frame { position: sticky; top: 1.5rem; }
}

/* ---------- Secondary work ---------- */
.work-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
.work-item { border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.work-item img { border: 1px solid var(--rule); border-radius: 8px; margin-bottom: 1.1rem; }
.work-item h3 { margin-bottom: 0.5rem; }
.work-item .links { margin-top: 0.75rem; font-size: 0.95rem; }
.more { margin-top: 2rem; color: var(--muted); }
@media (min-width: 860px) { .work-grid { grid-template-columns: 1fr 1fr; gap: 3rem; } }

/* ---------- Skills ---------- */
.skills { display: grid; gap: 0; margin: 0; }
.skills div { display: grid; gap: 0.15rem 2rem; grid-template-columns: 1fr; padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.skills div:first-child { border-top: 0; padding-top: 0; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--muted); }
@media (min-width: 760px) { .skills div { grid-template-columns: 220px 1fr; } }

/* ---------- Experience ---------- */
.role-list { list-style: none; margin: 0; padding: 0; }
.role-list > li { padding: 1.4rem 0; border-top: 1px solid var(--rule); display: grid; gap: 0.35rem 2rem; grid-template-columns: 1fr; }
.role-list > li:first-child { border-top: 0; padding-top: 0; }
.role-list .when { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.role-list h3 { font-size: 1.15rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
.role-list ul { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--ink); max-width: var(--measure); }
.role-list ul li { margin-bottom: 0.35rem; }
.role-list ul li::marker { color: var(--accent); }
.role-list .note { color: var(--muted); font-size: 0.95rem; margin: 0.15rem 0 0; }
@media (min-width: 760px) { .role-list > li { grid-template-columns: 220px 1fr; } }

/* ---------- About / contact ---------- */
.two-col { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1.4fr 1fr; gap: 4rem; } }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 0.35rem 0; }
.contact-list { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 0.5rem; }
.contact-list span { display: inline-block; min-width: 5.5rem; color: var(--muted); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 1.75rem 0 2.5rem; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.site-footer p { margin: 0; max-width: none; }

/* ---------- Case study ---------- */
.article { padding: clamp(2rem, 5vw, 3.5rem) 0 3rem; }
.article .wrap { max-width: 820px; }
.article h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1rem; }
.article h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 3rem 0 1rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.article h3 { font-size: 1.1rem; font-family: var(--sans); font-weight: 600; margin: 1.75rem 0 0.5rem; letter-spacing: 0; }
.article ul, .article ol { max-width: var(--measure); padding-left: 1.25rem; }
.article li { margin-bottom: 0.45rem; }
.article li::marker { color: var(--accent); }
.back { font-size: 0.92rem; display: inline-block; margin-bottom: 1.25rem; }
.facts { display: grid; grid-template-columns: 1fr; gap: 0.5rem 2rem; margin: 1.5rem 0 0; padding: 1rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; }
.facts dt { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding-top: 0.2rem; }
.facts dd { margin: 0; }
.callout {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  max-width: var(--measure);
}
.callout p:last-child { margin-bottom: 0; }
figure { margin: 1.75rem 0; }
figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.6rem; max-width: var(--measure); }
.diagram { width: 100%; height: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; }
.diagram text { font-family: var(--sans); fill: var(--ink); font-size: 14px; }
.diagram .sub { fill: var(--muted); font-size: 12px; }
.diagram .box { fill: var(--bg); stroke: var(--muted); stroke-width: 1.25; }
.diagram .box-accent { fill: var(--bg); stroke: var(--accent); stroke-width: 1.75; }
.diagram .line { stroke: var(--muted); stroke-width: 1.25; fill: none; }
.diagram .head { fill: var(--muted); }
pre {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 0;
}
code { font-family: var(--mono); font-size: 0.9em; }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table.compare { border-collapse: collapse; width: 100%; font-size: 0.95rem; min-width: 520px; }
table.compare th, table.compare td { text-align: left; padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.compare th { font-weight: 600; }

/* ---------- Motion ---------- */
a, .btn { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .skip, .actions { display: none; }
  body { background: #fff; color: #000; }
}


/* ---------- Case study: summary and responsive diagram ---------- */
.glance {
  background: var(--tint-accent);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 1.25rem 1.4rem 1.1rem;
  margin: 2rem 0 0;
}
.glance .eyebrow { margin-bottom: 0.9rem; }
.glance ul { list-style: none; margin: 0; padding: 0; max-width: none; display: grid; gap: 0.9rem; }
.glance li { margin: 0; }
.glance a { display: block; text-decoration: none; color: var(--ink); line-height: 1.5; }
.glance a strong { color: var(--accent); display: block; }
.glance a:hover strong { text-decoration: underline; }

.flow-list { display: none; margin: 0; padding-left: 1.25rem; }
.flow-list li { margin-bottom: 0.7rem; }
.diagram-svg { display: block; }
@media (max-width: 719px) {
  .diagram-svg { display: none; }
  .flow-list { display: block; }
  .glance { padding: 1.1rem 1.1rem 1rem; }
  .facts div { grid-template-columns: 1fr; gap: 0.1rem; }
  .site-nav a { padding: 0.55rem 0; }
  .btn { padding: 0.85rem 1.1rem; }
  .actions .btn { flex: 1 1 auto; text-align: center; }
  .article h2 { margin-top: 2.25rem; padding-top: 1.5rem; }
}
.btn { padding: 0.8rem 1.15rem; }


/* ---------- Motion and polish ---------- */
/* Cross-page fade between the portfolio and the case study (Chromium). */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* Scroll reveal. The .js class is only set when motion is allowed and
   JavaScript runs, so nothing is ever hidden without it. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0ms);
}
.js .reveal.in { opacity: 1; transform: none; }

/* Hero entrance (CSS only). */
@media (prefers-reduced-motion: no-preference) {
  .hero-grid > div > * { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-grid > div > :nth-child(1) { animation-delay: 0.05s; }
  .hero-grid > div > :nth-child(2) { animation-delay: 0.15s; }
  .hero-grid > div > :nth-child(3) { animation-delay: 0.25s; }
  .hero-grid > div > :nth-child(4) { animation-delay: 0.35s; }
  .hero-grid > div > :nth-child(5) { animation-delay: 0.45s; }
  .hero-grid > div > :nth-child(6) { animation-delay: 0.55s; }
  .hero .portrait { animation: pop 0.9s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.94); } to { opacity: 1; transform: none; } }

/* Sticky header with a soft blur on wider screens. */
.site-header.scrolled { box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08); }
@media (min-width: 760px) {
  html { scroll-padding-top: 4.5rem; }
  .site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    transition: box-shadow 0.25s ease;
  }
}

/* Scroll progress bar. */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 30;
  pointer-events: none;
}

/* Nav underline that grows in, and marks the current section. */
.site-nav a { position: relative; }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.site-nav a:hover::after, .site-nav a.active::after { transform: scaleX(1); }
.site-nav a.active { color: var(--ink); }

/* Buttons lift on hover. */
.btn {
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease,
              transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(67, 56, 202, 0.2); }
.btn:active { transform: translateY(0); box-shadow: none; }

/* Phones and cards respond to hover (pointer devices only). */
.bezel { transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease; }
.work-item, .fact-card, .logo-frame { transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease; }
@media (hover: hover) {
  .phones figure:hover .bezel {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 26px 46px rgba(15, 23, 42, 0.28), 0 4px 10px rgba(15, 23, 42, 0.18);
  }
  .work-item:hover { border-top-color: var(--accent); }
  .fact-card:hover { box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08); }
}


/* ---------- Experience badge (hero) ---------- */
.exp-badge {
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.98rem;
  color: var(--muted);
  max-width: none;
}
.exp-badge strong { color: var(--accent); font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .hero-grid > div > :nth-child(7) { animation-delay: 0.65s; }
}
