/* -----------------------------
  Modern minimalist theme
------------------------------ */

:root {
  --bg: #0b0c10;
  --bg2: #0f1117;
  --card: #121522;
  --text: #e9edf5;
  --muted: #aab3c5;
  --line: rgba(255, 255, 255, 0.08);

  --accent: #7aa2ff;
  --accent2: #9bf2d0;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --container: 1100px;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfbfd;
    --bg2: #f5f6fa;
    --card: #ffffff;
    --text: #0d1220;
    --muted: #5a647a;
    --line: rgba(2, 10, 26, 0.08);
    --shadow: 0 12px 30px rgba(10, 20, 40, 0.08);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 700px at 15% 10%, rgba(122,162,255,0.18), transparent 55%),
              radial-gradient(900px 500px at 80% 20%, rgba(155,242,208,0.14), transparent 60%),
              linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  padding-top: 64px; /* adjust if header height changes */
}

:root {
  scroll-padding-top: 80px; /* global anchor offset */
}

section[id] {
  scroll-margin-top: 80px; /* ensures section headers remain visible */
}

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

.container {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.skip-link:focus { left: 12px; top: 12px; z-index: 1000; }

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--line);
}


.header-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 55%, transparent),
                                     color-mix(in srgb, var(--accent2) 45%, transparent));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand-name { font-weight: 700; letter-spacing: 0.2px; }
.brand-tagline { font-size: 13px; color: var(--muted); margin-top: 2px; }

.nav {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.nav a {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
}
.nav a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  text-decoration: none;
}

.hero {
  padding: 44px 0 18px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 28px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 75%, transparent);
  color: var(--muted);
  font-size: 13px;
}

h1 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.04;
  margin: 14px 0 10px;
  letter-spacing: -0.6px;
}

.hero-bio {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}

.link-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.link .sub { color: var(--muted); font-size: 12px; }

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 35%, transparent),
    color-mix(in srgb, var(--accent2) 18%, transparent)
  );
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.button:hover { text-decoration: none; box-shadow: var(--shadow); }
.button.ghost {
  background: color-mix(in srgb, var(--card) 65%, transparent);
  color: var(--text);
}

.photo-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 75%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.photo-card img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  display: block;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}
.photo-caption {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}

.section { padding: 42px 0; }
.section.alt {
  background: color-mix(in srgb, var(--bg2) 65%, transparent);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.3px;
}
.muted { color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.card {
  grid-column: span 6;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 75%, transparent);
  box-shadow: 0 0 0 rgba(0,0,0,0);
  padding: 16px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

@media (max-width: 900px) { .card { grid-column: span 12; } }

.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); line-height: 1.55; }

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  color: var(--muted);
}

.card-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.card-links a {
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid transparent;
}
.card-links a:hover {
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 40%, transparent);
}

/* Media card (used for Music artwork) */
.card.media {
  padding: 0;
  overflow: hidden;
}

.card.large {
  grid-column: span 12;
}

.card.large .media-top {
  grid-template-columns: 160px 1fr;
  gap: 18px;
}

.card.large .thumb {
  width: 160px;
  height: 160px;
}

.card.large h3 {
  font-size: 18px;
}

.card.large p {
  font-size: 15px;
}

.card.normal {
  grid-column: span 6;
}

@media (max-width: 900px) {
  .card.large,
  .card.normal {
    grid-column: span 12;
  }

  .card.large .media-top {
    grid-template-columns: 1fr;
  }

  .card.large .thumb {
    width: 100%;
    height: 200px;
  }
}

.card .media-top {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 16px;
}

@media (max-width: 520px) {
  .card .media-top {
    grid-template-columns: 1fr;
  }
}

.thumb {
  width: 92px;
  height: 92px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  overflow: hidden;
  flex: none;
}

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

.album-art {
  width: 120px;
  height: 120px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  overflow: hidden;
  flex: none;
}

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

.media-body h3 {
  margin: 0 0 6px;
}

.media-footer {
  padding: 0 16px 16px;
}


.list { display: grid; gap: 12px; }

.item {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 75%, transparent);
  padding: 16px;
}
.item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
}
.item-title { font-weight: 700; }
.item-year { color: var(--muted); font-size: 13px; }
.item-sub {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}
.item-links { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.kicker { font-size: 12px; color: var(--muted); margin-top: 8px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border-radius: 999px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 65%, transparent);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.chip.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 18%, var(--card) 70%);
}

.contact-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 75%, transparent);
  padding: 16px;
}
@media (max-width: 900px) { .contact-card { grid-template-columns: 1fr; } }

/* ===============================
   PUBLICATIONS: compact thumbnail layout
   =============================== */

.item.media .item-grid {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: start;
}

/* Make publication thumbs smaller than project/music cards */
.item.media .thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
}

@media (max-width: 520px) {
  .item.media .item-grid {
    grid-template-columns: 1fr;
  }

  .item.media .thumb {
    width: 100%;
    height: 180px;
  }
}

/* ===============================
   CURRENT PROJECTS: 2-column layout
   =============================== */

/* Only affect cards inside the Current Projects grid */
#projects .card.large {
  grid-column: span 6;
}

/* Responsive: stack on smaller screens */
@media (max-width: 700px) {
  #projects .card.large {
    grid-column: span 12;
  }
}

/* ===============================
   LINK BUTTON STYLING
   =============================== */

/* Shared base style */
.card-links a,
.item-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease;
}

/* Hover / focus */
.card-links a:hover,
.item-links a:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  background: color-mix(in srgb, var(--accent) 18%, var(--card) 70%);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

/* Active (click) */
.card-links a:active,
.item-links a:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Slightly tighter buttons in publications list */
.item-links a {
  padding: 6px 10px;
  font-size: 12.5px;
}

.hero-bio {
  white-space: pre-line;
}

/* ===============================
   MOBILE HEADER COMPACT MODE
   =============================== */

@media (max-width: 600px) {
  /* shrink overall header height */
  body { padding-top: 54px; }
  :root { scroll-padding-top: 64px; }
  section[id] { scroll-margin-top: 64px; }

  .header-grid {
    padding: 8px 0;
    gap: 10px;
  }

  .brand {
    min-width: 0; /* important: stops it forcing a big header */
    gap: 10px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 14px;
    line-height: 1.1;
  }

  /* Hide tagline to save vertical space */
  .brand-tagline {
    display: none;
  }

  /* Make nav a single horizontal row you can swipe */
  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    max-width: 100%;
    padding-bottom: 2px;
  }

  .nav::-webkit-scrollbar { display: none; }

  .nav a {
    white-space: nowrap;
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 10px;
  }
}
