:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --border: #e6e8ec;
  --text-primary: #262b33;
  --text-secondary: #5b6472;
  --text-muted: #9aa3af;
  --radius: 12px;
  --max-width: 720px;
  --rail-width: 230px;
  --content-max-width: 1200px;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
}

a { color: inherit; }

.eyebrow {
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}

/* ---------- left rail nav ---------- */
#rail {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--rail-width);
  height: 100vh;
  padding: 40px 0 0 32px;
  border-right: 0.5px solid var(--border);
}

#rail .navitem {
  display: block;
  font-size: 19px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 0 8px 12px;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

#rail .navitem:hover { color: var(--text-secondary); }
#rail .navitem.active { color: var(--text-primary); border-left-color: var(--text-primary); }

/* ---------- page layout ---------- */
main {
  margin-left: var(--rail-width);
  max-width: var(--content-max-width);
  padding: 48px 48px 96px;
}

section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 0;
  border-top: 0.5px solid var(--border);
}

section:first-of-type { border-top: none; padding-top: 24px; }

/* Projects section hosts the wide floating-card strip, so it isn't capped to the narrow reading column.
   Its heading is wrapped separately so it still aligns with every other section's text column. */
#projects { max-width: none; }
.section-heading { max-width: var(--max-width); margin: 0 auto; }

h1 { font-size: 22px; font-weight: 500; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 500; margin: 0 0 12px; }
.role { font-size: 14px; color: var(--text-secondary); margin: 0 0 20px; }

/* ---------- meta bar (clock + weather) ---------- */
#meta-bar {
  display: flex;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto 32px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

/* ---------- intro ---------- */
#photo {
  width: 184px;
  height: 184px;
  border-radius: 50%;
  background: var(--surface);
  border: 0.5px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}

#photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- dotted transition strip ---------- */
.dotted-strip {
  height: 520px;
  max-width: 1100px;
  /* Left edge lines up with the heading's text column instead of centering independently;
     it's still free to extend wider to the right. */
  margin: 8px 0 32px max(0px, calc((100% - var(--max-width)) / 2));
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 14px 14px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.floating-card {
  position: absolute;
  width: min(463px, 44%);
  aspect-ratio: 380 / 250;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(18, 20, 26, 0.08);
  cursor: pointer;
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  will-change: transform;
  backface-visibility: hidden;
}

.floating-card:hover,
.floating-card:focus-visible {
  transform: translateY(-4px) scale(1.02) rotate(var(--rot, 0deg));
  box-shadow: 0 14px 30px rgba(18, 20, 26, 0.14);
  outline: none;
}

.floating-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.floating-card.coming-soon {
  cursor: default;
  background: #1b1e24;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-card.coming-soon:hover,
.floating-card.coming-soon:focus-visible {
  transform: rotate(var(--rot, 0deg));
  box-shadow: 0 10px 24px rgba(18, 20, 26, 0.08);
}

.floating-card.coming-soon span {
  color: #ffffff;
  font-size: 15px;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 26, 0.55);
}

.lightbox-content {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(18, 20, 26, 0.25);
}

.lightbox-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
}

.lightbox-body { padding: 24px; }
.lightbox-title { font-size: 16px; font-weight: 500; margin: 0 0 10px; }
.lightbox-desc { font-size: 13px; color: var(--text-secondary); margin: 0 0 14px; }

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(18, 20, 26, 0.15);
}

.learn-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 1px solid var(--text-muted);
}

/* ---------- experience ---------- */
.exp-row { display: flex; gap: 20px; margin-bottom: 24px; }
.exp-row .years { flex: none; width: 90px; font-size: 12px; color: var(--text-muted); padding-top: 2px; }
.exp-row .role-title { font-size: 14px; font-weight: 500; margin: 0 0 4px; }
.exp-row .role-desc { font-size: 13px; color: var(--text-secondary); margin: 0; }

.resume-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid var(--text-muted);
}

/* ---------- stack ---------- */
#stack-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
#stack-row img { width: 28px; height: 28px; }

/* ---------- testimonials ---------- */
.testimonial-carousel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.carousel-arrow {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0.5px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.carousel-arrow:hover { color: var(--text-primary); border-color: var(--text-muted); }

#testimonial-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  scrollbar-width: none;
}

#testimonial-row::-webkit-scrollbar { display: none; }

.testimonial-card {
  flex: none;
  width: 280px;
  scroll-snap-align: start;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 13px;
  color: var(--text-secondary);
}

.testimonial-card .quote { margin: 0 0 14px; }
.testimonial-card .name { font-weight: 500; color: var(--text-primary); margin: 0; }
.testimonial-card .title { font-size: 12px; margin: 2px 0 0; }

.attribution { display: flex; align-items: center; gap: 10px; }

.avatar {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 0.5px solid var(--border);
  overflow: visible;
}

.avatar > img:first-child {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar .badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: #fff;
  object-fit: contain;
  padding: 2px;
  box-sizing: border-box;
}

/* ---------- personal ---------- */
.personal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.personal-card {
  display: block;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.personal-card:hover, .personal-card:focus-visible {
  border-color: var(--text-muted);
  transform: translateY(-2px);
  outline: none;
}

.personal-media {
  height: 140px;
  background: var(--surface);
}

.personal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.placeholder-media {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 12px 12px;
}

.split-media { position: relative; }

.split-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.split-media .split-a { clip-path: polygon(0 0, 100% 0, 0 100%); }
.split-media .split-b { clip-path: polygon(100% 0, 100% 100%, 0 100%); }

.personal-body { padding: 16px 20px; }
.personal-title { font-size: 14px; font-weight: 500; margin: 0 0 4px; }
.personal-status { font-size: 12px; color: var(--text-muted); margin: 0; }
.personal-desc { font-size: 13px; color: var(--text-secondary); margin: 8px 0 0; }
.personal-card .learn-more { margin-top: 10px; }

.band-entry { margin-bottom: 20px; }
.band-entry:last-child { margin-bottom: 0; }
.band-name { font-size: 14px; font-weight: 500; margin: 0 0 6px; }
.band-status { font-weight: 400; color: var(--text-muted); font-size: 12px; }

/* ---------- placeholder note (still used by project detail stub pages) ---------- */
.placeholder-note {
  font-size: 13px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* ---------- contact ---------- */
.contact-links { display: flex; flex-direction: column; gap: 10px; }
.contact-links a { font-size: 14px; text-decoration: none; }
.contact-links .label { color: var(--text-muted); font-size: 12px; display: block; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  #rail {
    position: static;
    width: 100%;
    height: auto;
    display: flex;
    overflow-x: auto;
    padding: 16px 20px;
    border-right: none;
    border-bottom: 0.5px solid var(--border);
  }
  #rail .navitem { padding: 6px 12px; border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  #rail .navitem.active { border-left: none; border-bottom-color: var(--text-primary); }
  main { margin-left: 0; padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
