:root {
  --bg: #fdf8ee;
  --card: #ffffff;
  --ink: #1d1b18;
  --muted: #6f6a60;
  --line: #e9e1d0;
  --accent: #ffcf3f;
  --accent-ink: #1d1b18;
  --mark: var(--accent);
  --pop: #2f6bff;
  --shadow: 4px 4px 0 var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17161a;
    --card: #222127;
    --ink: #f3efe6;
    --muted: #a7a196;
    --line: #34323a;
    --accent: #ffd34f;
    --pop: #7aa2ff;
    --mark: rgba(255, 211, 79, 0.38);
    --shadow: 4px 4px 0 #000;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 20px 40px;
}

/* ---------- hero ---------- */
.hero { text-align: center; }

.photo {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 28px;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  cursor: zoom-in;
  border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  background: var(--accent);
  transition: border-radius .6s ease, transform .3s ease;
}

.photo:hover img {
  border-radius: 58% 42% 45% 55% / 42% 58% 42% 58%;
  transform: rotate(-3deg);
}

.sticker {
  position: absolute;
  right: -14px;
  top: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 15px;
  padding: 4px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  transform: rotate(12deg);
  box-shadow: 2px 2px 0 var(--ink);
}

.hello {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 2.4s ease-in-out infinite;
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

h1 {
  margin: 4px 0 16px;
  font-size: clamp(38px, 9vw, 60px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h1 .muted {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.5em;
  letter-spacing: 0;
  margin-top: 4px;
}

.intro {
  max-width: 34em;
  margin: 0 auto;
  font-size: 19px;
}

mark {
  background: linear-gradient(transparent 55%, var(--mark) 55%);
  color: inherit;
  padding: 0 2px;
}

/* ---------- links ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  transition: transform .15s ease, box-shadow .15s ease;
}

.links a:hover,
.links a:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--ink);
  outline: none;
}

.links a.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.email {
  margin: 14px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.email a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

/* ---------- sections ---------- */
section { margin-top: 64px; }

h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 18px;
}

h2::before {
  content: "✦ ";
  color: var(--pop);
}

.chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips li {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 16px;
  cursor: default;
  transition: transform .2s ease, border-color .2s ease;
}

.chips li span { display: inline-block; transition: transform .3s ease; }

.chips li:hover { border-color: var(--ink); transform: rotate(-2deg); }
.chips li:nth-child(even):hover { transform: rotate(2deg); }
.chips li:hover span { transform: scale(1.3) rotate(-10deg); }

/* ---------- timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 22px;
  border-left: 2px dashed var(--line);
}

.timeline li {
  position: relative;
  padding-bottom: 28px;
}

.timeline li:last-child { padding-bottom: 0; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--ink);
}

.when {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.timeline h3 {
  margin: 2px 0 4px;
  font-size: 19px;
  line-height: 1.3;
}

.timeline p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- journey chapters ---------- */
.chapter + .chapter { margin-top: 44px; }

.chapter .year {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
}

.chapter h3 {
  margin: 10px 0 4px;
  font-size: 21px;
  line-height: 1.3;
}

.chapter > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 16px;
}

.gallery.one { grid-template-columns: minmax(0, 320px); }
.gallery.three { grid-template-columns: repeat(3, 1fr); gap: 16px; }

details.chapter {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

details.chapter + details.chapter { margin-top: 18px; }

details.chapter summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 32px;
}

details.chapter summary::-webkit-details-marker { display: none; }

details.chapter summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  transition: transform .2s ease;
}

details.chapter[open] summary::after { transform: rotate(45deg); }

details.chapter summary h3 { margin: 8px 0 2px; }

.peek {
  font-size: 14px;
  color: var(--muted);
}

details.chapter[open] .peek { display: none; }
details.chapter[open] > p { margin-top: 10px; }

/* timeline photo thumbnails */
.timeline li:has(.thumb) { padding-right: 104px; }

.thumb {
  position: absolute;
  right: 0;
  top: 0;
  width: 88px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(4deg);
  transition: transform .2s ease;
}

.thumb:hover { transform: rotate(0) scale(1.06); }

.thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

/* ---------- gallery ---------- */
.sub { margin: -10px 0 18px; font-size: 15px; color: var(--muted); }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.gallery figure {
  margin: 0;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 8px 8px 10px;
  box-shadow: var(--shadow);
  transition: transform .25s ease;
}

.gallery .tilt-l { transform: rotate(-1.5deg); }
.gallery .tilt-r { transform: rotate(1.5deg); }
.gallery figure:hover { transform: rotate(0) scale(1.03); }

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.gallery figcaption {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}

.org-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  vertical-align: -9px;
  margin-right: 8px;
}

.gallery figcaption .org-logo {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  vertical-align: -4px;
  margin-right: 6px;
}

/* ---------- lightbox ---------- */
.gallery img { cursor: zoom-in; }

#lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

#lightbox::backdrop { background: transparent; }

.lb-bg {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 15, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.lb-stage {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 72px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lb-img {
  display: block;
  max-width: min(100%, 720px);
  max-height: min(calc(100% - 48px), 72vh);
  width: auto;
  height: auto;
  border-radius: 16px;
  border: 3px solid #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.lb-cap {
  margin-top: 14px;
  color: #fff;
  font-size: 15px;
  text-align: center;
  max-width: 34em;
}

.lb-count {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.lb-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #1d1b18;
  background: var(--accent);
  color: #1d1b18;
  font-family: inherit;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  padding: 0 0 3px;
  cursor: pointer;
  box-shadow: 2px 2px 0 #1d1b18;
  transition: transform .15s ease;
}

.lb-btn:hover { transform: scale(1.08); }
.lb-close { top: 14px; right: 14px; }
.lb-prev, .lb-next { top: 50%; margin-top: -22px; font-size: 32px; }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }

#lightbox.single .lb-prev,
#lightbox.single .lb-next,
#lightbox.single .lb-count { display: none; }

@media (max-width: 480px) {
  .lb-prev, .lb-next { top: auto; bottom: 18px; margin-top: 0; }
  .lb-prev { left: calc(50% - 56px); }
  .lb-next { right: calc(50% - 56px); }
  #lightbox:not(.single) .lb-stage { padding-bottom: 84px; }
}

/* ---------- projects ---------- */
.project {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.project .when { font-size: 13px; color: var(--muted); }
.project h3 { margin: 4px 0 8px; font-size: 20px; line-height: 1.3; }
.project p { margin: 0; font-size: 16px; color: var(--muted); }
.project p a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 3px; }

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
}

.tags li {
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--line);
}

.project-link {
  display: inline-block;
  margin-top: 14px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

.soon {
  background: var(--card);
  border: 2px dashed var(--line);
  border-radius: 18px;
  padding: 20px 22px;
}

.soon p { margin: 0; font-size: 16px; color: var(--muted); }
.soon strong { color: var(--ink); }

.stack { margin: 0; font-size: 16px; }
.stack + .chips { margin-top: 16px; }
.stacks {
  margin-top: 16px;
  font-size: 15px;
}

.stacks summary {
  cursor: pointer;
  color: var(--muted);
  text-decoration: underline dotted;
  text-underline-offset: 4px;
  list-style: none;
}

.stacks summary::-webkit-details-marker { display: none; }
.stacks summary::before { content: "👀 "; }
.stacks[open] summary::before { content: "🙈 "; }
.stacks summary:hover { color: var(--ink); }

.stacks p {
  margin: 10px 0 0;
  padding: 12px 16px;
  background: var(--card);
  border: 1.5px dashed var(--line);
  border-radius: 12px;
}

.stacks + .stack.small { margin-top: 16px; }
.stack.small { margin-top: 8px; color: var(--muted); font-size: 15px; }

footer {
  margin-top: 72px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

footer p { margin: 0; }
footer p + p { margin-top: 4px; }

/* ---------- small screens ---------- */
@media (max-width: 480px) {
  body { font-size: 17px; }
  .wrap { padding: 40px 16px 32px; }
  .photo { width: 140px; height: 140px; }
  .intro { font-size: 17px; }
  section { margin-top: 52px; }
  .links a { font-size: 15px; padding: 7px 14px; }
  .chips li { font-size: 15px; }
  .timeline li:has(.thumb) { padding-right: 76px; }
  .thumb { width: 64px; }
  details.chapter { padding: 14px 14px; }
  .gallery, .gallery.three, .gallery.one {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 -16px;
    padding: 8px 16px 16px;
  }
  .gallery figure { scroll-snap-align: center; }
  details.chapter .gallery { margin: 0 -14px; padding: 8px 14px 16px; }
}

/* ---------- tabs ---------- */
.tabs {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  gap: 4px;
  width: max-content;
  margin: 16px auto 0;
  padding: 4px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
}

.tabs a {
  padding: 6px 16px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease;
}

.tabs a:hover { background: var(--line); }
.tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- story ---------- */
.story {
  margin: 0;
  font-size: 18px;
  line-height: 1.65;
}

/* ---------- link card to the photos page ---------- */
.photo-link {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px 20px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform .15s ease;
}

.photo-link:hover { transform: translate(-2px, -2px); }

.stack-pics {
  position: relative;
  flex: none;
  width: 104px;
  height: 84px;
}

.stack-pics img {
  position: absolute;
  top: 6px;
  left: 14px;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 3px solid #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform .25s ease;
}

.stack-pics img:nth-child(1) { transform: rotate(-12deg) translateX(-12px); }
.stack-pics img:nth-child(2) { transform: rotate(10deg) translateX(14px); }
.stack-pics img:nth-child(3) { transform: rotate(-2deg); }
.photo-link:hover .stack-pics img:nth-child(1) { transform: rotate(-18deg) translateX(-20px); }
.photo-link:hover .stack-pics img:nth-child(2) { transform: rotate(16deg) translateX(22px); }

.photo-link-text { font-size: 15px; color: var(--muted); line-height: 1.45; }
.photo-link-text strong { display: block; font-size: 18px; color: var(--ink); margin-bottom: 2px; }

/* ---------- photos page ---------- */
.page-head h1 { font-size: clamp(32px, 7vw, 48px); margin-bottom: 8px; }
.page-head .sub { margin: 0; }
.page-head { margin-bottom: 40px; }
.photos-page .chapter { margin-top: 48px; }
.photos-page .chapter > p { margin-bottom: 18px; }

/* ---------- wide screens: intro in a sidebar ---------- */
@media (min-width: 1024px) {
  .wrap {
    max-width: 1200px;
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    column-gap: 80px;
    padding: 72px 48px 48px;
  }

  .hero {
    grid-column: 1;
    grid-row: 1 / span 20;
    align-self: start;
    position: sticky;
    top: 56px;
    text-align: left;
  }

  .wrap > section,
  .wrap > footer { grid-column: 2; }

  .wrap.photos-page { display: block; max-width: 980px; }
  .photos-page .gallery { grid-template-columns: repeat(3, 1fr); }
  .photos-page .gallery.one { grid-template-columns: minmax(0, 360px); }

  .wrap > section:first-of-type { margin-top: 8px; }

  .photo { margin: 0 0 28px 4px; }
  .intro { margin: 0; }
  .links { justify-content: flex-start; }
  footer { text-align: left; }
}

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