:root {
  --ink: #1b1b1b;
  --muted: #777;
  --line: #eee;
  --card: #fafafa;
  --hl: #ffe27a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 400 16px/1.65 "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
::selection { background: var(--hl); }

main { max-width: 640px; margin: 0 auto; padding: 0 20px; }

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0;
  font-size: 15px;
}
nav .home { font-weight: 700; text-decoration: none; }
nav div { display: flex; gap: 18px; }
nav div a { color: var(--muted); text-decoration: none; }
nav div a:hover { color: var(--ink); }

section { padding: 36px 0; }

h1 { font-size: 40px; line-height: 1.1; margin: 0 0 18px; letter-spacing: -0.02em; }
h2 { font-size: 20px; margin: 0 0 18px; letter-spacing: -0.01em; }
h3 { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
p { margin: 0 0 12px; }

/* highlighter-marker link */
.hl {
  text-decoration: none;
  font-weight: 500;
  background: linear-gradient(transparent 55%, var(--hl) 55%);
  transition: background .2s;
}
.hl:hover { background: linear-gradient(transparent 0%, var(--hl) 0%); }

/* intro */
.intro {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 36px;
  align-items: center;
  padding-top: 40px;
}
.wave { display: inline-block; transform-origin: 70% 70%; }
h1:hover .wave { animation: wave 1s ease-in-out; }
@keyframes wave {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(16deg); }
  40%, 80% { transform: rotate(-8deg); }
}
.socials { display: flex; gap: 16px; margin-top: 18px; }
.socials a {
  font-size: 14px;
  color: var(--muted);
  text-underline-offset: 3px;
}
.socials a:hover { color: var(--ink); }

.photo { position: relative; margin: 0; transform: rotate(2.5deg); }
.photo img, .photo-fallback {
  display: block;
  width: 180px;
  height: 220px;
  object-fit: cover;
  object-position: 50% 15%;
  border-radius: 6px;
  border: 8px solid #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
}
.photo-fallback {
  display: none;
  place-items: center;
  background: var(--card);
  font-size: 40px;
  font-weight: 700;
  color: #ccc;
}
.photo.empty img { display: none; }
.photo.empty .photo-fallback { display: grid; }
.scribble {
  position: absolute;
  bottom: -30px;
  left: -26px;
  font: 500 22px "Caveat", cursive;
  color: var(--muted);
  transform: rotate(-6deg);
}

/* cards */
.card {
  display: block;
  padding: 18px 20px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card p { font-size: 15px; color: #444; margin: 12px 0 0; }
a.card:hover, .grid .card:hover {
  transform: translateY(-2px);
  border-color: #ddd;
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, .2);
}
.card-top { display: flex; align-items: center; gap: 12px; }
.sub { font-size: 13px; color: var(--muted); margin: 0; }
.arrow { margin-left: auto; color: var(--muted); transition: transform .15s; }
a.card:hover .arrow { transform: translate(2px, -2px); color: var(--ink); }

.logo {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px;
  object-fit: contain;
}
.logo.letter {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.pill {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
  background: #e6f7ec;
  color: #1d8a4a;
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid .card { margin: 0; }

/* side quests */
.quests { list-style: none; padding: 0; margin: 0; }
.quests li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.quests li:last-child { border-bottom: 0; }

.contact h2 { font-size: 24px; }

footer {
  display: flex;
  justify-content: space-between;
  padding: 28px 0 48px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 600px) {
  main { padding: 0 16px; }
  nav div { gap: 12px; font-size: 14px; }
  h1 { font-size: 32px; }
  .intro { grid-template-columns: 1fr; gap: 28px; padding-top: 16px; }
  .photo { order: -1; width: max-content; }
  .photo img, .photo-fallback { width: 140px; height: 170px; }
  .scribble { left: auto; right: -70px; bottom: 10px; }
  .grid { grid-template-columns: 1fr; }
}

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