/* Design tokens — variant D v3: minimal layout × sketchbook style */
:root {
  --paper: #FAF8F3;
  --ink: #2B2B2B;
  --muted: rgba(43, 43, 43, .58);
  --blue: #2563EB;
  --rust: #C04A1A;
  --green: #1E7A4D;
  --line: #E4E0D6;
  --container: 1200px;
  --pad-x: 32px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Nunito', -apple-system, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- nav ---- */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px var(--pad-x);
}
nav .logo {
  font-family: 'Caveat', cursive;
  font-size: 27px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
nav .logo .dot { color: var(--rust); }
nav .links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  margin-left: 24px;
  border-bottom: 2px solid transparent;
  padding-bottom: 1px;
}
nav .links a:hover { color: var(--ink); border-bottom-color: var(--rust); }
nav .links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--rust); }
nav .right { display: flex; align-items: center; gap: 18px; }
nav .links { display: flex; align-items: center; gap: 22px; }
nav .links a { margin-left: 0; }

/* contact dropdown */
.dd { position: relative; display: inline-block; }
.dd summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  border-bottom: 2px solid transparent;
  padding-bottom: 1px;
}
.dd summary::-webkit-details-marker { display: none; }
.dd summary::after { content: " ▾"; font-size: 11px; }
.dd:hover summary, .dd[open] summary { color: var(--ink); border-bottom-color: var(--rust); }
.dd-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 rgba(43, 43, 43, .15);
  min-width: 150px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.dd-menu a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 8px;
  margin: 0 !important;
  border-bottom: none !important;
}
.dd-menu a:hover { background: var(--paper); color: var(--rust); }

/* language toggle */
#langBtn {
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 6px 14px;
  box-shadow: 3px 3px 0 rgba(43, 43, 43, .18);
  transition: transform .1s;
}
#langBtn:hover { transform: translate(-1px, -1px); }

/* ---- hero ---- */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px var(--pad-x) 48px;
}
.hero .kicker {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--green);
  border: 1.5px solid var(--green);
  border-radius: 12px;
  padding: 3px 12px;
  margin-bottom: 18px;
}
.hero h1 {
  font-family: 'Caveat', cursive;
  font-size: clamp(44px, 7vw, 76px);
  font-weight: 700;
  line-height: 1.02;
  margin: 0;
}
.hero h1 .hl { position: relative; white-space: nowrap; }
.hero h1 .hl::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px; bottom: .12em;
  height: .18em;
  background: rgba(37, 99, 235, .22);
  z-index: -1;
  transform: rotate(-1deg);
}
.hero p.tag {
  font-size: 16.5px;
  color: var(--muted);
  line-height: 1.65;
  margin: 18px 0 26px;
  max-width: 540px;
}
.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 14.5px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 10px 22px;
  box-shadow: 3px 3px 0 rgba(43, 43, 43, .2);
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 rgba(43, 43, 43, .25); }
.btn.rust { background: var(--rust); }

/* ---- squiggle divider ---- */
.squiggle {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  line-height: 0;
}
.squiggle svg { width: 100%; height: 14px; }
.squiggle path {
  stroke: var(--ink);
  stroke-opacity: .28;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

/* ---- section labels ---- */
.label {
  max-width: var(--container);
  margin: 0 auto;
  padding: 38px var(--pad-x) 16px;
  font-family: 'Caveat', cursive;
  font-size: 34px;
  font-weight: 700;
}
.label .count {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--rust);
  vertical-align: 8px;
  margin-left: 6px;
}

/* ---- project cards ---- */
.card-wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x) 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 26px;
}
.card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 26px 28px;
  box-shadow: 4px 4px 0 rgba(43, 43, 43, .12);
  transition: transform .1s, box-shadow .1s;
}
.card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(43, 43, 43, .16); }
.card .thumb {
  display: block;
  width: 100%;
  height: auto;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  margin-bottom: 14px;
}
.card .tags { margin-bottom: 13px; }
.tag-pill {
  display: inline-block;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 800;
  margin: 0 6px 6px 0;
}
.tag-pill.c0 { background: var(--green); color: #fff; }
.tag-pill.c1 { background: var(--rust); color: #fff; }
.tag-pill.c2 { background: var(--paper); color: var(--ink); }
.card.nolink { cursor: default; }
.card.nolink:hover { transform: none; box-shadow: 4px 4px 0 rgba(43, 43, 43, .12); }
.card .go.wip { color: var(--rust); }
.card h3 { font-family: 'Caveat', cursive; font-size: 34px; margin: 0 0 6px; }
.card .year { font-size: 12.5px; font-weight: 800; color: var(--muted); margin-left: 8px; }
.card p { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 0 0 15px; }
.card .go { font-weight: 800; font-size: 14px; color: var(--blue); }

/* ---- about ---- */
.about {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x) 60px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
}
.about p { font-size: 15.5px; line-height: 1.75; color: var(--ink); margin: 0 0 14px; max-width: 600px; }
.about p a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid rgba(37, 99, 235, .25);
}
.about p a:hover { border-bottom-color: var(--blue); }
.about .now {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 22px 26px;
  box-shadow: 4px 4px 0 rgba(43, 43, 43, .12);
  align-self: start;
}
.about .now h4 { font-family: 'Caveat', cursive; font-size: 26px; margin: 0 0 10px; }
.about .now ul { margin: 0; padding-left: 18px; }
.about .now li { font-size: 14px; line-height: 1.7; color: var(--muted); }

/* ---- contact ---- */
.contact {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x) 80px;
}
.contact p { font-size: 15.5px; color: var(--muted); margin: 0 0 22px; max-width: 540px; line-height: 1.65; }
.contact .row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.contact a.plain {
  color: var(--ink);
  font-weight: 800;
  font-size: 14.5px;
  text-decoration: none;
  border-bottom: 2px solid var(--line);
  padding-bottom: 2px;
}
.contact a.plain:hover { border-bottom-color: var(--rust); }

/* ---- footer ---- */
footer {
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
footer .inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 26px var(--pad-x);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
footer .inner .heart { color: var(--rust); }

/* ---- hobbies grid (landing) ---- */
.hobby-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x) 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.hobby {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 4px 4px 0 rgba(43, 43, 43, .12);
}
.hobby h3 { font-family: 'Caveat', cursive; font-size: 28px; margin: 0 0 6px; }
.hobby p { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0; }

/* ---- intro section (landing) ---- */
.intro {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x) 50px;
}
.intro p { font-size: 15.5px; line-height: 1.75; color: var(--ink); margin: 0 0 14px; max-width: 640px; }

/* ---- resume stub ---- */
.stub {
  max-width: var(--container);
  margin: 0 auto;
  padding: 120px var(--pad-x) 140px;
  text-align: center;
}
.stub h1 { font-family: 'Caveat', cursive; font-size: clamp(44px, 6vw, 64px); margin: 0 0 10px; }
.stub p { font-size: 16px; color: var(--muted); margin: 0; }

/* ---- hero 2-col + decoration ---- */
.hero-2col {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 40px;
  align-items: center;
}
.hero-2col h1 { font-size: clamp(40px, 5vw, 62px); }
.hero-visual { position: relative; min-height: 340px; }

.polaroid {
  position: relative;
  width: 230px;
  margin: 0 auto;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 5px 5px 0 rgba(43, 43, 43, .14);
  padding: 12px 12px 10px;
  transform: rotate(3deg);
  transition: transform .2s;
}
.polaroid:hover { transform: rotate(1deg) scale(1.02); }
.polaroid .tape {
  position: absolute;
  top: -12px; left: 50%;
  width: 70px; height: 22px;
  transform: translateX(-50%) rotate(-4deg);
  background: rgba(37, 99, 235, .18);
  border: 1px solid rgba(37, 99, 235, .25);
}
.photo-slot {
  height: 200px;
  background: var(--paper);
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  overflow: hidden;
}
.photo-slot .photo-doodle { width: 90px; height: 90px; }
.polaroid img { display: block; width: 100%; height: 200px; object-fit: cover; }
.polaroid figcaption {
  font-family: 'Caveat', cursive;
  font-size: 19px;
  text-align: center;
  padding-top: 8px;
  color: var(--muted);
}

.doodle { position: absolute; color: var(--ink); opacity: .55; }
.d-arrow { width: 90px; left: -14px; bottom: 30px; transform: rotate(20deg); color: var(--rust); }
.d-star { width: 26px; color: var(--blue); }
.d-star.s1 { top: 8px; right: 24px; }
.d-star.s2 { width: 17px; top: 54px; right: 62px; color: var(--green); }
.d-shuttle { width: 50px; right: -6px; bottom: 12px; cursor: pointer; opacity: .65; }
.d-shuttle:hover { color: var(--rust); opacity: 1; }
.d-shuttle.bounce { animation: shuttle-bounce .6s ease; }
@keyframes shuttle-bounce {
  0% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-26px) rotate(-24deg); }
  70% { transform: translateY(0) rotate(6deg); }
  100% { transform: translateY(0) rotate(0); }
}

/* gentle float loops */
@keyframes float-a { 0%,100% { transform: rotate(20deg) translateY(0); } 50% { transform: rotate(22deg) translateY(-6px); } }
@keyframes float-b { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes float-c { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-4px) scale(1.12); } }
.float-a { animation: float-a 5s ease-in-out infinite; }
.float-b { animation: float-b 4s ease-in-out infinite; }
.float-c { animation: float-c 3.2s ease-in-out infinite; }

/* hobby icons */
.hobby-icon { width: 44px; height: 44px; margin-bottom: 8px; }
.hobby { transition: transform .12s, box-shadow .12s; }
.hobby:hover { transform: translate(-2px, -2px) rotate(-.4deg); box-shadow: 6px 6px 0 rgba(43, 43, 43, .16); }

/* ---- entrance animations ---- */
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.rise { opacity: 0; animation: rise-in .55s ease forwards; }
.rise.r1 { animation-delay: .05s; }
.rise.r2 { animation-delay: .15s; }
.rise.r3 { animation-delay: .3s; }
.rise.r4 { animation-delay: .45s; }

/* scroll reveal (decor.js adds .in) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* squiggle draws itself */
.squiggle path {
  stroke-dasharray: 760;
  stroke-dashoffset: 760;
  animation: draw 1.4s ease-out .5s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---- hobby timeline pages ---- */
.tl-hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 56px var(--pad-x) 30px;
  text-align: center;
}
.tl-hero h1 { font-family: 'Caveat', cursive; font-size: clamp(48px, 6vw, 68px); margin: 0 0 8px; }
.tl-hero p { font-size: 16.5px; color: var(--muted); margin: 0 0 18px; }
.tl-hero .hint {
  display: inline-block;
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: var(--rust);
  animation: float-b 2.4s ease-in-out infinite;
}

.tl {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 30px var(--pad-x) 40px;
}
.tl-track {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  background: var(--line);
  border-radius: 2px;
}
.tl-line {
  width: 100%;
  height: 0%;
  background: var(--ink);
  border-radius: 2px;
  transition: height .15s linear;
}
.tl-item {
  position: relative;
  width: 50%;
  padding: 18px 44px 26px;
}
.tl-item.left { left: 0; text-align: right; }
.tl-item.right { left: 50%; text-align: left; }
.tl-badge {
  position: absolute;
  top: 26px;
  font-family: 'Caveat', cursive;
  font-size: 21px;
  font-weight: 700;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50px;
  padding: 2px 14px;
  white-space: nowrap;
  z-index: 2;
  box-shadow: 2px 2px 0 rgba(43, 43, 43, .15);
}
.tl-item.left .tl-badge { right: -2px; transform: translateX(50%); }
.tl-item.right .tl-badge { left: -2px; transform: translateX(-50%); }
.tl-card {
  display: inline-block;
  text-align: left;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 4px 4px 0 rgba(43, 43, 43, .12);
  max-width: 340px;
}
.tl-card h3 { font-family: 'Caveat', cursive; font-size: 27px; margin: 0 0 6px; }
.tl-card p { font-size: 14px; line-height: 1.65; color: var(--muted); margin: 0 0 12px; }
.tl-photo {
  margin: 0 0 4px;
  background: var(--paper);
  border: 2px dashed var(--line);
  border-radius: 8px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tl-photo span { font-family: 'Caveat', cursive; font-size: 18px; color: var(--muted); }
.tl-photo img { display: block; width: 100%; border-radius: 6px; }
.tl-photo:not(.empty) { border: 2px solid var(--ink); padding: 6px; background: #fff; }

.tl-stat { margin-top: 10px; }
.tl-stat-label { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.tl-bar {
  margin-top: 5px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.tl-fill {
  height: 100%;
  background: var(--green);
  border-radius: 6px 0 0 6px;
}

/* milestone reveal: slide in from its side */
.tl-reveal { opacity: 0; transition: opacity .5s ease, transform .5s ease; }
.tl-item.left.tl-reveal { transform: translateX(-22px); }
.tl-item.right.tl-reveal { transform: translateX(22px); }
.tl-reveal.in { opacity: 1; transform: translateX(0); }

.tl-end {
  text-align: center;
  font-family: 'Caveat', cursive;
  font-size: 24px;
  color: var(--muted);
  padding: 10px var(--pad-x) 30px;
}
.tl-back { text-align: center; padding: 0 var(--pad-x) 70px; }
.tl-back a { color: var(--blue); font-weight: 800; font-size: 15px; text-decoration: none; }
.tl-back a:hover { border-bottom: 2px solid var(--blue); }

/* hobby cards on landing are now links */
a.hobby { display: block; text-decoration: none; color: var(--ink); }
.hobby .go { font-weight: 800; font-size: 13.5px; color: var(--blue); display: inline-block; margin-top: 10px; }

@media (max-width: 700px) {
  /* single column: line moves to the left edge */
  .tl-track { left: 18px; transform: none; }
  .tl-item, .tl-item.right { width: 100%; left: 0; text-align: left; padding: 14px 0 22px 52px; }
  .tl-item.left { text-align: left; }
  .tl-item.left .tl-badge, .tl-item.right .tl-badge { left: 18px; right: auto; transform: translateX(-50%); }
  .tl-card { max-width: none; display: block; }
}

/* accessibility: kill all motion on request */
@media (prefers-reduced-motion: reduce) {
  .rise, .reveal { opacity: 1; transform: none; animation: none; transition: none; }
  .float-a, .float-b, .float-c, .d-shuttle.bounce { animation: none; }
  .squiggle path { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
  .tl-reveal { opacity: 1; transform: none; transition: none; }
  .tl-line { transition: none; }
  .tl-hero .hint { animation: none; }
}

/* ---- responsive ---- */
@media (max-width: 760px) {
  :root { --pad-x: 22px; }
  nav .links { gap: 14px; }
  nav .links a { font-size: 13px; }
  .hero { padding-top: 44px; }
  .about { grid-template-columns: 1fr; gap: 28px; }
  .hero-2col { grid-template-columns: 1fr; gap: 28px; }
  .hero-visual { min-height: 300px; }
}
