/* ─────────────────────────────────────────
   FONT — self-hosted, no third-party request
   ───────────────────────────────────────── */
@font-face {
  font-family: "Press Start 2P";
  src: url("assets/fonts/PressStart2P.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ─────────────────────────────────────────
   TOKENS
   ───────────────────────────────────────── */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f0ede6;
  --fg: #1a1a14;
  --accent: #1a7a5e;
  --accent-lt: rgba(26, 122, 94, 0.12);
  --muted: #8a8878;
  --border: rgba(26, 122, 94, 0.2);
  --dot-color: #8a8878;
  --scanlines: none;
  --toggle-fg: #8a8878;
  --toggle-border: #8a8878;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --fg: #e8e8d0;
  --accent: #58c4a0;
  --accent-lt: rgba(88, 196, 160, 0.15);
  --muted: #4a4a3a;
  --border: rgba(88, 196, 160, 0.2);
  --dot-color: transparent;
  --scanlines: block;
  /* in dark mode the toggle uses the accent color so it actually reads
     as an interactive element instead of disappearing into --muted */
  --toggle-fg: var(--accent);
  --toggle-border: var(--accent);
}

/* ─────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  line-height: 1.9;
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
  transition:
    background 0.15s,
    color 0.15s;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(
    circle,
    var(--dot-color) 1px,
    transparent 1px
  );
  background-size: 20px 20px;
  opacity: 0.18;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover,
a:focus-visible {
  text-decoration: underline;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ─────────────────────────────────────────
   SCANLINES
   ───────────────────────────────────────── */
.scanlines {
  display: var(--scanlines);
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0.18) 4px
  );
}

/* ─────────────────────────────────────────
   THEME BUTTON
   ───────────────────────────────────────── */
.theme-btn {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 20;
  background: transparent;
  border: 1px solid var(--toggle-border);
  color: var(--toggle-fg);
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition:
    border-color 0.1s,
    color 0.1s,
    box-shadow 0.1s;
}

/* extra lift in dark mode so it doesn't blend into the black bg */
[data-theme="dark"] .theme-btn {
  box-shadow: 0 0 6px var(--accent-lt);
}

.theme-btn:hover,
.theme-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

/* ─────────────────────────────────────────
   SINGLE-COLUMN LAYOUT
   ───────────────────────────────────────── */
.layout {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  place-items: center;
}

/* ─────────────────────────────────────────
   MAIN — identity
   ───────────────────────────────────────── */
.landing {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 650px);
  min-height: 100vh;
  padding: 7vh 44px;
  gap: 22px;
}

.tag {
  font-size: 7px;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.name {
  font-size: clamp(25px, 3.2vw, 40px);
  line-height: 1.45;
  text-shadow:
    3px 3px 0 var(--accent),
    6px 6px 0 var(--accent-lt);
}

.name-row,
.mobile-name-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.name-row {
  align-items: center;
  gap: 20px;
}

.profile-photo {
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  overflow: hidden;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--accent-lt);
  color: var(--accent);
  box-shadow: 4px 4px 0 var(--accent-lt);
}

.profile-photo svg {
  width: 50px;
  height: 50px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
}

.profile-photo span {
  font-size: 5px;
  letter-spacing: 0.06em;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bio {
  font-size: 11px;
  line-height: 2.1;
  max-width: 520px;
  opacity: 0.88;
}

.room-link {
  position: relative;
  min-height: 72px;
  width: fit-content;
  padding: 12px 86px 12px 18px;
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--accent);
  color: var(--accent);
  background: var(--accent-lt);
  box-shadow: 4px 4px 0 var(--accent-lt);
  font-size: 9px;
  text-decoration: none;
  animation: room-link-nudge 1.6s steps(2, end) 0.8s 2;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

.room-link-copy {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.room-link-squirtle {
  position: absolute;
  right: 10px;
  bottom: 4px;
  width: 58px;
  height: 62px;
  display: grid;
  place-items: end center;
  transition: transform 0.15s ease;
}

.room-link-squirtle::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 30px;
  height: 4px;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--fg);
  opacity: 0.12;
}

.room-link-squirtle img {
  position: relative;
  z-index: 1;
  width: 54px;
  height: 60px;
  object-fit: contain;
  image-rendering: pixelated;
  user-select: none;
}

.room-link:hover,
.room-link:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--accent-lt);
  background: var(--accent-lt);
  text-decoration: none;
}

.room-link:hover .room-link-squirtle,
.room-link:focus-visible .room-link-squirtle {
  transform: translateY(-4px) rotate(3deg) scale(1.06);
}

@keyframes room-link-nudge {
  0%, 82%, 100% { translate: 0 0; }
  88% { translate: 3px 0; }
  94% { translate: -2px 0; }
}

/* ── Introduction ── */
.about-section,
.edu-section {
  max-width: 100%;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.about-section .section-label,
.edu-section .section-label,
.mobile-about .section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--accent);
}

.about-section .section-label::after,
.edu-section .section-label::after,
.mobile-about .section-label::after {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--accent);
}

.about-copy {
  max-width: 570px;
  color: var(--fg);
  opacity: 0.9;
  font: 400 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.01em;
}

/* ── Link Block ── */
.contact-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 8px;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon {
  width: 10px;
  height: 10px;
  stroke: currentColor;
}

.divider {
  color: var(--muted);
}

.email-wrapper,
.mobile-email-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.email-text {
  color: color-mix(in srgb, var(--muted) 78%, var(--fg));
  font: 400 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.01em;
  user-select: all;
}

/* ─────────────────────────────────────────
   EDUCATION
   ───────────────────────────────────────── */
.section-label {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 0.12em;
  font-weight: normal;
  margin-bottom: 20px;
}

/* ── Education ── */
.edu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.edu-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edu-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.edu-place {
  font-size: 10px;
  color: var(--fg);
}

.edu-year {
  font-size: 7px;
  color: var(--muted);
  white-space: nowrap;
}

.edu-detail {
  color: var(--fg);
  opacity: 0.86;
  font: 400 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.01em;
}

/* ─────────────────────────────────────────
   MOBILE FALLBACK
   ───────────────────────────────────────── */
.mobile-msg {
  display: none;
  position: relative;
  z-index: 1;
  flex-direction: column;
  gap: 24px;
  padding: 10vh 8vw;
  min-height: 100vh;
}

.mobile-tag {
  font-size: 6px;
  color: var(--muted);
}
.mobile-name {
  font-size: 18px;
  line-height: 1.6;
  text-shadow:
    2px 2px 0 var(--accent),
    4px 4px 0 var(--accent-lt);
}
.mobile-bio {
  font-size: 9px;
  line-height: 2.4;
  opacity: 0.88;
}

.mobile-about {
  padding: 16px 0 18px 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── Mobile Layout Adjustments ── */
.mobile-contact-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 7px;
}

.mobile-links a {
  color: var(--accent);
}

/* ─────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────── */
@media (min-width: 768px) {
  .layout {
    display: grid;
  }
  .mobile-msg {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .layout {
    display: flex !important;
    flex-direction: column;
    align-items: center;
  }
  .mobile-msg {
    display: none !important;
  }

  .landing {
    width: 100%;
    padding: 76px 7vw 42px;
    min-height: auto;
    justify-content: flex-start;
    gap: 22px;
  }

  .name-row {
    gap: 14px;
  }

  .profile-photo {
    width: 88px;
    height: 88px;
    flex-basis: 88px;
  }

  .profile-photo svg {
    width: 42px;
    height: 42px;
  }

  .room-link {
    min-height: 64px;
    padding-right: 68px;
  }

  .room-link-squirtle {
    right: 6px;
    width: 52px;
    height: 58px;
  }

  .room-link-squirtle img {
    width: 49px;
    height: 55px;
  }
}

/* ─────────────────────────────────────────
   REDUCED MOTION
   ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html,
  body {
    transition: none;
  }

  .room-link {
    animation: none;
  }
}
