/* ------------------------------------------------------------------
   Shyam Anand — personal site
   Minimal, typographic, responsive. Light + dark via prefers-color-scheme.
   ------------------------------------------------------------------ */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #1b1b1a;
  --muted: #6a6a67;
  --faint: #97978f;
  --accent: #2e8b64;
  --accent-hover: #227052;
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.16);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 42rem;
  --step: clamp(1rem, 0.92rem + 0.4vw, 1.125rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101215;
    --surface: #171a1f;
    --text: #e9e9e6;
    --muted: #a2a29c;
    --faint: #6f6f6a;
    --accent: #58cf9a;
    --accent-hover: #7bdcae;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step);
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Layout ---------------------------------------------------- */

.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.25rem, 5vw, 2rem) 3rem;
  animation: fade-in 0.6s ease both;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Header ---------------------------------------------------- */

.intro-head {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 4vw, 1.75rem);
  margin-bottom: 2.5rem;
}

.avatar {
  flex: 0 0 auto;
  width: clamp(76px, 20vw, 108px);
  height: clamp(76px, 20vw, 108px);
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.identity {
  min-width: 0;
}

.identity h1 {
  margin: 0;
  font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  overflow-wrap: break-word;
}

.identity .role {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
}

.identity .role a {
  white-space: nowrap;
}

/* ---- Prose ----------------------------------------------------- */

.prose p {
  margin: 0 0 1.15rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Sections -------------------------------------------------- */

section {
  margin-top: 2.75rem;
}

.label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.9rem;
}

.now-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.book-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 15rem;
  column-gap: 2rem;
}

.book-list li {
  break-inside: avoid;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.book-list cite {
  color: var(--text);
  font-style: normal;
}

.book-list em {
  color: var(--faint);
  font-style: italic;
}

/* ---- Music ----------------------------------------------------- */

.music-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.music-blurb {
  margin: 0 0 1rem;
}

.embed {
  border-radius: 12px;
  width: 100%;
  border: 0;
  color-scheme: normal;
}

@media (max-width: 540px) {
  .music-layout {
    grid-template-columns: 1fr;
  }
}

/* ---- Links row ------------------------------------------------- */

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ---- Sign-off -------------------------------------------------- */

.signoff {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--faint);
  line-height: 1.7;
}

.signoff p {
  margin: 0;
}

.signoff .prompt {
  color: var(--accent);
  user-select: none;
}

/* ---- Utilities ------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 460px) {
  .intro-head {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}
