/* ============================================================
   KHALI ABDI — PORTFOLIO
   style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

:root {
  --white:      #FFFFFF;
  --bg-soft:    #FAFAFA;
  --ink:        #161116;
  --ink-muted:  #5A5560;
  --ink-faint:  #948E9C;
  --plum:       #7B3490;
  --line:       #E8E2ED;

  --serif: 'Fraunces', Georgia, serif;
  --sans:  'Plus Jakarta Sans', system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--white);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

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

/* ── NAV ─────────────────────────────────────────────────── */
#nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 32px 0;
}

#nav-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}

#nav-links {
  display: flex;
  gap: 28px;
}

#nav-toggle {
  display: none;
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}

.nav-link {
  font-size: 13px;
  color: var(--ink-muted);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
  border-color: var(--plum);
}

/* ── HERO ────────────────────────────────────────────────── */
#hero {
  max-width: 1000px;
  margin: 0 auto;
  padding: 96px 32px 88px;
}

#hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 48px;
  align-items: center;
}

#hero-headshot {
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

#hero-headshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 780px) {
  #hero-grid {
    grid-template-columns: 1fr;
  }
  #hero-headshot {
    max-width: 260px;
    order: -1;
  }
}

#hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.18;
  letter-spacing: -0.01em;
  max-width: 620px;
  margin-bottom: 28px;
}

.hero-bio {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-muted);
  max-width: 560px;
  margin-bottom: 20px;
}

.hero-bio:last-of-type {
  margin-bottom: 32px;
}

#hero-btns {
  display: flex;
  gap: 24px;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  background: var(--plum);
  padding: 11px 22px;
  border-radius: 3px;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #632875;
}

.link-quiet {
  font-size: 14px;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}

.link-quiet:hover {
  color: var(--plum);
  border-color: var(--plum);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--plum);
  border: 1px solid var(--plum);
  padding: 9px 18px;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}

.btn-outline:hover {
  background: var(--plum);
  color: var(--white);
}

/* ── WORK ────────────────────────────────────────────────── */
#work {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px 96px;
}

.work-heading {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.work-intro {
  font-size: 14px;
  color: var(--ink-muted);
  max-width: 480px;
  margin-bottom: 40px;
  line-height: 1.6;
}

.proj-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.proj-row {
  display: block;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}

.proj-row:hover .proj-title {
  color: var(--plum);
}

.proj-role {
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.proj-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 10px;
  transition: color 0.15s;
  max-width: 620px;
}

.proj-sub {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 14px;
}

.proj-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--ink-muted);
}

/* ── RESUME ──────────────────────────────────────────────── */
#resume {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px 96px;
}

.resume-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
  margin-bottom: 40px;
}

.resume-block {
  margin-bottom: 40px;
}

.resume-block-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--plum);
  margin-bottom: 20px;
}

.resume-entry {
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.resume-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.resume-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 4px;
}

.resume-role {
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 500;
  color: var(--ink);
}

.resume-org {
  font-size: 13.5px;
  color: var(--ink-muted);
}

.resume-dates {
  font-size: 12.5px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.resume-bullets {
  list-style: none;
  margin-top: 10px;
}

.resume-bullets li {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-muted);
  padding-left: 14px;
  position: relative;
  margin-bottom: 6px;
}

.resume-bullets li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--ink-faint);
}

/* ── CASE STUDY ──────────────────────────────────────────── */
#cs-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 72px 32px 48px;
}

.cs-back {
  display: inline-block;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}

.cs-back:hover {
  color: var(--plum);
  border-color: var(--plum);
}

.cs-eyebrow {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 14px;
}

.cs-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4.5vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.cs-lead {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-muted);
  max-width: 600px;
  margin-bottom: 36px;
}

.cs-meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.cs-meta-k {
  font-size: 11px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.cs-meta-v {
  font-size: 13.5px;
  color: var(--ink);
}

#cs-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px 96px;
}

.cs-section {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}

.cs-section:last-child {
  border-bottom: none;
}

.cs-section-k {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--plum);
  margin-bottom: 12px;
}

.cs-section-h {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 14px;
  max-width: 560px;
}

.cs-section-p {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-muted);
  max-width: 600px;
  margin-bottom: 14px;
}

.cs-callout {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--plum);
  max-width: 560px;
  line-height: 1.6;
  margin-top: 8px;
}

.cs-personas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.cs-persona-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
}

.cs-persona-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}

.cs-persona-role {
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.cs-persona-list {
  list-style: none;
}

.cs-persona-list li {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-muted);
  padding-left: 12px;
  position: relative;
  margin-bottom: 5px;
}

.cs-persona-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--ink-faint);
}

.cs-theme-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.cs-theme-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--line);
}

.cs-theme-table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  vertical-align: top;
}

.cs-theme-table td:first-child {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

.cs-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.cs-section-split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: center;
}

.cs-split-photo {
  aspect-ratio: 4 / 3;
}

@media (max-width: 640px) {
  .cs-section-split {
    grid-template-columns: 1fr;
  }
}

.cs-photo {
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.cs-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cs-downloads {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.cs-mockups {
  display: flex;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.device-laptop {
  width: 340px;
  max-width: 100%;
}

.device-laptop .screen {
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  border: 6px solid #2A2530;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.device-laptop .base {
  height: 10px;
  background: #3A3440;
  border-radius: 0 0 6px 6px;
}

.device-phone {
  width: 150px;
  max-width: 40%;
}

.device-phone .screen {
  aspect-ratio: 9 / 19.5;
  background: var(--bg-soft);
  border: 6px solid #2A2530;
  border-radius: 22px;
  overflow: hidden;
}

.device-laptop .screen img,
.device-phone .screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  #cs-hero {
    padding: 56px 20px 40px;
  }
  #cs-body {
    padding: 0 20px 64px;
  }
}

/* ── BEYOND WORK (photo strip) ──────────────────────────── */
#life {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px 96px;
}

#life-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-top: 24px;
  padding-bottom: 4px;
}

.life-photo {
  flex: 0 0 auto;
  width: 220px;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  scroll-snap-align: start;
}

.life-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  #life {
    padding: 0 20px 64px;
  }
  .life-photo {
    width: 160px;
  }
}

/* ── CONTACT ─────────────────────────────────────────────── */
#contact {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.contact-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 72px 32px;
}

.contact-heading {
  font-family: var(--serif);
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  max-width: 520px;
  margin-bottom: 28px;
}

.contact-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.contact-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--plum);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.15s;
}

.contact-link:hover {
  border-color: var(--plum);
}

.contact-sub {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.7;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 640px) {
  #nav {
    padding: 24px 20px 0;
  }

  #nav-toggle {
    display: block;
  }

  #nav-links {
    display: none;
    position: absolute;
    top: 60px;
    right: 20px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 12px 20px;
    flex-direction: column;
    gap: 14px;
    z-index: 10;
  }

  #nav-links.open {
    display: flex;
  }

  #hero {
    padding: 64px 20px 64px;
  }

  #work {
    padding: 0 20px 64px;
  }

  .contact-inner {
    padding: 56px 20px;
  }

  .contact-links {
    flex-direction: column;
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   LOADER (simple static puzzle grid — matches the v2 intro)
   ============================================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0F0A18;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}

#loader-pieces {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 40px);
  gap: 2px;
  margin-bottom: 32px;
}

.lp {
  border-radius: 3px;
  opacity: 0;
  animation: pieceIn 0.4s ease forwards;
}

.lp svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes pieceIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

#loader-name {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 16px;
}

#loader-bar-wrap {
  width: 80px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}

#loader-bar {
  height: 1px;
  width: 0%;
  background: var(--plum);
  transition: width 0.08s linear;
}

#loader-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: rgba(200, 154, 224, 0.7);
  opacity: 0;
  transition: opacity 0.5s ease;
}

#page-body {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#page-body.visible {
  opacity: 1;
  pointer-events: all;
}

