@import url("https://fonts.googleapis.com/css2?family=Libertinus+Mono&display=swap");

:root {
  color-scheme: light;
  --ink: #17263d;
  --beige: #eef6ff;
  --beige-light: #dfedfc;
  --beige-card: #cbdff4;
  --beige-dark: #b8d0e9;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 112.5%;
}

body {
  margin: 0;
  font-family: "Libertinus Mono", monospace;
  line-height: 1.8;
  color: var(--ink);
  background: var(--beige);
  overflow-x: hidden;
  text-transform: lowercase;
}

.legend {
  grid-column: 3;
  justify-self: end;
  width: max-content;
  max-width: 100%;
  flex-shrink: 0;
  font-size: 0.75rem;
  line-height: 1.2;
  white-space: nowrap;
}

.legend-title { display: inline; margin: 0 0.35rem 0 0; font-weight: 700; }

.legend-list {
  display: inline-flex;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legend-item { display: flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
.legend-icon { width: 1.25rem; text-align: center; }

.openmoji {
  display: inline-block;
  width: 1.3em;
  height: 1.3em;
  margin: 0 0.04em;
  vertical-align: -0.16em;
}

.openmoji-flag {
  width: 9.75em;
  height: 9.75em;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 5;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.2rem 0.55rem;
  text-align: center;
  background: var(--beige);
  border-bottom: 2px solid var(--ink);
}

.header-content { display: contents; }

.section-nav {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.nav-button {
  padding: 0 0.25rem;
  font-size: 0.8rem;
  color: var(--ink);
  background: var(--beige-light);
  text-decoration: none;
}

.nav-button:hover,
.nav-button:focus-visible {
  opacity: 0.3;
}

h1, h2, h3 { line-height: 1.2; text-decoration: none; overflow-wrap: normal; word-break: normal; }
h1 { justify-self: start; margin: 0; font-size: 1.15rem; text-align: left; white-space: normal; overflow-wrap: anywhere; }
h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 0; min-width: 0; }
h3 { margin-bottom: 0.35rem; }
p { color: var(--ink); overflow-wrap: anywhere; }

.social-links { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; min-width: 0; margin-left: auto; text-decoration: none; }

.social-button {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.2rem;
  min-width: 2rem;
  padding: 0.25rem;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.social-button:hover,
.social-button:focus-visible {
  text-decoration: none;
}

.social-caption { max-width: 100%; font-size: 1rem; line-height: 1; text-align: center; white-space: nowrap; }

.social-button svg {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.social-button .social-emoji {
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 2.25rem;
}

.social-button .youtube-play { fill: currentColor; stroke: none; }

.profile-link { color: var(--ink); text-decoration: none; }

.education-link { color: inherit; text-decoration: none; }

.cert-link { color: inherit; text-decoration: none; }

a:hover,
a:focus-visible {
  opacity: 0.3;
}

.unrelated {
  width: min(680px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  padding: 0 1rem;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  opacity: 0.55;
}

.emoji-attribution { margin: 0 0 0.5rem; text-align: center; font-size: 0.6rem; opacity: 0.55; }

.heart-line { margin: 0 0 0.5rem; text-align: center; font-size: 0.75rem; opacity: 1; }

main {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  width: min(1400px, calc(100% - 1rem));
  margin: 0 auto 2rem;
  padding-top: 5rem;
}

main > section { grid-column: 1 / -1; }
main > #sports,
main > #weeb-stuff,
main > #other { grid-column: 1 / -1; }

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 160px);
  gap: 1.5rem;
  align-items: start;
}

.about-photo {
  width: 100%;
  max-width: 160px;
  justify-self: end;
  margin: 0;
  text-align: center;
}

.about-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.about-photo figcaption {
  margin-top: 0.35rem;
  color: var(--ink);
  opacity: 0.3;
}

section {
  scroll-margin-top: 5rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--beige-light);
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }

#sports .card-grid,
#weeb-stuff .card-grid,
#other .card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

#sports,
#weeb-stuff,
#other {
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

#sports h2,
#weeb-stuff h2,
#other h2 { font-size: 1.1rem; }

#sports .card,
#weeb-stuff .card,
#other .card { padding: 0.8rem; }

#sports .card h3,
#weeb-stuff .card h3,
#other .card h3 { font-size: 0.95rem; }

#sports .cert-list,
#weeb-stuff .cert-list,
#other .cert-list { gap: 0.2rem; margin-top: 0.5rem; }

#sports .cert-item,
#weeb-stuff .cert-item,
#other .cert-item { gap: 0.45rem; padding: 0.3rem 0; }

#sports .cert-icon,
#weeb-stuff .cert-icon,
#other .cert-icon { flex-basis: 1.4rem; }

#sports .openmoji,
#weeb-stuff .openmoji,
#other .openmoji { width: 1.5em; height: 1.5em; }

#sports .openmoji-flag,
#weeb-stuff .openmoji-flag,
#other .openmoji-flag { width: 9.75em; height: 9.75em; }

img.openmoji[src*="/1F1"],
img.openmoji[src*="/1F3F4-E0067-"] { width: 9.75em; height: 9.75em; }

#other .country-list .openmoji { width: 9.75em; height: 9.75em; }

#bouldering-grade h3 .openmoji,
#fixie-trick h3 .openmoji,
#calisthenics h3 .openmoji { width: 2.25em; height: 2.25em; }

#jlpt-journey,
#anime-list,
#countries-visited,
#life-advice { font-size: 1rem; }

#jlpt-journey h3,
#anime-list h3,
#countries-visited h3,
#life-advice h3 { font-size: 1.05rem; }

#jlpt-journey .openmoji,
#anime-list .openmoji,
#countries-visited .openmoji,
#life-advice .openmoji { width: 1.65em; height: 1.65em; }

#jlpt-journey { order: 1; }
#anime-list {
  order: 2;
  grid-column: span 2;
}

#countries-visited {
  order: 1;
  grid-column: span 1;
}

#life-advice {
  order: 2;
  grid-column: span 2;
}

#anime-list,
#countries-visited { min-height: 32rem; }

#tech .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#tech .card { font-size: 1.1em; }
#tech .openmoji { width: 1.45em; height: 1.45em; }
#cyber-experience { order: 1; }
#cyber-projects { order: 2; }
#cert-map { order: 3; }
#education { order: 4; }

.card {
  padding: 1rem;
  background: var(--beige-card);
  min-width: 0;
  overflow-wrap: anywhere;
}

.card h3 { margin-top: 0; }

.cert-list { display: grid; gap: 0.45rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.cert-item { display: flex; align-items: center; gap: 0.65rem; padding: 0.45rem 0; min-width: 0; }
.cert-item > :not(.cert-icon) { min-width: 0; overflow-wrap: anywhere; }
.cert-icon { flex: 0 0 1.5rem; text-align: center; }
.cert-content { display: flex; min-width: 0; flex-direction: column; }
.cert-timeframe { color: var(--ink); font-size: 0.78em; opacity: 0.62; }
.cert-state { margin-left: auto; font-size: 0.8em; }

footer { width: min(960px, calc(100% - 2rem)); margin: 3rem auto 2rem; padding: 1rem; text-align: center; color: var(--ink); font-size: 0.9rem; }
.contact-box { display: inline-block; margin: 0.25rem 0; padding: 0.45rem 0.75rem; background: var(--beige-light); }
#email-box { cursor: copy; }
#email-box:focus-visible { outline: none; }

.copy-notice {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  z-index: 6;
  padding: 0.5rem 0.75rem;
  color: var(--beige);
  background: var(--ink);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  transition: opacity 160ms ease, visibility 160ms ease;
}

.copy-notice.visible { opacity: 1; visibility: visible; }

@media (max-width: 480px) {
  header { display: flex; justify-content: space-between; flex-wrap: wrap; padding: 0.2rem 0.4rem; }
  .section-nav { order: 2; }
  .legend { order: 3; width: auto; max-width: 100%; margin: 0; }
  .legend-list { flex-wrap: wrap; justify-content: flex-end; }
  .legend-item { white-space: normal; }
  .about-layout { grid-template-columns: minmax(0, 1fr) 110px; gap: 1rem; }
  .about-photo { max-width: 110px; }
  main { width: calc(100% - 1rem); margin: 0 auto 1rem; padding-top: 5rem; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  section { scroll-margin-top: 5rem; }
  section { margin-bottom: 1rem; padding: 1rem; }
  .card-grid,
  #sports .card-grid,
  #weeb-stuff .card-grid,
  #other .card-grid { grid-template-columns: minmax(0, 1fr); }
  #anime-list,
  #countries-visited,
  #life-advice {
    grid-column: auto;
    min-height: 0;
  }
}
