/* light theme */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #1c1c22;
  --muted: #6b6b76;
  --accent: #e0119d;      /* Tron pink, deepened for contrast on white */
  --glow: none;
  --rule: #ebe7ee;
  --ph-bg: #faf4f8;
  --ph-border: #efc3e0;
  --max: 860px;
}
/* dark theme: follows the OS unless the visitor picked light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --bg: #0b0b12; --text: #ecebf3; --muted: #9b99ab; --accent: #ff3fd2;
    --glow: 0 0 10px rgba(255, 63, 210, 0.55);
    --rule: #23222f; --ph-bg: #14131d; --ph-border: #4a2a45;
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #0b0b12; --text: #ecebf3; --muted: #9b99ab; --accent: #ff3fd2;
  --glow: 0 0 10px rgba(255, 63, 210, 0.55);
  --rule: #23222f; --ph-bg: #14131d; --ph-border: #4a2a45;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top navigation */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 12px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.nav .brand { color: var(--text); font-weight: 600; }
.nav .brand span { font-weight: 400; color: var(--muted); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; align-items: center; }
.theme-btn {
  background: none; border: 1px solid var(--rule); color: var(--muted); border-radius: 14px;
  font: inherit; font-size: 0.85rem; padding: 2px 10px; cursor: pointer;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.nav ul a { color: var(--muted); }
.nav ul a.active, .nav ul a:hover { color: var(--accent); text-decoration: none; }

main { max-width: var(--max); margin: 0 auto; padding: 36px 20px 60px; }

h1 { font-size: 2.4rem; font-weight: 300; margin: 0 0 4px; letter-spacing: -0.5px; }
h1 b { font-weight: 600; color: var(--accent); text-shadow: var(--glow); }
h2 {
  font-size: 1.35rem; font-weight: 500; color: var(--accent); text-shadow: var(--glow);
  margin: 44px 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--rule);
}
h3 { font-size: 1.05rem; margin: 0 0 2px; }

.links { margin: 6px 0 4px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.tagline { color: var(--muted); margin: 0 0 24px; }

/* about block */
.about { display: flex; gap: 36px; align-items: flex-start; }
.about .bio { flex: 1; }
.about .bio p { margin: 0 0 12px; }
.profile { width: 240px; flex-shrink: 0; }
.profile .ph { aspect-ratio: 4 / 5; }
.profile-caption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 6px; }

/* placeholders for photos/videos Shlok will send later */
.ph {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--ph-bg); border: 1.5px dashed var(--ph-border); border-radius: 6px;
  color: var(--muted); font-size: 0.8rem; padding: 8px;
}
img.media, video.media { width: 100%; border-radius: 6px; display: block; }

/* news */
table.news { width: 100%; border-collapse: collapse; }
table.news td { padding: 6px 0; vertical-align: top; border-bottom: 1px solid var(--rule); }
table.news td.date { width: 110px; color: var(--muted); white-space: nowrap; padding-right: 16px; }

/* project rows (home + projects page) */
.proj { display: flex; gap: 22px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.proj:last-child { border-bottom: none; }
.proj .thumb { width: 200px; flex-shrink: 0; }
.proj .thumb .ph { aspect-ratio: 16 / 10; }
.proj .body { flex: 1; min-width: 0; }
.proj .meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 6px; }
.proj p { margin: 0 0 6px; }
.proj ul { margin: 4px 0 0; padding-left: 20px; }
.proj li { margin-bottom: 3px; }
.tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 0.75rem; padding: 1px 8px; border-radius: 10px;
  border: 1px solid var(--rule); color: var(--muted);
}

/* CV page */
.cv-entry { display: flex; gap: 20px; padding: 8px 0; }
.cv-entry .when { width: 140px; flex-shrink: 0; color: var(--muted); font-size: 0.92rem; padding-top: 1px; }
.cv-entry .what { flex: 1; min-width: 0; }
.cv-entry .where { font-style: italic; color: var(--muted); font-size: 0.93rem; }
.cv-entry p { margin: 4px 0; }
.cv-entry ul { margin: 4px 0 0; padding-left: 20px; }
.cv-entry li { margin-bottom: 2px; }
.skills dt { font-weight: 600; margin-top: 10px; }
.skills dd { margin: 2px 0 0; }

footer {
  max-width: var(--max); margin: 0 auto; padding: 20px;
  border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.85rem;
}

@media (max-width: 640px) {
  h1 { font-size: 1.9rem; }
  .about { flex-direction: column; }
  .profile { width: 170px; }
  .proj { flex-direction: column; }
  .proj .thumb { width: 100%; }
  .cv-entry { flex-direction: column; gap: 2px; }
  .cv-entry .when { width: auto; }
  .nav ul { gap: 14px; }
}

/* Shlok's hand-drawn straw-hat logo: a mask painted in the accent colour, so it follows the theme */
.logo {
  display: inline-block; flex-shrink: 0;
  aspect-ratio: 640 / 514;
  background: var(--accent);
  -webkit-mask: url(assets/logo-mask.png) center / contain no-repeat;
          mask: url(assets/logo-mask.png) center / contain no-repeat;
  filter: drop-shadow(var(--logo-glow, 0 0 0 transparent));
}
:root[data-theme=dark] { --logo-glow: 0 0 6px rgba(255, 63, 210, 0.6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --logo-glow: 0 0 6px rgba(255, 63, 210, 0.6); } }
.nav .brand { display: inline-flex; align-items: center; gap: 8px; }
.nav .brand .logo { width: 30px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.hero-text { min-width: 0; }
.hero .logo { width: 150px; transform: rotate(-8deg); transition: transform 0.4s ease; }
.hero .logo:hover { transform: rotate(6deg) scale(1.05); }
@media (prefers-reduced-motion: reduce) { .hero .logo, .hero .logo:hover { transition: none; transform: rotate(-8deg); } }
footer { display: flex; align-items: center; gap: 8px; }
footer .logo { width: 22px; }
@media (max-width: 640px) { .hero .logo { width: 92px; } }
@media (max-width: 480px) {
  .nav-inner { flex-wrap: wrap; row-gap: 6px; }
  .nav ul { gap: 12px; }
}

/* The "D." (Will of D.): a broken neon letter between Shlok and Raval.
   The letter is drawn by CSS, so the page text, title and search results still read "Shlok Raval". */
:root { --willd-dim: rgba(224, 17, 157, 0.16); --willd-lit-glow: none; --willd-anim: willd-fade; }
:root[data-theme=dark] { --willd-dim: rgba(255, 63, 210, 0.22); --willd-lit-glow: 0 0 6px #ff3fd2, 0 0 18px rgba(255, 63, 210, 0.75), 0 0 34px rgba(255, 63, 210, 0.45); --willd-anim: willd-sputter; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) { --willd-dim: rgba(255, 63, 210, 0.22); --willd-lit-glow: 0 0 6px #ff3fd2, 0 0 18px rgba(255, 63, 210, 0.75), 0 0 34px rgba(255, 63, 210, 0.45); --willd-anim: willd-sputter; }
}
.willd { position: relative; display: inline-block; text-decoration: none; font-weight: 500; color: var(--willd-dim); }
.willd::before { content: "D."; }
.willd:hover { text-decoration: none; }
.willd.on { animation: var(--willd-anim) 4.2s linear 1; }
.willd:hover, .willd:focus-visible { color: var(--accent); text-shadow: var(--willd-lit-glow); animation: none; }
.willd::after {
  content: "Will of D."; position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -4px);
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.02em; white-space: nowrap;
  color: var(--accent); background: var(--bg); border: 1px solid var(--accent); border-radius: 12px;
  padding: 2px 10px; opacity: 0; pointer-events: none; transition: opacity 0.2s;
  text-shadow: none;
}
.willd:hover::after { opacity: 1; }
@keyframes willd-sputter {
  0%, 2%   { color: var(--willd-dim); text-shadow: none; }
  3%, 5%   { color: var(--accent); text-shadow: var(--willd-lit-glow); }
  6%, 8%   { color: var(--willd-dim); text-shadow: none; }
  9%, 10%  { color: var(--accent); text-shadow: var(--willd-lit-glow); }
  11%, 14% { color: var(--willd-dim); text-shadow: none; }
  15%, 16% { color: var(--accent); text-shadow: var(--willd-lit-glow); }
  17%, 19% { color: var(--willd-dim); text-shadow: none; }
  21%, 68% { color: var(--accent); text-shadow: var(--willd-lit-glow); }
  70%      { color: var(--willd-dim); text-shadow: none; }
  72%, 76% { color: var(--accent); text-shadow: var(--willd-lit-glow); }
  79%, 100%{ color: var(--willd-dim); text-shadow: none; }
}
@keyframes willd-fade {
  0%, 100% { color: var(--willd-dim); }
  25%, 70% { color: var(--accent); }
}
@media (prefers-reduced-motion: reduce) { .willd.on { animation: none; } }
