/* ============================================================
   Joy Abiola, ACA — portfolio
   Expressive redesign: calculator-tape cover, photo bubbles,
   stacking story cards. Tokens first; both themes share one system.
   ============================================================ */

:root {
  --bg: #fcfcfd;
  --band: #f4f6f5;
  --card: #ffffff;
  --border: #e4e4e7;
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #71717a;
  --accent: #1e5c46;
  --accent-hover: #174a38;
  --accent-text: #1e5c46;
  --on-accent: #ffffff;
  --deep: #0f2219;
  --brass: #c9a45c;
  --paper: #fbfaf6;

  --font-display: "Archivo", sans-serif;
  --font-body: "Spectral", serif;
  --font-hand: "Caveat", cursive;

  --max-w: 70rem;
}

[data-theme="dark"] {
  --bg: #0f1512;
  --band: #131b17;
  --card: #161d1a;
  --border: #26302b;
  --ink: #f2f4f3;
  --ink-2: #b4bdb8;
  --ink-3: #8a948f;
  --accent-text: #8fbfa8;
}

/* ---------- base ---------- */

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 200ms ease, color 200ms ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.section-title { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.section-lede { color: var(--ink-2); margin-top: 0.5rem; max-width: 52ch; }

/* ---------- nav, cover & masthead ---------- */

/* Dark atmosphere shared by the home cover and the inner-page mastheads */
.cover, .masthead {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background:
    radial-gradient(60rem 40rem at 80% 30%, #1d4a39 0%, transparent 60%),
    radial-gradient(40rem 30rem at 10% 90%, #2a2416 0%, transparent 60%),
    var(--deep);
}

.cover { min-height: max(560px, min(100svh, 900px)); display: flex; flex-direction: column; }

.nav .wrap {
  position: relative;
  z-index: 5;
  height: 4rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
}

.nav .wm { font-weight: 700; letter-spacing: 0.01em; margin-right: auto; white-space: nowrap; }
.nav .wm .mono { display: none; }
.nav a:not(.wm) { opacity: 0.8; transition: opacity 150ms ease; }
.nav a:not(.wm):hover, .nav a[aria-current="page"] { opacity: 1; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 6px; text-decoration-thickness: 2px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.theme-toggle:hover { border-color: rgba(255, 255, 255, 0.7); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.cover-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 2rem;
  align-items: center;
  padding-bottom: 3rem;
}

.cover-copy h1 {
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1.04;
  max-width: 14ch;
  margin-bottom: 1.6rem;
}

.ident {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: #bfd9cd;
  margin-bottom: 1rem;
}

.scene { position: relative; height: min(36rem, 70svh); }

/* Inner-page masthead: shorter, title + supporting line + bubbles */
.masthead-grid {
  display: grid;
  grid-template-columns: 6fr 5fr;
  gap: 2rem;
  align-items: center;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.masthead h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -0.03em; line-height: 1.04; }
.masthead .sub { color: #bfd9cd; font-family: var(--font-display); font-size: 16px; font-weight: 500; margin-top: 1rem; }
.masthead .scene { height: 18rem; }
.masthead.short .masthead-grid { grid-template-columns: 1fr; padding-top: 2rem; padding-bottom: 3.5rem; }

.pull-quote {
  margin-top: 1.75rem;
  max-width: 34ch;
  padding-left: 1.25rem;
  border-left: 2px solid var(--brass);
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  line-height: 1.4;
  color: #e6f0eb;
}

/* ---------- buttons ---------- */

/* One button style everywhere: pill + envelope chip; colours flip on dark surfaces */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.375rem 0.375rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 15px var(--font-display);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 200ms ease-out;
}

.btn .chip {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  transition: transform 250ms cubic-bezier(0.3, 1.4, 0.5, 1);
}

.btn .chip svg { width: 16px; height: 16px; }
.btn:hover { background: var(--accent-hover); }
.btn:hover .chip { transform: scale(1.08) rotate(-8deg); }

.btn.on-dark { background: #fff; color: #123b2d; }
.btn.on-dark .chip { background: var(--accent); color: #fff; }
.btn.on-dark:hover { background: #eaf2ee; }

.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--border); }
.btn.ghost .chip { background: var(--band); color: var(--accent-text); }
.btn.ghost:hover { background: var(--band); }
.btn.ghost.on-dark { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45); }
.btn.ghost.on-dark .chip { background: rgba(255, 255, 255, 0.14); color: #fff; }
.btn.ghost.on-dark:hover { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1.5px #fff; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.masthead .actions { margin-top: 1.75rem; }

/* ---------- photo bubbles & expand ---------- */

.bub {
  position: absolute;
  z-index: 4;
  padding: 0;
  overflow: hidden;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: #2b3a33;
  cursor: zoom-in;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.5);
  transition: box-shadow 200ms ease, scale 200ms ease;
}

.bub:hover { scale: 1.06; box-shadow: 0 22px 48px -10px rgba(0, 0, 0, 0.55); }
.bub img { width: 100%; height: 100%; object-fit: cover; }
.bub.face img { object-position: 50% 12%; transform: scale(1.55); transform-origin: 50% 16%; }


.zoom {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
  background: rgba(8, 14, 11, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}

.zoom.open { display: block; }
.zoom .shot { position: fixed; overflow: hidden; background: #2b3a33; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7); }
.zoom .shot img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }

.zoom figcaption {
  position: fixed;
  left: 0;
  right: 0;
  padding: 0 1.5rem;
  text-align: center;
  color: #fff;
  font: 500 15px var(--font-display);
  opacity: 0;
  transition: opacity 200ms 150ms;
}

.zoom.shown figcaption { opacity: 1; }

.zoom .x {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.cover .b1 { width: clamp(13rem, 24vw, 20rem); height: clamp(13rem, 24vw, 20rem); left: 14%; top: 10%; }
.cover .b2 { width: clamp(8rem, 13vw, 11rem); height: clamp(8rem, 13vw, 11rem); right: 2%; top: 46%; }
.cover .b3 { width: clamp(5rem, 8vw, 6.5rem); height: clamp(5rem, 8vw, 6.5rem); left: 4%; top: 70%; }
.cover .b4 { width: clamp(4.5rem, 7vw, 5.5rem); height: clamp(4.5rem, 7vw, 5.5rem); right: 10%; top: 8%; }

.masthead .b1 { width: clamp(8rem, 14vw, 11rem); height: clamp(8rem, 14vw, 11rem); right: 6%; top: 4%; }
.masthead .b2 { width: clamp(5.5rem, 9vw, 7.5rem); height: clamp(5.5rem, 9vw, 7.5rem); right: 40%; top: 38%; }
.masthead .b3 { width: clamp(3.6rem, 5.5vw, 4.6rem); height: clamp(3.6rem, 5.5vw, 4.6rem); right: 12%; top: 72%; }

/* ---------- logo strip ---------- */

.strip { position: relative; padding: 1.6rem 0; border-bottom: 1px solid var(--border); }
.logos-next { display: none; }
.logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.5rem 3rem; max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; list-style: none; }
.logos img { height: 1.8rem; width: auto; filter: grayscale(1) brightness(0) opacity(0.5); }
.logos img.crest { height: 2.1rem; filter: grayscale(1) opacity(0.6); }
.logos img[src*="coca-cola"] { height: 2.4rem; }
.logos img[src*="exxonmobil"] { height: 1.5rem; }
[data-theme="dark"] .logos img { filter: grayscale(1) brightness(0) invert(1) opacity(0.55); }
[data-theme="dark"] .logos img.crest { filter: grayscale(1) invert(1) opacity(0.6); }

/* ---------- story cards ---------- */

.story { padding: 4.5rem 0 2rem; }
.story-head { max-width: 40rem; margin: 0 auto 2.5rem; }
.story-more { max-width: 40rem; margin: 1.5rem auto 0; padding-left: 2.75rem; }

.stack { position: relative; max-width: 40rem; margin: 0 auto; padding-left: 2.75rem; }
.stack.plain { padding-left: 0; }
.rail { position: absolute; top: 0; bottom: 0; left: 0.6rem; width: 2px; background: var(--border); }

.chapter { position: relative; padding-bottom: 1.25rem; }

.card {
  position: relative;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

.chapter.now .card { background: var(--accent); border-color: var(--accent); color: #fff; }

.dot {
  position: absolute;
  top: 1.6rem;
  left: -2.75rem;
  margin-left: calc(0.6rem - 8px);
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}

.chapter.now .dot { background: var(--accent); box-shadow: 0 0 0 5px rgba(30, 92, 70, 0.18); }

.yr { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.card h3 { font-size: 1.35rem; margin: 0.35rem 0 0.2rem; }
.org { font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--accent-text); }
.card p { margin-top: 0.8rem; color: var(--ink-2); font-size: 16px; }
.card ul { margin-top: 0.8rem; padding-left: 1.1rem; color: var(--ink-2); font-size: 16px; }
.card li + li { margin-top: 0.35rem; }
.card .more { display: inline-block; margin-top: 0.9rem; font: 600 14px var(--font-display); color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

.chapter.now .yr, .chapter.now .figure span { color: #bfd9cd; }
.chapter.now .org { color: #d7e9e0; }
.chapter.now .card p, .chapter.now .card ul { color: #e6f0eb; }

.figure { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 1.1rem; font-family: var(--font-display); }
.figure b { display: block; font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figure > div { max-width: 11rem; }
.figure span { display: block; font-size: 13px; line-height: 1.35; color: var(--ink-3); margin-top: 0.2rem; }

/* ---------- polaroids ---------- */

.polaroids { display: flex; justify-content: center; margin: 1.6rem 0 0.4rem; padding-top: 0.6rem; }
.polaroids.one { justify-content: flex-start; }

.polaroid {
  position: relative;
  width: clamp(6.5rem, 30%, 9rem);
  margin: 0 -0.6rem;
  padding: 0.45rem 0.45rem 1.7rem;
  border: 0;
  background: var(--paper);
  box-shadow: 0 8px 22px -6px rgba(0, 0, 0, 0.28);
  cursor: zoom-in;
  transition: transform 250ms ease-out;
}

.polaroid img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.polaroid:nth-child(1) { transform: rotate(-6deg); }
.polaroid:nth-child(2) { transform: rotate(3deg) translateY(-0.4rem); z-index: 1; }
.polaroid:nth-child(3) { transform: rotate(-2.5deg); }
.polaroids.one .polaroid { margin: 0 0 0 0.4rem; transform: rotate(-4deg); }
.polaroid:hover { transform: rotate(0) translateY(-0.6rem) scale(1.06); z-index: 2; }

/* strip of tape holding the photo */
.polaroid::before {
  content: "";
  position: absolute;
  top: -0.55rem;
  left: 50%;
  width: 3.2rem;
  height: 1.05rem;
  margin-left: -1.6rem;
  background: rgba(230, 218, 172, 0.8);
  transform: rotate(-3deg);
}

.polaroid .cap { position: absolute; bottom: 0.2rem; left: 0; right: 0; text-align: center; font: 600 15px var(--font-hand); color: #2a2a2a; white-space: nowrap; }

/* ---------- sections ---------- */

.section { padding: 4.5rem 0; }
.section.band { background: var(--band); }
.section-head { max-width: 40rem; margin: 0 auto 2.5rem; }
.section-head.wide { max-width: none; margin: 0 0 2rem; }

.narrative { max-width: 40rem; margin: 0 auto; }
.narrative p { color: var(--ink-2); font-size: 18px; }
.narrative p:first-child { color: var(--ink); }
.narrative p + p { margin-top: 1.1rem; }

.practice { background: var(--band); padding: 4.5rem 0; margin-top: 3rem; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.pillar { border-top: 2px solid var(--accent); padding-top: 1rem; }
.pillar h3 { font-size: 1.1rem; margin-bottom: 0.6rem; }
.pillar ul { list-style: none; }
.pillar li { padding: 0.35rem 0; border-bottom: 1px solid var(--border); color: var(--ink-2); font-size: 15px; }
.pillar li:last-child { border: 0; }

/* Ledger: year column + entry, hairline rows */
.ledger { list-style: none; max-width: 40rem; margin: 0 auto; }

.ledger > li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.ledger > li:last-child { border-bottom: 1px solid var(--border); }
.ledger .when { font: 600 13px/1.9 var(--font-display); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ledger h3 { font-size: 1.02rem; }
.ledger p { color: var(--ink-2); font-size: 15.5px; margin-top: 0.2rem; }
.ledger .polaroids { justify-content: flex-start; padding-left: 0.6rem; }

/* Writing, research and press cards */
.cards { display: grid; gap: 1.25rem; max-width: 40rem; margin: 0 auto; }

.writing-card {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  transition: transform 200ms ease-out, border-color 200ms ease-out;
}

.writing-card:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.writing-card .kind { font: 600 13px var(--font-display); color: var(--accent-text); }
.writing-card h3 { font-size: clamp(1.25rem, 3vw, 1.6rem); margin: 0.4rem 0 0.6rem; max-width: 30ch; }
.writing-card p { color: var(--ink-2); }
.writing-card .meta { font: 500 13px var(--font-display); color: var(--ink-3); margin-top: 0.75rem; }
.writing-card .btn { margin-top: 1.25rem; }
.writing-card .link { display: inline-block; margin-top: 1rem; font: 600 14px var(--font-display); color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- contact ---------- */

.contact { padding: 5rem 0 3rem; text-align: center; }
.contact h2 { font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -0.03em; }
.contact p { max-width: 36ch; margin: 0.8rem auto 2rem; color: var(--ink-2); }
.contact .links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.5rem; margin-top: 2rem; font: 500 14px var(--font-display); color: var(--ink-2); }
.contact .links a:hover { color: var(--ink); }

.colophon {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font: 500 13px var(--font-display);
  color: var(--ink-3);
}

/* ---------- responsive ---------- */

@media (max-width: 48rem) {
  .nav .wrap { gap: 0.9rem; }
  .nav .wm { font-size: 13.5px; }
  .cover-grid { grid-template-columns: 1fr; align-content: center; gap: 1.5rem; padding-bottom: 2rem; }
  .cover .scene { order: -1; height: 14rem; }
  .cover .b1 { width: 11rem; height: 11rem; left: 50%; margin-left: -6.5rem; top: 0.5rem; }
  .cover .b2 { width: 6.5rem; height: 6.5rem; left: auto; right: 4%; top: 6.5rem; }
  .cover .b3 { width: 4.6rem; height: 4.6rem; left: 2%; top: 7.5rem; }
  .cover .b4 { width: 4rem; height: 4rem; right: 12%; top: 0.5rem; }
  .masthead-grid { grid-template-columns: 1fr; padding-top: 1.5rem; padding-bottom: 3rem; }
  .masthead .scene { order: -1; height: 11rem; }
  .masthead .b1 { width: 7.5rem; height: 7.5rem; right: auto; left: 0; top: 0; }
  .masthead .b2 { width: 5rem; height: 5rem; right: auto; left: 8rem; top: 3.5rem; }
  .masthead .b3 { width: 3.4rem; height: 3.4rem; right: auto; left: 13.8rem; top: 0.5rem; }
  /* Logos: one swipeable row; the fade and arrow show there is more */
  .logos { flex-wrap: nowrap; justify-content: flex-start; gap: 2.25rem; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-left: 1.25rem; scrollbar-width: none; padding-right: 4rem; -webkit-mask-image: linear-gradient(90deg, #000 75%, transparent); mask-image: linear-gradient(90deg, #000 75%, transparent); }
  .logos::-webkit-scrollbar { display: none; }
  .logos li { flex-shrink: 0; scroll-snap-align: start; }
  .strip.at-end .logos { -webkit-mask-image: none; mask-image: none; }
  .logos-next { display: grid; place-items: center; position: absolute; right: 0.75rem; top: 50%; translate: 0 -50%; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--card); color: var(--ink); cursor: pointer; }
  .logos-next svg { width: 18px; height: 18px; }
  .strip.at-end .logos-next { display: none; }
  .pillars { grid-template-columns: 1fr; }
  .stack, .story-more { padding-left: 2.25rem; }
  .dot { left: -2.25rem; }
  .ledger > li { grid-template-columns: 1fr; gap: 0.2rem; }
  .writing-card { padding: 1.35rem; }
}

@media (max-width: 26rem) {
  .nav .wrap { gap: 0.75rem; }
  .nav .wm .full { display: none; }
  .nav .wm .mono { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
