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

:root {
  --bg: #fafaf8;
  --surface: #f3f3ef;
  --border: #e4e4dc;
  --text: #111110;
  --muted: #6b6b63;
  --nav-h: 64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: rgba(250, 250, 248, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }

/* ── Layout ── */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px;
}

section {
  padding: 96px 0 0;
}

#about {
  padding-top: 48px;
}

.section-first {
  padding-top: calc(var(--nav-h) + 64px);
}

/* ── Hero ── */
#hero {
  padding-top: calc(var(--nav-h) + 96px);
  padding-bottom: 0;
}

.hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-text { flex: 1; min-width: 0; }

.pfp-placeholder {
  width: 160px;
  height: auto;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: block;
}

.hero-eyebrow {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}

h1 {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 28px;
  color: var(--text);
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 6px;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover { background: #2a2a28; }

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
}

.btn-ghost:hover {
  border-color: #bbbbb3;
  color: var(--text);
}

/* ── Section header ── */
.section-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  display: block;
}

.section-hint {
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
  opacity: 0.7;
}

/* ── About ── */
.about-text {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text);
  max-width: 640px;
}

.about-text p + p { margin-top: 18px; }

/* ── Projects / Activity ── */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.project-card {
  background: var(--bg);
  padding: 28px 30px;
  transition: background 0.12s;
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  cursor: default;
}

a.project-card { cursor: pointer; }
a.project-card:hover { background: var(--surface); }

.project-body {
  flex: 1;
  min-width: 0;
}

.project-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.project-desc {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.project-link {
  color: #2563eb;
  text-decoration: underline;
}

.project-link:hover { color: #1d4ed8; }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  letter-spacing: 0.01em;
}

/* ── Project media pocket ── */
.project-gallery {
  width: 148px;
  flex-shrink: 0;
}

.gallery-grid {
  width: 148px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  border-radius: 8px;
}

.gallery-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  background: var(--surface);
  border: 1px dashed var(--border);
  overflow: hidden;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.82);
}

/* Hover and hold: pop the full set up as a fullscreen overlay */
.gallery-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px;
  background: rgba(17, 17, 16, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0s linear 0.15s;
  z-index: 1000;
}

.project-gallery:hover .gallery-overlay {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease 0.5s, visibility 0s linear 0.5s;
}

.project-gallery.gallery-closed .gallery-overlay {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}

/* No real photos yet — don't pop the empty placeholder overlay open on hover */
.project-gallery.gallery-empty:hover .gallery-overlay {
  opacity: 0;
  visibility: hidden;
}

.gallery-overlay-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 960px;
}

.gallery-overlay-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.gallery-overlay-thumb:hover {
  transform: scale(2);
  z-index: 2;
}

.gallery-overlay-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.82);
}

.gallery-close {
  position: absolute;
  top: 24px;
  right: 32px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  font-family: 'Inter', -apple-system, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.gallery-close:hover { background: rgba(255, 255, 255, 0.12); }

/* ── Publications & Articles ── */
.pub-group { margin-top: 48px; }

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.pub-item {
  max-width: 640px;
}

.pub-citation {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 10px;
}

.pub-link-row {
  display: block;
  cursor: pointer;
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  transition: opacity 0.12s ease;
}

.pub-link-row:hover { opacity: 0.8; }

.pub-link-thumb {
  display: block;
  width: 120px;
  height: 76px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px dashed var(--border);
  overflow: hidden;
}

.pub-link-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Poster lightbox (click to open) ── */
.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px;
  background: rgba(17, 17, 16, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  z-index: 1000;
}

.lightbox.lightbox-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  display: block;
}

.lightbox-img:not(img) {
  width: 520px;
  aspect-ratio: 3 / 4;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.3);
}

/* ── Posts ── */
.posts-scroll {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.post-card {
  position: relative;
  flex: 0 0 320px;
  scroll-snap-align: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  background: var(--bg);
}

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.post-delete {
  display: none;
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.post-delete:hover { background: var(--surface); color: var(--text); }

body.edit-unlocked .post-delete { display: flex; }

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface) url("../img/pfp.png") center / cover no-repeat;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.post-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.post-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.post-text a,
.composer-textarea a {
  color: #2563eb;
  text-decoration: underline;
}

.post-images {
  position: relative;
  margin-top: 10px;
  border-radius: 6px;
  overflow: hidden;
}

.post-image-slide {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-image-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-image-arrow:hover { background: rgba(0, 0, 0, 0.75); }

.post-image-prev { left: 8px; }
.post-image-next { right: 8px; }

/* ── Footer ── */
.divider {
  height: 1px;
  background: var(--border);
  margin-top: 96px;
}

footer {
  padding: 40px 0 48px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.footer-tagline {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

.footer-links,
.footer-info {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links a,
.footer-info p,
.footer-info a {
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.footer-links a:hover,
.footer-info a:hover { color: var(--text); opacity: 0.7; }

.sign-out-link { display: none; }
body.edit-unlocked .sign-out-link { display: inline; }

.footer-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--muted);
  flex-shrink: 0;
}

.secret-trigger { cursor: pointer; }

/* ── Auth toast (Google sign-in feedback) ── */
.auth-message {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1300;
}

.auth-message.auth-message-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Start-a-post bar (visible once unlocked via Google sign-in) ── */
.start-post-bar {
  display: none;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--bg);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.start-post-bar:hover { border-color: #bbbbb3; }

body.edit-unlocked .start-post-bar { display: flex; }

body.edit-unlocked .start-post-bar { display: flex; }

/* ── Post composer (LinkedIn-style modal) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 16, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0s linear 0.15s;
  z-index: 1200;
  padding: 24px;
}

.modal-overlay.modal-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s ease;
}

.composer-card {
  position: relative;
  background: var(--bg);
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

.composer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.composer-close:hover { background: var(--surface); }

.composer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-right: 32px;
}

.composer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface) url("../img/pfp.png") center / cover no-repeat;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.composer-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.composer-audience {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.composer-textarea {
  width: 100%;
  min-height: 160px;
  border: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.composer-textarea:focus { outline: none; }

.composer-textarea:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

.composer-image-preview {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  margin: 12px 0;
  padding-bottom: 4px;
}

.composer-image-thumb {
  position: relative;
  flex: 0 0 100px;
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.composer-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.composer-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.composer-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}

.composer-icon-btn:hover { background: var(--surface); }

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  nav { padding: 0 24px; }
  main { padding: 0 24px; }
  .nav-links { gap: 20px; }

  .hero-row { flex-direction: column-reverse; align-items: flex-start; }
  .pfp-placeholder { width: 120px; height: auto; }

  .project-card { flex-direction: column; }

  .project-gallery { width: 100%; }

  .gallery-grid { width: 100%; grid-template-columns: repeat(4, 1fr); }

  .gallery-overlay { display: none; }

  .post-card { flex: 0 0 82vw; }
}

@media (max-width: 480px) {
  nav { padding: 0 16px; }
  .nav-name { font-size: 13px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 11.5px; }
}
