:root {
  --blue: #1e90ff;
  --ink: #141a2b;
  --muted: #5b6475;
  --line: #e6e9ef;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  background: #fff;
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }

nav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  height: 100vh;
  width: min(280px, 85vw);
  padding: 5.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  background: #fff;
  box-shadow: 8px 0 40px rgba(20, 26, 43, 0.12);
  transform: translateX(-105%);
  transition: transform 0.3s ease;
}
.menu-open nav { transform: none; }
.scrim {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: rgba(20, 26, 43, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.menu-open .scrim { opacity: 1; pointer-events: auto; }
.menu-btn {
  position: fixed;
  top: 1.6rem;
  left: 1.6rem;
  z-index: 30;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 12px;
  background: var(--blue);
  cursor: pointer;
  transition: background 0.15s;
  display: grid;
  place-content: center;
  gap: 5px;
}
.menu-btn:hover { background: #1478d9; }
.menu-btn span { display: block; width: 20px; height: 2px; border-radius: 2px; background: #fff; transition: transform 0.25s, opacity 0.2s; }
.menu-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
.menu-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1.15rem; }
.avatar {
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.brand .avatar { width: 28px; height: 28px; font-size: 0.7rem; }
.links { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 500; font-size: 1.15rem; }
.links a { display: flex; align-items: center; gap: 0.3rem; padding: 0.55rem 0.75rem; border-radius: 10px; transition: background 0.15s; }
.links a:hover { background: #f3f6fb; }
.links a.active { background: #eaf4ff; color: var(--blue); }
.links a::before {
  content: "→";
  color: var(--blue);
  width: 0;
  overflow: hidden;
  transition: width 0.2s;
}
.links a.active::before, .links a:hover::before { width: 1.1em; }

.frame {
  margin: 0.75rem;
  min-height: calc(100vh - 1.5rem);
  border: 4px solid var(--blue);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
}
.frame .avatar { width: 156px; height: 156px; font-size: 3rem; margin-bottom: 2.25rem; }
h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
h1 em { font-weight: 500; }
.blue { color: var(--blue); }
h1 a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}
.tagline { margin-top: 1rem; color: var(--muted); font-size: 1.15rem; }
.icons { display: flex; gap: 2rem; margin-top: 2rem; }
.icons a { color: var(--ink); transition: color 0.15s, transform 0.15s; }
.icons a:hover { color: var(--blue); transform: translateY(-2px); }
.icons svg { width: 30px; height: 30px; }

.about { max-width: 640px; width: 100%; text-align: left; }
.about h1 { margin-bottom: 1.5rem; }
.about p { font-size: 1.2rem; line-height: 1.7; color: var(--muted); margin-bottom: 1.25rem; }
.about p strong { color: var(--ink); font-weight: 600; }
.about p a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.facts { list-style: none; margin-top: 2rem; border-top: 1px solid var(--line); }
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.1rem;
}
.facts span:first-child { color: var(--muted); }

.lemo { margin-top: auto; position: relative; display: block; width: 220px; max-width: 100%; align-self: center; }
.lemo img { width: 100%; display: block; animation: bob 3.5s ease-in-out infinite; transform-origin: bottom center; }
.lemo:hover img { animation: wiggle 0.5s ease-in-out; }
.bubble {
  position: absolute;
  bottom: 88%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  white-space: nowrap;
  background: #fff;
  border: 2px solid var(--blue);
  border-radius: 12px;
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.lemo:hover .bubble { opacity: 1; transform: translateX(-50%) translateY(0); }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes wiggle { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .lemo img { animation: none !important; } }

@media (max-width: 600px) {
  .menu-btn { top: 1.25rem; left: 1.25rem; }
  .frame { padding-top: 5rem; }
}

.activity { max-width: 820px; width: 100%; text-align: left; }
.activity h1 { margin-bottom: 2rem; }
.activity h2 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.01em; }
.projects { list-style: none; display: grid; gap: 1rem; margin-bottom: 3rem; }
.projects a {
  display: block;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.15s;
}
.projects a:hover { border-color: var(--blue); }
.projects h3 { font-size: 1.4rem; font-weight: 600; margin: 0.4rem 0 0.3rem; }
.projects .arrow { color: var(--blue); }
.projects p { color: var(--muted); font-size: 1.1rem; }
.status { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.9rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }

.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; gap: 1rem; }
.chart-head a { color: var(--muted); }
.chart-head a:hover { color: var(--blue); }
.chart-card { border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem 1.5rem; }
.total { color: var(--muted); margin-bottom: 1rem; }
.total strong { color: var(--ink); font-weight: 600; }
.chart {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  grid-template-areas: ". months" "weekdays cells";
  row-gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.months, .cells {
  display: grid;
  grid-template-columns: repeat(var(--weeks), minmax(0, 1fr));
  column-gap: 3px;
}
.months { grid-area: months; height: 1rem; }
.months span { white-space: nowrap; }
.weekdays { grid-area: weekdays; display: grid; grid-template-rows: repeat(7, 1fr); row-gap: 3px; }
.weekdays span { display: flex; align-items: center; }
.cells { grid-area: cells; grid-template-rows: repeat(7, auto); grid-auto-flow: column; row-gap: 3px; }
.cells i { aspect-ratio: 1; border-radius: 2px; }
.legend i { width: 11px; height: 11px; border-radius: 2px; }
.l0 { background: #ebedf0; }
.l1 { background: #b3dbff; }
.l2 { background: #6db8ff; }
.l3 { background: #1e90ff; }
.l4 { background: #0a5cb8; }
.legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 0.9rem; font-size: 0.75rem; color: var(--muted); }
.legend i { display: inline-block; }

.lemo-page { max-width: 880px; width: 100%; text-align: left; }
.lemo-page h1 { margin-bottom: 0.75rem; }
.lemo-page h2 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.01em; }
.lede { color: var(--muted); font-size: 1.2rem; margin-bottom: 3rem; }
.lede a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.game-stats { color: var(--muted); }

.memory { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.card {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  font: inherit;
  transition: transform 0.15s, border-color 0.15s;
}
.card:hover { border-color: var(--blue); }
.card .back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 600;
  transition: opacity 0.2s;
}
.card .front { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.card.flipped .back { opacity: 0; }
.card.matched { border-color: var(--blue); cursor: default; }
.game-end { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 1rem; }
.game-end[hidden] { display: none; }
.play-btn { font: inherit; font-weight: 600; color: #fff; background: var(--blue); border: none; border-radius: 10px; padding: 0.6rem 1.1rem; cursor: pointer; }
.play-btn:hover { background: #1478d9; }
.memory ~ .section-head { margin-top: 3rem; }

.wardrobe { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem; }
.outfit { border: 1px solid var(--line); border-radius: 14px; padding: 0.5rem 0.5rem 0.75rem; text-align: center; transition: border-color 0.15s, transform 0.15s; }
.outfit:hover { border-color: var(--blue); transform: translateY(-2px); }
.outfit img { width: 100%; height: auto; display: block; }
.outfit figcaption { font-weight: 500; margin-top: 0.25rem; }

@media (max-width: 600px) {
  .memory { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
}

.page { max-width: 680px; width: 100%; text-align: left; }
.page h1 { margin-bottom: 0.75rem; }
.page h2 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.01em; margin: 2.75rem 0 1rem; }
.page > p:not(.lede) { font-size: 1.15rem; line-height: 1.7; color: var(--muted); }
.page > p a, .facts a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.page .lede { margin-bottom: 0; line-height: 1.6; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.75rem; }
.btn {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: #1478d9; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.ghost { background: #fff; color: var(--blue); }
.btn.ghost:hover { background: #eaf4ff; }

.list { list-style: none; border-top: 1px solid var(--line); }
.list li { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.list strong { font-weight: 600; }
.list span { color: var(--muted); line-height: 1.55; }
.page .facts { margin-top: 2.75rem; }

.contact-form { display: grid; gap: 1.1rem; margin-top: 2rem; }
.contact-form label { display: grid; gap: 0.4rem; font-weight: 500; }
.contact-form input, .contact-form textarea {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px #eaf4ff; }
.contact-form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.form-status { color: var(--muted); min-height: 1.5em; }

@media (max-width: 600px) {
  .list li { grid-template-columns: 1fr; gap: 0.25rem; }
}
