/* ── Custom Properties ── */

:root {
  --color-bg: #f5f7f7;
  --color-text: #333;
  --color-heading: #111;
  --color-accent: #333;
  --font-stack: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Charter", Georgia, "Times New Roman", serif;
  --header-height: 60px;
  --max-content: 1280px;
}

[data-theme="dark"] {
  --color-bg: #222;
  --color-text: #DEDEDE;
  --color-heading: #FEFEFE;
  --color-accent: #DEDEDE;
}

/* ── Reset ── */

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

/* ── Base ── */

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: color 0.3s ease, background-color 0.3s ease;
}

/* ── Skip Link (accessibility) ── */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-heading);
  color: var(--color-bg);
  text-decoration: none;
  z-index: 1000;
  border-radius: 0 0 4px 4px;
}

.skip-link:focus {
  top: 0;
}

/* ── Header ── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  max-width: var(--max-content);
  margin: 0 auto;
  background-color: var(--color-bg);
  font-family: var(--font-stack);
  transition: background-color 0.3s ease;
  z-index: 100;
}

.site-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-heading);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-name:hover {
  color: var(--color-accent);
}

/* ── Navigation ── */

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-nav ul {
  display: flex;
  gap: 30px;
  list-style: none;
}

.hamburger {
  display: none;
}

.nav-home,
.nav-theme {
  display: none;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--color-heading);
}

/* ── Theme Toggle ── */

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  color: var(--color-text);
  padding: 0;
  line-height: 1;
  width: 1.5em;
  text-align: center;
  transition: color 0.3s ease;
}

.theme-toggle:hover {
  color: var(--color-heading);
}

/* ── Hero ── */

.hero {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
  padding: 2rem;
  padding-top: calc(var(--header-height) + 6rem);
  max-width: var(--max-content);
  margin: 0 auto;
  overflow: hidden;
}

/* ── Hero Intro ── */

.hero-intro {
  max-width: 800px;
  margin: -11px auto 0;
  padding: 0 2rem;
  font-size: clamp(22px, calc(16px + 1.25vw), 32px);
  line-height: 1.3;
  color: var(--color-text);
  position: relative;
  z-index: 2;
}

.intro-part {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.intro-part[data-intro="1"],
.intro-part[data-intro="2"] {
  font-size: clamp(42px, calc(30px + 3.3vw), 72px);
}

.intro-part[data-intro="3"] {
  transition: opacity 1.8s ease;
}

.intro-part.visible {
  opacity: 1;
}

/* ── Blip Overlay ── */

#blip-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

/* ── Word Circles ── */

.word-circle {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--circle-color);
  opacity: 0;
  text-decoration: none;
  pointer-events: auto;
  will-change: transform;
}

.word-circle:hover {
  cursor: pointer;
}

.word-circle::before,
.word-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 2px solid var(--circle-color);
  transform: translate(-50%, -50%) scale(1) translateZ(0);
  opacity: 0;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
}

.word-circle.visible::before {
  width: 20px;
  height: 20px;
  animation: pulseRing 2s ease-out 0.6s infinite;
}

.word-circle.visible::after {
  width: 20px;
  height: 20px;
  animation: pulseRingOuter 2s ease-out 0.9s infinite;
}

.word-circle.traveling::before,
.word-circle.traveling::after,
.word-circle.docked::before,
.word-circle.docked::after,
.word-circle.docked-about::before,
.word-circle.docked-about::after,
.word-circle.docked-contact::before,
.word-circle.docked-contact::after {
  animation: none;
  opacity: 0;
}

.word-circle.docked.active,
.word-circle.docked-about.active,
.word-circle.docked-contact.active {
  box-shadow: 0 0 0 3px var(--color-bg), 0 0 0 5px var(--circle-color);
}

@keyframes pulseRing {
  0% {
    transform: translate(-50%, -50%) scale(1) translateZ(0);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5) translateZ(0);
    opacity: 0;
  }
}

@keyframes pulseRingOuter {
  0% {
    transform: translate(-50%, -50%) scale(1) translateZ(0);
    opacity: 0.5;
  }
  100% {
    transform: translate(-50%, -50%) scale(3.5) translateZ(0);
    opacity: 0;
  }
}

/* ── Sections ── */

.section {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
  padding: 4rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.section h2 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 600;
  color: var(--color-heading);
  margin-top: -0.3em;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.section p {
  font-size: clamp(22px, calc(16px + 1.25vw), 32px);
  line-height: 1.3;
  margin-bottom: 1rem;
}

/* ── Section Bubble Navs ── */

.insight-nav,
.about-nav {
  display: flex;
  margin-bottom: 3.75rem;
}

.insight-bubble,
.about-bubble,
.contact-bubble {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bubble-color);
}

.insight-bubble,
.about-bubble {
  margin-right: 30px;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.2s ease;
}

.insight-bubble:hover,
.about-bubble:hover {
  transform: scale(1.3);
}

.insight-bubble.active,
.about-bubble.active {
  transform: scale(1.3);
  box-shadow: 0 0 0 3px var(--color-bg), 0 0 0 5px var(--bubble-color);
}

.contact-bubble {
  margin-bottom: 3.75rem;
}

/* ── Section Panels ── */

.insight-panels,
.about-panels {
  position: relative;
  min-height: 200px;
}

.insight-panel,
.about-panel {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.insight-panel.active,
.about-panel.active {
  opacity: 1;
  visibility: visible;
  position: relative;
}

.insight-hook,
.insight-panel p {
  font-size: clamp(22px, calc(16px + 1.25vw), 32px);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.about-hook,
.about-panel p {
  font-size: clamp(16px, calc(12px + 0.8vw), 22px);
  line-height: 1.4;
  margin-bottom: 1rem;
}

.insight-hook,
.about-hook {
  font-weight: 600;
  color: var(--color-heading);
}

/* ── Insight Quote ── */

.insight-quote {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
  border-left: 3px solid var(--color-text);
  opacity: 0.75;
}

.insight-quote p {
  font-size: clamp(20px, calc(16px + 1vw), 29px);
  font-style: italic;
}

.insight-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: clamp(17px, calc(14px + 0.78vw), 24px);
  font-style: normal;
  color: var(--color-text);
  opacity: 0.6;
}

.insight-quote cite::before {
  content: "— ";
}

/* ── Connect Body ── */

.connect-body p {
  font-size: clamp(16px, calc(12px + 0.8vw), 22px);
  line-height: 1.4;
  margin-bottom: 1rem;
}

/* ── Contact Info ── */

.contact-info {
  margin-top: 3rem;
}

.contact-info p {
  font-size: clamp(22px, calc(16px + 1.25vw), 32px);
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.contact-info a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-info a:hover {
  color: var(--color-heading);
}

/* ── Footer ── */

.site-footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text);
  opacity: 0.6;
}

.site-footer a {
  color: var(--color-text);
  transition: opacity 0.2s ease;
}

.site-footer a:hover {
  opacity: 0.6;
}

/* ── About Photo ── */

.about-photo {
  float: left;
  width: clamp(90px, 15vw, 150px);
  height: auto;
  margin: 0.3rem 30px 1rem 0;
  opacity: 0.8;
}

/* ── About Summary ── */

.subtext {
  font-size: 0.85em;
  opacity: 0.7;
}

.section-label {
  font-family: var(--font-stack);
  font-weight: 600;
  font-size: clamp(11px, calc(9px + 0.5vw), 14px) !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  opacity: 0.5;
  margin-top: 1rem;
  margin-bottom: 0.25rem !important;
}

.about-intro {
  font-size: clamp(16px, calc(12px + 0.8vw), 22px) !important;
  line-height: 1.4;
}

.about-summary {
  margin-top: 1.5rem;
  font-size: clamp(16px, calc(12px + 0.8vw), 22px);
  line-height: 1.4;
}

.about-summary p {
  font-size: inherit;
  line-height: inherit;
  margin-bottom: 0.4rem;
}


.resume-link {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.6rem 2rem;
  font-family: var(--font-stack);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
  border: 1.5px solid var(--color-text);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.resume-link:hover,
.resume-link:focus {
  color: var(--color-bg);
  background-color: var(--color-text);
}

.about-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 1.5rem;
}

.about-actions .resume-link {
  margin-top: 0;
}

.story-link {
  font-family: var(--font-stack);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.story-link:hover,
.story-link:focus {
  opacity: 0.6;
}

/* ── Try Me Prompt ── */

.try-me {
  position: absolute;
  left: -44px;
  top: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
  color: var(--color-text);
}

.try-me.visible {
  opacity: 0.6;
}

.try-me-arrow {
  display: block;
}

/* ── Responsive ── */

/* Hide static bubble navs on desktop — circles take over */
@media (min-width: 900px) {
  .insight-nav,
  .about-nav,
  .contact-bubble {
    visibility: hidden;
  }
}

/* ── Mobile: ≤899px ── */
@media (max-width: 899px) {
  .word-circle { display: none; }
  .try-me { display: none; }

  .insight-panels,
  .about-panels {
    min-height: 0;
  }

  .insight-bubble::after,
  .about-bubble::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
  }
}

/* ── Tablet/phone: ≤768px ── */
@media (max-width: 768px) {
  .site-header {
    padding: 0 1rem;
  }

  .hero {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .hero-intro {
    padding: 0;
  }

  .section {
    padding: 4rem 1.5rem;
  }

  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
  }

  .hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--color-text);
    box-shadow: 0 6px 0 var(--color-text), 0 -6px 0 var(--color-text);
  }

  .site-nav ul {
    display: none;
    position: absolute;
    top: var(--header-height);
    right: 1rem;
    flex-direction: column;
    background: var(--color-bg);
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid rgba(128, 128, 128, 0.15);
    border-top: none;
    border-radius: 0 0 6px 6px;
    gap: 0;
  }

  [data-theme="dark"] .site-nav ul {
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.1);
  }

  .site-nav ul.open {
    display: flex;
  }

  .site-nav li {
    padding: 0.75rem 0;
  }

  .site-nav a {
    font-size: 0.9rem;
  }

  .nav-home {
    display: list-item;
  }

  .nav-theme {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .theme-pick {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0;
    color: var(--color-text);
    opacity: 0.3;
    transition: opacity 0.2s ease;
  }

  .theme-pick[data-set-theme="light"] {
    font-size: 1.35rem;
  }

  .theme-pick.active {
    opacity: 1;
  }

  .theme-sep {
    color: var(--color-text);
    opacity: 0.2;
    font-size: 0.9rem;
  }

  .theme-toggle {
    display: none;
  }
}

/* ── Small phone: ≤480px ── */
@media (max-width: 480px) {
  .contact-info {
    flex-direction: column;
    gap: 1rem;
  }
}
