/* ---------------------------------------------
   Elijah-Justin Leano — Portfolio
   Warm editorial system: cream field, ink text,
   mono labels, gold accent, rust for friction.
--------------------------------------------- */

:root {
  --ink: #1f1a14;
  --ink-soft: #5d5246;
  --ink-faint: #736648;
  --ink-mute: #6e6253;
  --paper: #f0ece0;
  --paper-dim: #e9e3d5;
  --panel: #ece7d8;
  --line: #d6cdb7;
  --line-soft: #e0d8c4;
  --gold: #9a875c;
  --rust: #a8553a;
  --cream-text: #f5f1e6;
  --max-w: 1184px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; text-decoration: none; }

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

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

/* ---------- mono label utility ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- nav (Jose Ocando-style morphing pill) ---------- */
.nav { position: sticky; top: 0; z-index: 50; padding: 28px 0; }

.nav-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1200px, calc(100% - 80px));
  height: 56px;
  margin: 0 auto;
  padding: 0 56px;
}

/* the pill background IS the indicator: full width at rest, shrinks to wrap
   the hovered item, expands back on mouse-leave */
.nav-indicator {
  position: absolute;
  top: 6px;
  left: 0;
  width: 100%;
  height: 44px;
  border-radius: 999px;
  background: #e8e1ce;
  z-index: 0;
  pointer-events: none;
  transition: transform 0.45s var(--ease-out), width 0.45s var(--ease-out);
}

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.3s var(--ease-out);
  white-space: nowrap;
}

.nav-item.is-active { color: var(--ink); }
.nav-item.is-hot { color: var(--ink); }

.nav-home { padding: 0 18px; }
.nav-home .ico { display: block; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* static label — only the pill indicator moves, the text stays still */
.nav-flip { display: inline-block; height: 14px; line-height: 14px; }
.nav-flip > span:nth-child(2) { display: none; }

@media (prefers-reduced-motion: reduce) {
  .nav-indicator { transition: none; }
}

/* ---------- home hero ---------- */
.hero { padding: 100px 0 140px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(34px, 4.4vw, 48px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero .intro {
  margin-top: 26px;
  max-width: 600px;
  color: var(--ink-soft);
}

.hero .actions { margin-top: 38px; display: flex; gap: 16px; flex-wrap: wrap; }

.hero-photo {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  object-fit: cover;
  justify-self: end;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px 28px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background 0.25s, color 0.25s, transform 0.25s var(--ease-out);
}

.btn:hover { transform: translateY(-2px); }

.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: #000; }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- section scaffolding ---------- */
.section { padding: 64px 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-bottom: 48px;
}

.section-head .mono { color: var(--ink-mute); }
.section-head .count { color: var(--ink-faint); }

/* ---------- work cards ---------- */
.work-list { display: flex; flex-direction: column; gap: 56px; }

.work-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.work-card:nth-child(even) .work-media { order: 2; }

.work-media {
  background: transparent;
  border-radius: 12px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.work-card:hover .work-media img { transform: scale(1.03); }

.work-info .tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
}

.work-info h3 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.work-info p {
  margin-top: 14px;
  color: var(--ink-soft);
  max-width: 480px;
}

.text-link {
  display: inline-block;
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 3px;
  transition: opacity 0.25s;
}

.text-link:hover { opacity: 0.55; }

.text-link .arrow { display: inline-block; transition: transform 0.3s var(--ease-out); }
.text-link:hover .arrow { transform: translateX(5px); }

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.78fr 1fr;
  gap: 64px;
}

.about-grid h3 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.about-grid p { color: var(--ink-soft); margin-bottom: 16px; }

.skills-block + .skills-block { margin-top: 28px; }
.skills-block .mono { color: var(--ink-faint); display: block; margin-bottom: 10px; }
.skills-list { color: var(--ink-soft); font-size: 15px; line-height: 1.6; }

/* ---------- contact ---------- */
.contact { padding: 88px 0 104px; }

.contact h2 {
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 16em;
}

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 40px 0 56px; }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-id .mono { display: block; color: var(--ink); }
.footer-id .mono + .mono { color: var(--ink-faint); margin-top: 8px; }

.footer-index { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-index a { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.footer-index a:hover { color: var(--ink); }

/* ============================================
   CASE STUDY PAGES
   ============================================ */
.cs-hero { padding: 64px 0 8px; }

.cs-hero .crumb { color: var(--ink-faint); margin-bottom: 28px; display: inline-block; }
.cs-hero .crumb:hover { color: var(--ink); }

.cs-hero h1 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.16;
  max-width: 17em;
}

.cs-hero .subtitle {
  margin-top: 24px;
  max-width: 660px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.6;
}

.cs-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
  margin-top: 48px;
}

.cs-meta .mono { color: var(--ink-faint); display: block; margin-bottom: 8px; }
.cs-meta div p { font-size: 15px; color: var(--ink); line-height: 1.5; }

.cs-hero .tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

/* case-study hero image — banner shown whole (contain), blending into the
   page (the artwork PNGs share the --paper background); height: auto defeats
   the height="" attribute hint that forced a 360px box (and a sideways crop)
   on narrow screens */
.cs-hero-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1120 / 360;
  object-fit: contain;
  border-radius: 10px;
  margin-top: 40px;
}

/* tldr */
.tldr {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 36px 40px;
  max-width: 880px;
  margin: 56px 0 8px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
}

.tldr .mono { color: var(--ink-mute); padding-top: 4px; }
.tldr p { color: var(--ink); }

/* numbered sections */
.cs-section { padding: 44px 0; border-top: 1px solid var(--line); }
.cs-section:first-of-type { border-top: none; }

.cs-section-head { display: flex; gap: 28px; align-items: flex-start; margin-bottom: 28px; }

.sec-num {
  font-size: 52px;
  font-weight: 600;
  line-height: 1;
  color: var(--gold);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.sec-kicker { color: var(--ink-mute); display: block; margin-bottom: 10px; }

.cs-section h2 {
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  max-width: 20em;
}

.cs-narrow { max-width: 680px; }
.cs-narrow p { color: var(--ink-soft); margin-bottom: 18px; }
.cs-narrow p:last-child { margin-bottom: 0; }
.cs-narrow p strong { color: var(--ink); font-weight: 600; }

/* approach steps */
.steps { max-width: 680px; }
.step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line-soft);
}
.step:first-child { border-top: none; }
.step .s-num { font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); padding-top: 3px; }
.step h4 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.step p { color: var(--ink-soft); font-size: 16px; }

/* insight / impact list */
.insights { max-width: 680px; }
.insight, .outcome-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
}
.insight:first-child, .outcome-row:first-child { border-top: none; }
.insight .num { font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); padding-top: 4px; }
.insight h4 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.insight p { color: var(--ink-soft); font-size: 16px; }
.outcome-row .arrow { color: var(--gold); font-size: 18px; padding-top: 2px; }
.outcome-row h4 { font-size: 17px; font-weight: 600; margin-bottom: 5px; }
.outcome-row p { color: var(--ink-soft); font-size: 16px; }

/* note strip */
.cs-note {
  border-left: 3px solid var(--gold);
  padding: 6px 0 6px 22px;
  margin: 0 0 28px;
  max-width: 720px;
  color: var(--ink-soft);
}

/* card grid (equal heights via grid) */
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cs-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.18);
}
.cs-card .mono { color: var(--ink-faint); display: block; margin-bottom: 12px; }
.cs-card h4 { font-size: 17px; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.cs-card p { color: var(--ink-soft); font-size: 15px; }

/* pull quote */
.pullquote { border-left: 2px solid var(--ink); padding: 8px 0 8px 32px; margin: 40px 0; max-width: 720px; }
.pullquote blockquote { font-size: 21px; line-height: 1.5; font-weight: 500; letter-spacing: -0.01em; }
.pullquote cite {
  display: block; margin-top: 14px; font-style: normal;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-faint);
}

/* figure shell */
.cs-figure { margin: 36px 0 8px; }
.fig-box {
  /* --paper matches the redrawn figures' background, so they sit seamlessly */
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 34px 40px;
}
.fig-eyebrow { color: var(--ink-mute); display: block; margin-bottom: 26px; }
.fig-img { width: 100%; height: auto; display: block; border-radius: 4px; }
.cs-figure figcaption {
  margin-top: 14px;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-mute);
}

/* before / after comparison */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cmp-label { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cmp-chip {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px; color: var(--ink-mute);
}
.cmp-url { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); }
.cmp-frame {
  border-radius: 10px; background: var(--panel);
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cmp-frame img { width: 100%; height: 100%; object-fit: cover; }

/* full-bleed figure (no panel box) — used for the FIC live-vs-prototype comparison */
.cs-figure.bleed .fig-box { background: transparent; border: none; padding: 0; }
.cs-figure.bleed .compare { gap: 32px; }

/* screens row */
.screens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.screen-frame {
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper-dim);
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  margin-bottom: 12px; overflow: hidden;
}
.screen-frame img { width: 100%; height: 100%; object-fit: cover; }
.screen-cap { font-size: 14px; color: var(--ink-soft); }

/* more case studies / pagination */
.cs-more { border-top: 1px solid var(--line); padding: 48px 0 8px; }
.cs-more > .mono { color: var(--ink-mute); display: block; margin-bottom: 24px; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.more-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: transform 0.3s var(--ease-out); }
.more-card:hover { transform: translateY(-3px); }
/* --paper matches the artwork PNGs' background, so letterboxing is invisible */
.more-card .more-thumb { aspect-ratio: 16/7; background: var(--paper); border-bottom: 1px solid var(--line); overflow: hidden; }
.more-card .more-thumb img { width: 100%; height: 100%; object-fit: contain; }

/* lightbox (click-to-zoom case-study visuals) */
.zoomable { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 2vh 2vw;
  background: rgba(31, 26, 20, 0.85);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease-out), visibility 0.3s;
  cursor: zoom-out;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 100%; max-height: 96vh;
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  transform: scale(0.96);
  transition: transform 0.35s var(--ease-out);
}
.lightbox.open img { transform: scale(1); }
.lightbox-close {
  position: absolute; top: 24px; right: 30px;
  background: transparent; border: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--paper);
}

/* visible keyboard focus (no change at rest; only on keyboard focus) */
.zoomable:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}
.lightbox-close:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 3px;
}

.more-card .more-body { padding: 22px 24px 26px; }
.more-card .mono { color: var(--ink-faint); display: block; margin-bottom: 10px; }
.more-card h4 { font-size: 18px; font-weight: 600; line-height: 1.3; margin-bottom: 16px; }
.more-card .text-link { margin-top: 0; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo { width: 200px; height: 200px; justify-self: start; order: -1; }
}

@media (max-width: 860px) {
  .work-card { grid-template-columns: 1fr; gap: 24px; }
  .work-card:nth-child(even) .work-media { order: 0; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .cs-meta { grid-template-columns: repeat(2, 1fr); }
  .cards-grid, .compare, .screens, .more-grid { grid-template-columns: 1fr; }
  .tldr { grid-template-columns: 1fr; gap: 12px; }

  /* wide research figures stay legible on small screens: scroll, don't shrink */
  .fig-box { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .fig-img { min-width: 720px; }

  /* lightbox: very wide diagrams (marked .wide on open) render at readable
     height and pan horizontally instead of shrinking to fit */
  .lightbox.wide { overflow: auto; justify-content: flex-start; padding: 0; }
  .lightbox.wide img { max-width: none; max-height: 88vh; margin: auto; border-radius: 0; }
}

/* nav: progressive shrink so the pill keeps every item on one row — no
   hamburger, no horizontal scroll — down to small phones */
@media (max-width: 720px) {
  .nav { padding: 20px 0; }
  .nav-pill { width: calc(100% - 48px); height: 50px; padding: 0 28px; }
  .nav-indicator { top: 5px; height: 40px; }
  .nav-item { height: 40px; padding: 0 14px; font-size: 11px; letter-spacing: 0.06em; }
  .nav-home { padding: 0 12px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .cs-hero-img { margin-top: 28px; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
  .cs-section-head { gap: 16px; }
  .sec-num { font-size: 38px; }
  .fig-box { padding: 24px 20px; }
  .footer-inner { flex-direction: column; }
}

@media (max-width: 480px) {
  .nav { padding: 14px 0; }
  .nav-pill { width: calc(100% - 24px); height: 46px; padding: 0 6px; }
  .nav-indicator { top: 5px; height: 36px; }
  .nav-item { height: 36px; padding: 0 9px; font-size: 10.5px; letter-spacing: 0.03em; }
  .nav-home { padding: 0 9px; }
  .nav-home .ico { width: 15px; height: 15px; }
  .hero-photo { width: 120px; height: 120px; }
}

@media (max-width: 340px) {
  .nav-pill { padding: 0 4px; }
  .nav-item { padding: 0 7px; font-size: 10px; letter-spacing: 0.02em; }
  .nav-home { padding: 0 7px; }
}
