/* Manrope */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Space Grotesk */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../assets/fonts/spacegrotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../assets/fonts/spacegrotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #070d14;
  --bg-soft: #0b121c;
  --bg-grid: rgba(95, 113, 136, 0.1);
  --surface: rgba(11, 20, 31, 0.56);
  --surface-soft: rgba(14, 24, 37, 0.66);
  --text: #d3dceb;
  --muted: #8b9db5;
  --line: rgba(114, 130, 152, 0.24);
  --line-strong: rgba(114, 130, 152, 0.34);
  --accent: #7792af;
  --accent-2: #5d7691;
  --border-ui: rgba(119, 146, 175, 0.7);
  --shadow: 0 22px 40px rgba(0, 0, 0, 0.3);
  --topbar-bg: rgba(8, 13, 21, 0.72);
}

html[data-theme="light"] {
  --bg: #f0f3f7;
  --bg-soft: #e8ecf3;
  --bg-grid: rgba(95, 113, 136, 0.07);
  --surface: rgba(255, 255, 255, 0.65);
  --surface-soft: rgba(240, 243, 247, 0.9);
  --text: #141c28;
  --muted: #3d506b;
  --line: rgba(114, 130, 152, 0.2);
  --line-strong: rgba(114, 130, 152, 0.3);
  --accent: #3f6490;
  --accent-2: #2e5070;
  --border-ui: rgba(63, 100, 144, 0.65);
  --shadow: 0 22px 40px rgba(0, 0, 0, 0.1);
  --topbar-bg: rgba(240, 243, 247, 0.88);
}

.theme-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0.3rem 0.4rem;
  display: flex;
  align-items: center;
  line-height: 1;
  transition: color 0.2s;
  flex-shrink: 0;
}
.theme-btn:hover { color: var(--accent); }
.theme-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.theme-btn .icon-moon { display: none; }
.theme-btn .icon-sun  { display: block; }
html[data-theme="light"] .theme-btn .icon-moon { display: block; }
html[data-theme="light"] .theme-btn .icon-sun  { display: none; }

* {
  box-sizing: border-box;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--accent);
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}
.skip-link:focus {
  top: 1rem;
}

/* Keyboard focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(1500px 820px at 80% -12%, rgba(101, 124, 152, 0.18), transparent 62%),
    radial-gradient(980px 680px at -8%28%, rgba(78, 97, 122, 0.13), transparent 66%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
  background-color: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(1500px 820px at 80% -12%, rgba(101, 124, 152, 0.18), transparent 62%),
    radial-gradient(980px 680px at -8% 28%, rgba(78, 97, 122, 0.13), transparent 66%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.17;
}

#pointcloud-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.58;
}

.topbar,
main,
.footer {
  position: relative;
  z-index: 2;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem clamp(1rem, 3vw, 2.3rem);
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(9px);
}

.brand {
  text-decoration: none;
  color: var(--accent);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.84rem;
  padding: 0.4rem 0.62rem;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.18s ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
  background: rgba(119, 146, 175, 0.14);
  transform: translateY(-1px);
}

.nav-toggle { display: none; }
.nav-backdrop { display: none; }

main {
  width: min(1220px, 94vw);
  margin: 0 auto;
  padding: 1.1rem 0 3.7rem;
}

.section {
  margin-top: 1.1rem;
}

.hero {
  display: block;
}

.hero-copy,
.skill-card,
.project-card,
.contact-card,
.timeline li,
.award-card,
.service-item {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(5px);
}

.hero-copy {
  padding: clamp(1rem, 2.4vw, 1.9rem);
  max-width: 860px;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.hero-profile {
  flex-shrink: 0;
}

.hero-content {
  flex: 1;
}

.profile-image {
  width: 225px;
  height: 225px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  margin-top: 0.5rem;
}

@media (max-width: 760px) {
  .hero-copy {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .hero-actions,
  .hero-meta,
  .shape-controls {
    justify-content: center;
  }
}

.eyebrow {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
h3,
strong {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.1;
}

h1 {
  margin-top: 0.75rem;
  font-size: clamp(2.4rem, 6vw, 4.3rem);
  max-width: 14ch;
}

.lead {
  margin: 0.85rem 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 1.03rem;
  max-width: 60ch;
}

.hero-actions {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.btn {
  text-decoration: none;
  border-radius: 0.65rem;
  padding: 0.58rem 0.88rem;
  font-size: 0.84rem;
  font-weight: 700;
  border: 1px solid var(--border-ui);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

.btn:hover {
  border-color: rgba(119, 146, 175, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.btn-primary {
  background: rgba(119, 146, 175, 0.24);
  color: var(--text);
}

.btn-secondary {
  background: rgba(18, 31, 47, 0.62);
  color: var(--text);
}

.hero-meta {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-meta li {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.38rem 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  background: var(--surface-soft);
}

.bg-controls {
  margin-top: 0.95rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.75rem;
}

.bg-controls > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.shape-controls {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}

.shape-btn {
  border: 1px solid var(--border-ui);
  background: rgba(16, 26, 39, 0.74);
  color: #98abc2;
  border-radius: 999px;
  padding: 0.34rem 0.72rem;
  font-size: 0.82rem;
  font-family: "Space Grotesk", sans-serif;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.18s ease, border-color 0.2s ease;
}

.shape-btn:hover {
  transform: translateY(-1px);
}

.shape-btn.is-active {
  color: #d8e2ef;
  background: rgba(110, 134, 161, 0.34);
  border-color: rgba(122, 145, 171, 0.6);
  font-weight: 700;
}

.lab-foot {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.lab-foot span {
  color: #aabdd3;
  font-size: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.26rem 0.45rem;
  background: rgba(17, 28, 42, 0.68);
}

.section-title {
  margin: 0.38rem 0 0;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
}

.split-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.column-title {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.timeline {
  list-style: none;
  margin: 0.78rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.62rem;
}

.timeline li {
  padding: 0.82rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.timeline li:hover {
  border-color: rgba(119, 146, 175, 0.4);
  box-shadow: 0 0 0 1px rgba(119, 146, 175, 0.1), 0 12px 24px rgba(0, 0, 0, 0.22);
  transform: translateY(-2px);
}

.time {
  margin: 0;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.timeline h3 {
  margin-top: 0.33rem;
  font-size: 1.12rem;
}

.loc {
  margin: 0.3rem 0 0;
  color: #7e95b1;
  font-size: 0.86rem;
}

.loc a {
  color: var(--accent);
  text-decoration: none;
}

.loc a:hover {
  text-decoration: underline;
}

.timeline p {
  margin: 0.42rem 0 0;
  color: var(--muted);
  line-height: 1.52;
  font-size: 0.88rem;
}

.timeline a {
  color: var(--accent);
  text-decoration: none;
}

.skill-grid {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.skill-card {
  padding: 0.84rem;
  --rx: 0deg;
  --ry: 0deg;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.skill-card:hover {
  border-color: rgba(119, 146, 175, 0.48);
  box-shadow: 0 0 0 1px rgba(119, 146, 175, 0.14), 0 14px 28px rgba(0, 0, 0, 0.22);
}

.skill-card h3 {
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.skill-card p {
  margin: 0.48rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.47;
}

.skill-card ul {
  margin: 0.68rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.skill-card li {
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  padding: 0.25rem 0.46rem;
  font-size: 0.73rem;
  color: #9bb0c8;
  background: rgba(17, 31, 46, 0.7);
}

.section-note {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.project-controls {
  margin-top: 0.82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter {
  border: 1px solid var(--border-ui);
  border-radius: 999px;
  background: rgba(16, 27, 40, 0.74);
  color: #8b9fb8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.18s ease, border-color 0.2s ease;
}

.filter:hover {
  transform: translateY(-1px);
}

.filter.is-active {
  color: #d9e3ef;
  background: rgba(111, 136, 163, 0.34);
  border-color: rgba(123, 146, 174, 0.6);
}

.project-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.77rem;
}

.project-grid {
  margin-top: 0.86rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.project-card {
  padding: 0.88rem;
  --rx: 0deg;
  --ry: 0deg;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  border-color: rgba(119, 146, 175, 0.48);
  box-shadow: 0 0 0 1px rgba(119, 146, 175, 0.14), 0 14px 28px rgba(0, 0, 0, 0.2);
}

.project-card .tag {
  margin: 0;
  display: inline-block;
  border: 1px solid rgba(119, 146, 175, 0.42);
  border-radius: 0.3rem;
  padding: 0.2rem 0.4rem;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.project-card h3 {
  margin-top: 0.52rem;
  font-size: 1.1rem;
}

.project-card p {
  margin: 0.42rem 0 0;
  color: var(--muted);
  line-height: 1.52;
  font-size: 0.86rem;
}

.project-card .venue {
  display: block;
  margin-top: 0.42rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-style: italic;
}

.project-card a {
  display: inline-block;
  margin-top: 0.64rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
}

.card-toggle {
  margin-top: 0.62rem;
  border: 1px solid var(--border-ui);
  border-radius: 0.34rem;
  background: rgba(18, 30, 46, 0.68);
  color: #93a8c0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.24rem 0.45rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.card-toggle:hover {
  border-color: rgba(119, 146, 175, 0.45);
  color: #dbe5f3;
}

.paper-btn {
  display: inline-block;
  margin-top: 0.55rem;
  margin-right: 0.45rem;
  padding: 0.32rem 0.65rem;
  background: rgba(119, 146, 175, 0.2);
  border: 1px solid var(--border-ui);
  border-radius: 0.35rem;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease;
}

.paper-btn:hover {
  border-color: rgba(119, 146, 175, 0.6);
  background: rgba(119, 146, 175, 0.32);
  transform: translateY(-1px);
}

.card-expand {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.28s ease, opacity 0.28s ease, margin-top 0.28s ease;
}

.project-card.expanded .card-expand {
  max-height: 18rem;
  overflow-y: auto;
  opacity: 1;
  margin-top: 0.45rem;
}

.card-expand::-webkit-scrollbar {
  width: 5px;
}

.card-expand::-webkit-scrollbar-track {
  background: rgba(11, 20, 31, 0.4);
  border-radius: 3px;
}

.card-expand::-webkit-scrollbar-thumb {
  background: var(--accent-2);
  border-radius: 3px;
}

.project-card.expanded .card-toggle {
  border-color: rgba(119, 146, 175, 0.5);
  background: rgba(119, 146, 175, 0.18);
  color: #dbe5f3;
}

.project-card.is-hidden {
  display: none;
}

/* Awards */
.awards-grid {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.award-card {
  padding: 0.88rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.award-card h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.award-card h3 a:hover {
  color: var(--accent);
}

.award-card:hover {
  border-color: rgba(119, 146, 175, 0.48);
  box-shadow: 0 0 0 1px rgba(119, 146, 175, 0.14), 0 14px 28px rgba(0, 0, 0, 0.2);
}

.award-card .tag {
  margin: 0;
  display: inline-block;
  border: 1px solid rgba(119, 146, 175, 0.42);
  border-radius: 0.3rem;
  padding: 0.2rem 0.4rem;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.award-card.highlight {
  border-color: rgba(119, 146, 175, 0.45);
  background: rgba(119, 146, 175, 0.08);
}

.award-card h3 {
  margin-top: 0.52rem;
  font-size: 1.08rem;
}

.award-card p {
  margin: 0.42rem 0 0;
  color: var(--muted);
  line-height: 1.52;
  font-size: 0.86rem;
}

.time-inline {
  color: var(--accent) !important;
  font-size: 0.75rem !important;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Service */
.service-grid {
  margin-top: 0.78rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.service-item {
  padding: 0.78rem;
}

.service-item a {
  color: var(--accent);
  text-decoration: none;
}

.service-item a:hover {
  text-decoration: underline;
}

.service-item strong {
  color: var(--text);
  font-size: 0.92rem;
}

.service-item p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.48;
}

/* Contact */
.contact-intro {
  margin: 0.55rem 0 0;
  color: var(--muted);
  max-width: 68ch;
  line-height: 1.52;
  font-size: 0.97rem;
}

.contact-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.contact-card {
  display: block;
  text-decoration: none;
  padding: 0.8rem;
  border-color: var(--border-ui);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover {
  border-color: rgba(119, 146, 175, 0.48);
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(119, 146, 175, 0.12);
}

.contact-card span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.contact-card strong {
  display: block;
  margin-top: 0.38rem;
  color: var(--text);
  font-size: 1rem;
}

.footer {
  width: min(1220px, 94vw);
  margin: 0 auto 1.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}

/* ── Career Timeline ──────────────────────────────────────────── */
.timeline-mount {
  position: relative;
  width: 100%;
  height: 320px;
  margin: 1.2rem 0 0.4rem;
  contain: layout style;
  overflow: visible;
}

.tl-svg {
  display: block;
  width: 100%;
}

.tl-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  padding: 0.35rem 0 0;
  max-width: 60%;
}

.tl-beat-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.22rem;
  line-height: 1.3;
  opacity: 0;
  transition: opacity 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tl-beat-capt {
  font-family: 'Manrope', sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  opacity: 0;
  transition: opacity 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tl-panel {
  position: absolute;
  top: 10px;
  right: 0;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border-ui);
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
  z-index: 10;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.tl-panel-close {
  position: absolute;
  top: 7px;
  right: 9px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s;
}
.tl-panel-close:hover { color: var(--text); }

.tl-panel-dates {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
  font-family: 'Manrope', sans-serif;
}

.tl-panel-org {
  display: block;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.45rem;
  font-family: 'Space Grotesk', sans-serif;
}

.tl-panel-impact {
  font-size: 0.82rem;
  line-height: 1.52;
  color: var(--text);
  margin: 0 0 0.6rem;
}

.tl-panel-link {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.tl-panel-link:hover { opacity: 0.8; }

.tl-controls {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem;
}

.tl-scrubber {
  flex: 1;
  height: 2px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--line);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.tl-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}
.tl-scrubber::-moz-range-thumb {
  width: 11px;
  height: 11px;
  background: var(--accent);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}
.tl-scrubber:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.tl-replay {
  font-size: 0.75rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  font-family: 'Space Grotesk', sans-serif;
  white-space: nowrap;
  transition: color 0.2s, opacity 0.3s;
}
.tl-replay:hover { color: var(--accent); }
.tl-replay--hidden { opacity: 0; pointer-events: none; }

.tl-node {
  outline: none;
  opacity: 0;
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
.tl-node:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@keyframes tl-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.07); opacity: 0.65; }
}
@keyframes tl-pulse2 {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.12); opacity: 0.22; }
}
.tl-hring--active {
  animation: tl-pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.tl-hring2--active {
  animation: tl-pulse2 3s cubic-bezier(0.4, 0, 0.6, 1) 0.5s infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
  .tl-beat-title, .tl-beat-capt { transition: none; }
  .tl-hring--active, .tl-hring2--active { animation: none; }
}

@media (max-width: 767px) {
  .timeline-mount { display: none; }
  .timeline-fallback[hidden] { display: block !important; }
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.project-card.reveal,
.skill-card.reveal {
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.2s ease;
}

.project-card.reveal.in-view,
.skill-card.reveal.in-view {
  animation: cardReveal 0.6s ease forwards;
}

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

/* Responsive */
@media (max-width: 1020px) {
  .split-grid,
  .skill-grid,
  .project-grid,
  .awards-grid,
  .contact-grid,
  .service-grid {
    grid-template-columns: 1fr;
  }

  #pointcloud-bg {
    opacity: 0.48;
  }
}

@media (pointer: coarse) {
  #pointcloud-bg {
    display: none;
  }
}

@media (max-width: 760px) {
  /* ── Topbar: fixed-height row ── */
  .topbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    padding: 0 clamp(1rem, 3vw, 2.3rem);
  }

  /* ── Hamburger button ── */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-ui);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s;
  }
  .nav-toggle:hover { border-color: var(--accent); }
  .nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ── Left drawer — starts below the topbar so the bar stays fully clickable ── */
  .nav {
    position: fixed;
    top: 56px;
    left: 0;
    height: calc(100% - 56px);
    width: min(240px, 75vw);
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 0.5rem 0.75rem 1rem;
    background: var(--bg);
    border-right: 1px solid var(--line);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.3);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.1rem;
    overflow-y: auto;
  }
  .nav.is-open { transform: translateX(0); }
  .nav a {
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    width: 100%;
    line-height: 1.3;
  }

  /* ── Backdrop — below topbar (z-index 25 < topbar 30), above page content (2) ── */
  .nav-backdrop {
    display: block;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .nav-backdrop.is-open { opacity: 1; pointer-events: auto; }

  /* ── Hero centering ── */
  .hero-actions,
  .hero-meta,
  .shape-controls { justify-content: center; }

  /* ── Typography ── */
  .eyebrow { letter-spacing: 0.13em; font-size: 0.7rem; }
  h1 { font-size: clamp(2rem, 11vw, 3rem); }
}
