/* christianhabib.com — minimal, text-forward */

:root {
  --bg: #fdfdfc;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e5e5e2;
  --accent: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131312;
    --text: #e8e8e6;
    --muted: #9a9a97;
    --line: #2a2a28;
    --accent: #e8e8e6;
  }
}

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

html {
  font-size: 17px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.65;
  max-width: 40rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
  -webkit-font-smoothing: antialiased;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 4rem;
}

.site-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--text);
}

nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

h1 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
}

p {
  margin-bottom: 1rem;
}

p.muted {
  color: var(--muted);
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
  transition: text-decoration-color 120ms ease;
}

a:hover {
  text-decoration-color: var(--text);
}

/* Landing */
.intro {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}

/* Project list */
.project-list {
  list-style: none;
}

.project-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.project-list li:first-child {
  border-top: 1px solid var(--line);
}

.project-title {
  font-weight: 600;
  text-decoration: none;
}

.project-desc {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

/* Photo stories */
.story-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.story {
  display: block;
  text-decoration: none;
}

.story-cover,
.story-cover img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

.story-cover.placeholder {
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.story-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.story-title {
  font-weight: 600;
}

a.story:hover .story-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.story-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Photo essay */
.essay figure {
  margin: 2rem 0;
}

.essay-photo,
.essay figure img {
  width: 100%;
  border-radius: 3px;
  display: block;
}

.essay-photo.placeholder {
  aspect-ratio: 3 / 2;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.essay figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Now page */
.updated {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

ul.plain {
  list-style: none;
}

ul.plain li {
  margin-bottom: 0.75rem;
  padding-left: 1.1rem;
  position: relative;
}

ul.plain li::before {
  content: "•";
  position: absolute;
  left: 0.15rem;
  color: var(--muted);
}

/* Work timeline */
.headline {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
}

.headline .rotator {
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.timeline {
  margin-top: 2rem;
}

.timeline .row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline .row:first-child {
  border-top: 1px solid var(--line);
}

.timeline .role {
  font-weight: 600;
}

.timeline .org {
  color: var(--muted);
}

.timeline .years {
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* Journey map (About) */
.journey {
  margin: 2.5rem 0;
}

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

.journey .land {
  fill: var(--line);
  stroke: none;
  opacity: 0.55;
}

.journey .route {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
  stroke-linecap: round;
}

.journey #traveler {
  fill: var(--accent);
}

.journey .scrub {
  margin-top: 1rem;
  padding: 0 8px;
}

.journey .track {
  position: relative;
  height: 12px;
  margin-bottom: 2px;
}

.journey .tick {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--line);
  transform: translateX(-1px);
}

.journey .tick.active {
  background: var(--accent);
}

.journey .scrub input {
  display: block;
  width: calc(100% + 16px);
  margin: 0 -8px;
  accent-color: var(--accent);
  cursor: pointer;
}

.journey .ends {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  margin: 0 -8px;
}

.journey .scrub p {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  min-height: 1.4em;
}

.journey .stop circle {
  fill: var(--accent);
}

.journey .stop text {
  fill: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.journey .stop .place {
  font-weight: 600;
}

.journey .stop .note {
  fill: var(--muted);
  font-size: 11px;
}


.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 3.5rem 0 0.25rem;
}

/* Travel maps */
.mapbox {
  margin: 0.5rem 0 1.5rem;
}

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

.mapbox .region {
  fill: var(--line);
  stroke: var(--bg);
  stroke-width: 0.6;
  opacity: 0.5;
}

.mapbox .region.visited {
  fill: var(--accent);
  opacity: 0.85;
}

#worldmap .region, #usmap .region {
  cursor: pointer;
  transition: opacity 120ms ease;
}

#worldmap .region:hover, #usmap .region:hover {
  opacity: 1;
  stroke: var(--muted);
  stroke-width: 1;
}

#worldmap .hit .dot {
  fill: var(--accent);
}

#worldmap .hit .halo {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.readout {
  font-size: 0.85rem;
  min-height: 1.4em;
}

h2 .count {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

/* By the numbers */
.numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.stat-source {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--text);
}

/* Compact screens */
@media (max-width: 480px) {
  body {
    padding: 2.5rem 1.25rem 4rem;
  }

  header {
    margin-bottom: 3rem;
  }

  .headline .rotator,
  .intro {
    white-space: normal;
  }

  .timeline .years {
    margin-left: 0;
    width: 100%;
  }

  .numbers {
    grid-template-columns: 1fr 1fr;
  }
}

/* Site mark */
.site-name {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.site-name .mark {
  width: 14px;
  height: 14px;
  display: block;
  overflow: hidden;
}



/* Footer social icons */
.foot-links {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
}

.foot-links a {
  color: var(--muted);
  display: block;
}

.foot-links a:hover {
  color: var(--text);
}

.foot-links svg {
  width: 17px;
  height: 17px;
  display: block;
}

/* Item icons */
.item-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}

.project-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

h2 .item-icon {
  vertical-align: -3px;
  margin-right: 0.5rem;
  display: inline-block;
}

/* Two-tone mark: gray C, ink key */
.site-name .mark .m-c { fill: var(--muted); }
.site-name .mark .m-k { fill: var(--text); }


/* Intro overlay (restored) */
#intro-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

body.intro-playing #intro-overlay {
  display: flex;
  animation: overlay-out 0.4s ease 2.2s both;
}

#intro-mark {
  width: 76px;
  height: 76px;
  color: var(--text);
  overflow: hidden;
  will-change: transform;
}

body.intro-playing .site-name .mark {
  visibility: hidden;
}

/* Header fades in place (no translate) so the dock target
   measured mid-intro is already the mark's final position. */
body.intro-playing > header {
  opacity: 0;
  animation: force-reveal 0.6s ease 2s both;
}

body.intro-playing > main,
body.intro-playing > footer {
  opacity: 0;
  transform: translateY(8px);
  animation: force-reveal 0.6s ease 2s both;
}

body.intro-reveal > header,
body.intro-reveal > main,
body.intro-reveal > footer {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease 0.05s, transform 0.6s ease 0.05s;
}

@keyframes force-reveal {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes overlay-out {
  to { opacity: 0; visibility: hidden; }
}

/* Intro: B3 — merge, retract, dissolve, handoff, turn (tightened) */
#intro-mark .p-c { fill: var(--muted); }
#intro-mark .p-k, #intro-mark .p-bar, #intro-mark .p-ghost { fill: var(--text); }

body.intro-playing #intro-mark .p-c {
  will-change: transform;
  animation: merge-c 0.55s cubic-bezier(0.22, 1, 0.36, 1) both,
             handoff 0.4s ease 0.8s both;
}

body.intro-playing #intro-mark .p-h {
  will-change: transform;
  animation: merge-h 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.intro-playing #intro-mark .p-bar {
  transform-box: fill-box;
  transform-origin: right center;
  animation: bar-retract 0.35s cubic-bezier(0.45, 0, 0.2, 1) 0.42s both;
}

body.intro-playing #intro-mark .p-ghost {
  animation: ghost-fade 0.3s ease 0.5s both;
}

/* Cover the first-paint instant, when the clipped letters read as fragments */
body.intro-playing #intro-mark {
  animation: mark-in 0.15s ease-out both;
}

@keyframes mark-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes merge-c {
  from { transform: translateX(-30px); }
  to { transform: translateX(0); }
}

@keyframes merge-h {
  from { transform: translateX(38px); }
  to { transform: translateX(0); }
}

@keyframes bar-retract {
  from { transform: scaleX(1); }
  to { transform: scaleX(0.84375); }
}

@keyframes ghost-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes handoff {
  from { fill: var(--text); }
  to { fill: var(--muted); }
}

