@import url('https://api.fontshare.com/v2/css?f[]=clash-display@400,500,600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap');

:root {
  --bg: #1b1a1a;
  --card-bg: #0b0b0b;
  --accent: #00a9e3;
  --muted: #b8b5b5;
  --white: #ffffff;
  --nav-pill: rgba(88, 88, 88, 0.34);
  --nav-active: #585858;
  --radius-lg: 18px;
  --radius-pill: 119px;
  --font-display: 'Clash Display', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --max-w: 1180px;
  --edge: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

a { color: inherit; text-decoration: none; }

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

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--edge);
}

/* ---------- Nav ---------- */

.nav-spacer { height: clamp(96px, 16vw, 160px); }

.nav {
  position: fixed;
  top: clamp(14px, 2.5vw, 28px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: var(--nav-pill);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: clamp(4px, 1vw, 10px);
  padding: 7px;
  width: max-content;
  max-width: calc(100vw - 24px);
}

.nav a {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(14px, 2vw, 20px);
  color: var(--white);
  padding: 11px clamp(16px, 2.6vw, 28px);
  border-radius: calc(var(--radius-pill) - 7px);
  white-space: nowrap;
}

.nav a.active { background: var(--nav-active); }

.nav a:not(.active) {
  cursor: pointer;
  transition: transform .45s cubic-bezier(.34,1.56,.64,1);
}

.nav a:not(.active):hover,
.nav a:not(.active).shake {
  animation: nudge-shake .5s ease;
}

@keyframes nudge-shake {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(-6deg); }
  40%  { transform: rotate(5deg); }
  60%  { transform: rotate(-4deg); }
  80%  { transform: rotate(3deg); }
  100% { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .nav a:not(.active):hover, .nav a:not(.active).shake,
  .tap-target:hover, .tap-target.shake { animation: none !important; }
}

/* generic hoverable/shakeable control used on buttons/links across pages */
.tap-target { transition: transform .2s ease; }
.tap-target:hover, .tap-target.shake { animation: nudge-shake .5s ease; }

/* ---------- Home: hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  padding-top: clamp(8px, 2vw, 24px);
}

.hero-photo {
  width: 100%;
  max-width: 260px;
  border-radius: 17.6px;
  overflow: hidden;
}

.hero-photo img { width: 100%; height: auto; }

.hero-text { padding-top: 6px; }

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 6vw, 190px);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(19px, 2.4vw, 26px);
  color: var(--muted);
}

.hero-social {
  margin-top: clamp(28px, 5vw, 48px);
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-social svg { width: 20px; height: 20px; flex: none; }

.hero-social a {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.4vw, 26px);
  text-underline-offset: 4px;
}

.bio {
  margin-top: clamp(48px, 8vw, 90px);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(18px, 2.4vw, 30px);
  line-height: 1.55;
  max-width: 900px;
}

.bio p { margin: 0 0 1.1em; }
.bio p:last-child { margin-bottom: 0; }
.bio a { text-decoration: underline; text-underline-offset: 3px; }

.section-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 2.6vw, 30px);
  margin: clamp(64px, 9vw, 110px) 0 clamp(18px, 3vw, 28px);
}

.exp-row {
  display: flex;
  align-items: baseline;
  gap: clamp(16px, 3vw, 40px);
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(16px, 2vw, 24px);
}

.exp-row:last-child { border-bottom: 1px solid rgba(255,255,255,0.1); }

.exp-year { color: var(--muted); width: 64px; flex: none; }
.exp-role { color: var(--muted); margin-left: auto; text-align: right; }
.exp-row a.exp-link { transition: opacity .2s ease; }
.exp-row a.exp-link:hover { opacity: .72; }

.site-footer {
  margin-top: clamp(70px, 10vw, 120px);
  padding: 40px 0 clamp(50px, 8vw, 90px);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 40px;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: clamp(16px, 1.8vw, 22px);
  color: var(--muted);
}

.site-footer a:hover { color: var(--white); }

/* decorative faint doodle text, matches the Figma sketch-art layer */
.doodle {
  position: absolute;
  color: rgba(255,255,255,0.18);
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.05;
  white-space: pre;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  display: none;
}

@media (min-width: 900px) { .doodle { display: block; } }

.doodle-accent { color: rgba(138,218,245,0.3); }

.page-shell { position: relative; }

/* ---------- My works ---------- */

.work-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 48px);
  margin-bottom: clamp(24px, 3vw, 36px);
  transition: transform .25s ease, background .25s ease;
}

.work-card:hover { transform: translateY(-3px); background: #111; }

.work-blob {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 21px;
  background: radial-gradient(circle at 32% 28%, #5fd8ff 0%, var(--accent) 46%, #0077a8 100%);
  overflow: hidden;
}

.work-blob::after {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(255,255,255,0.55), rgba(255,255,255,0) 60%);
  mix-blend-mode: screen;
}

.work-meta-year {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  letter-spacing: .03em;
  margin: 14px 0 6px;
}

.work-meta-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(18px, 2vw, 22px);
  margin: 0 0 6px;
}

.work-meta-sub {
  font-size: 12.5px;
  color: rgba(255,255,255,0.7);
  margin: 0;
}

.work-copy {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(18px, 2.4vw, 28px);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.work-copy b, .work-copy strong { font-weight: 600; }

.work-card-link-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Lab / posters ---------- */

.lab-intro {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(18px, 2.2vw, 24px);
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 clamp(32px, 5vw, 56px);
}

.poster-grid {
  column-count: 1;
  column-gap: clamp(14px, 2vw, 24px);
}

@media (min-width: 640px) { .poster-grid { column-count: 2; } }
@media (min-width: 1000px) { .poster-grid { column-count: 3; } }

.poster {
  break-inside: avoid;
  margin-bottom: clamp(14px, 2vw, 24px);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  position: relative;
}

.poster img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .5s ease, filter .5s ease;
}

.poster:hover img { transform: scale(1.035); }

.poster-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 16px 14px;
  font-family: var(--font-display);
  font-size: 15px;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}

.poster:hover .poster-cap { opacity: 1; transform: translateY(0); }

/* lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: clamp(16px, 4vw, 48px);
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: zoom-in .28s cubic-bezier(.2,.8,.3,1);
}

@keyframes zoom-in {
  from { transform: scale(.88); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: clamp(16px, 4vw, 40px);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--white);
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, background .2s ease;
}

.lightbox-close:hover { background: rgba(255,255,255,0.18); animation: nudge-shake .5s ease; }

.lightbox-cap {
  position: absolute;
  bottom: clamp(16px, 4vw, 36px);
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--muted);
}

/* ---------- Mobile nav tidy-up ---------- */

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { max-width: 180px; }
  .hero-kicker { gap: 20px 40px; }
  .work-card { grid-template-columns: 1fr; }
  .work-blob { max-width: 180px; }
  .exp-row { flex-wrap: wrap; }
  .exp-role { margin-left: 0; text-align: left; flex-basis: 100%; }
  .site-footer { flex-direction: column; }
}

/* focus visibility */
a:focus-visible, button:focus-visible, .poster:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
