*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

*:focus:not(:focus-visible) { outline: none; }

:root {
  --bg: #040d21;
  --text: #f0ede8;
  --muted: #888;
  --accent: #e86927;
  --accent2: #d4a843;
  --border: rgba(255,255,255,0.07);
  --card-bg: rgba(255,255,255,0.04);
  --nav-bg: rgba(4,13,33,0.85);
  --side-margin: clamp(2rem, 25vw, 40rem);
}

body.light-mode {
  --bg: #ffffff;
  --text: #1d1d1f;
  --muted: #86868b;
  --accent: #0071e3;
  --accent2: #bf4800;
  --border: rgba(0,0,0,0.1);
  --card-bg: rgba(255,255,255,0.7);
  --nav-bg: rgba(245,245,247,0.85);
}

::selection {
  background-color: rgba(232, 105, 39, 0.28);
  color: inherit;
}

body.light-mode ::selection {
  background-color: rgba(0, 113, 227, 0.18);
  color: inherit;
}

body.theme-switching * {
  transition: none !important;
}

.stream-word {
  display: inline;
  opacity: 0;
  filter: blur(4px);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stream-word.visible {
  opacity: 1;
  filter: blur(0);
}


html {
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
  overflow-x: hidden;
}

html::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Garamond, serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  overflow: hidden;
  overflow-x: hidden;
  min-height: 100vh;
}

body.hero-exited {
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── NAV ── */
nav {
  position: absolute;
  top: 0;
  left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6rem var(--side-margin) 1rem;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

nav.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-name {
  pointer-events: auto;
  /* font-family: 'Montserrat', sans-serif; */
  font-family: 'EB Garamond', Garamond, serif;
  text-transform: capitalize;
  font-size: 2.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  gap: 0;
  outline: none;
}

.nav-subtitle {
  font-family: 'EB Garamond', Garamond, serif;
  font-style: italic;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.06em; 
  opacity: 0.85;
  white-space: nowrap;
  /* controls up-spacing of SWEMLE subtitle */
  margin-top: -0.65rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
  pointer-events: auto;
  margin-top: 1.8rem;
}

.nav-links {
  display: flex;
  gap: 0;
  align-items: center;
  list-style: none;
}

.nav-links li {
  display: flex;
  align-items: center;
}

.nav-links li + li::before {
  content: '•';
  font-weight: 700;
  opacity: 0.4;
  margin: 0 1rem;
  line-height: 1;
}

.nav-links a {
  position: relative;
  color: var(--text);
  opacity: 0.7;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  text-transform: capitalize;
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
  outline: none;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-links a:hover {
  opacity: 1;
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

#theme-toggle {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  font-size: 1.2rem;
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#theme-toggle span {
  position: absolute;
  transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.5s ease;
}

#theme-toggle .icon-sun {
  transform: translateY(20px) rotate(45deg);
  opacity: 0;
}

#theme-toggle .icon-moon {
  transform: translateY(0) rotate(0);
  opacity: 1;
}

body.light-mode #theme-toggle .icon-sun {
  transform: translateY(0) rotate(0);
  opacity: 1;
}

body.light-mode #theme-toggle .icon-moon {
  transform: translateY(-20px) rotate(-45deg);
  opacity: 0;
}

/* ── SECTIONS ── */
#scroll-container {
  display: none;
  opacity: 0;
  transition: opacity 1s ease;
  position: relative;
  width: 100%;
  z-index: 10;
}

body.hero-exited #scroll-container {
  display: block;
  opacity: 1;
}

main {
  position: relative;
  width: 100%;
}

.hero-spacer {
  display: none;
}

.view-content {
  display: none;
  padding: 240px var(--side-margin) 60px;
  max-width: 100%;
  min-height: 100vh;
}

.view-content.active {
  display: block;
  animation: fadeIn 0.8s ease forwards;
}

.section-title {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.bio {
  position: relative;
  z-index: 1;
}

.bio p {
  color: var(--text);
  opacity: 0.85;
  font-size: 1.225rem;
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ── INLINE LINKS ── */
.text-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s ease, text-shadow 0.3s ease, color 0.3s ease;
}

.text-link:hover {
  text-decoration-color: rgba(255, 255, 255, 1);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

body.light-mode .text-link {
  text-decoration-color: rgba(0, 0, 0, 0.4);
}

body.light-mode .text-link:hover {
  color: #000000;
  text-decoration-color: rgba(0, 0, 0, 1);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.18);
}

.text-link-adobe {
  color: #e53e3e;
  text-decoration-color: #e53e3e;
}

.text-link-adobe:hover {
  text-decoration-color: #ff0000;
  text-shadow: 0 0 14px rgba(255, 60, 60, 1), 0 0 30px rgba(255, 0, 0, 0.55);
  color: #ff0000;
}

body.light-mode .text-link-adobe {
  color: #e53e3e;
  text-decoration-color: #e53e3e;
}

body.light-mode .text-link-adobe:hover {
  color: #b91c1c;
  text-decoration-color: #b91c1c;
  text-shadow: 0 0 10px rgba(185, 28, 28, 0.35);
}

.text-link-uta {
  color: #6ab4f5;
  text-decoration-color: #6ab4f5;
}

.text-link-uta:hover {
  text-decoration-color: #93ccff;
  text-shadow: 0 0 10px rgba(106, 180, 245, 0.7);
  color: #93ccff;
}

body.light-mode .text-link-uta {
  color: #2b7bb9;
  text-decoration-color: #2b7bb9;
}

body.light-mode .text-link-uta:hover {
  color: #1a5a8f;
  text-decoration-color: #1a5a8f;
  text-shadow: 0 0 10px rgba(26, 90, 143, 0.35);
}

#globe-container {
  width: 100%;
  height: 600px;
  margin-top: -6rem;
  position: relative;
  background: transparent;
  display: block !important;
}

canvas {
  display: block;
  max-width: 100%;
}

/* ── CARDS ── */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* ── FOOTER & SOCIALS ── */
.footer {
  padding: 4rem var(--side-margin) 6rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.social-icons {
  display: flex;
  gap: 1.5rem;
  z-index: 500;
}

.social-icon {
  color: var(--text);
  opacity: 0.7;
  text-decoration: none;
  transition: transform 0.3s, color 0.3s, opacity 0.3s;
}
.social-icon svg { width: 22px; height: 22px; fill: currentColor; }
.social-icon:hover {
  transform: scale(1.1);
  color: var(--accent);
  opacity: 1;
}

.copyright {
  font-size: 0.8rem;
  opacity: 0.5;
  margin-top: 1rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  :root { --side-margin: 10vw; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  :root { --side-margin: 5vw; }
  nav { top: 20px; }
  .nav-right { gap: 1rem; }
  .nav-links { gap: 0; }
  .nav-links a { font-size: 0.9rem; }
  .nav-name { font-size: 1.6rem; gap: 1rem; }
  .nav-subtitle { font-size: 0.8rem; }
}

@media (max-width: 429px), (max-height: 939px) and (max-width: 1023px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.9rem 1.5rem 0.75rem;
    gap: 0.3rem;
    top: 0;
  }

  .nav-name {
    font-size: 1.5rem;
    white-space: nowrap;
    gap: 0.1rem;
  }

  .nav-subtitle {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
  }

  .nav-right {
    margin-top: 0;
    gap: 1rem;
  }

  .view-content {
    padding-top: 130px;
  }
}
