: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 {
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--card);
  max-width: min(92vw, 900px);
  max-height: 90vh;
  overflow: visible;
}

#lightbox::backdrop { background: rgba(20, 18, 15, 0.8); }

#lightbox img {
  display: block;
  max-width: min(92vw, 900px);
  max-height: calc(90vh - 6px);
  width: auto;
  height: auto;
  border-radius: 13px;
}

.lb-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}

/* ---------- projects ---------- */
.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);
}

/* ---------- 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; }
}

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