/*
  Portfolio — Rishi Kiran
  Visual system: warm, calm, minimal. No purple/neon. Inter font.
  Light: beige/sand neutrals; Dark: charcoal. Subtle elevation + fades.
*/

:root {
  --bg: #f7f3ef;           /* warm sand */
  --surface: #ffffff;
  --text: #1f2623;         /* warm ink */
  --muted: #5a645f;        /* softened ink */
  --border: #e7e1db;
  --accent: #6f5b4d;       /* warm brown */
  --accent-ghost: rgba(111, 91, 77, 0.10);
  --shadow: 0 10px 30px rgba(0,0,0,0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --container: 1120px;
  --trans: 220ms cubic-bezier(.2,.7,.2,1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1110;         /* charcoal */
    --surface: #151816;    /* low-contrast panel */
    --text: #f3f2ef;
    --muted: #b6bbb6;
    --border: #232623;
    --accent: #c9b29d;     /* soft beige accent for dark */
    --accent-ghost: rgba(201, 178, 157, 0.14);
    --shadow: 0 20px 40px rgba(0,0,0,0.35);
  }
}

/* System theme toggle support */
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

/* Explicit theme overrides for manual toggle */
[data-theme="light"] {
  --bg: #f7f3ef;
  --surface: #ffffff;
  --text: #1f2623;
  --muted: #5a645f;
  --border: #e7e1db;
  --accent: #6f5b4d;
  --accent-ghost: rgba(111, 91, 77, 0.10);
  --shadow: 0 10px 30px rgba(0,0,0,0.06);
}
[data-theme="dark"] {
  --bg: #0f1110;
  --surface: #151816;
  --text: #f3f2ef;
  --muted: #b6bbb6;
  --border: #232623;
  --accent: #5f4b3e; /* align accents with darker beige-brown */
  --accent-ghost: rgba(111, 91, 77, 0.18);
  --shadow: 0 20px 40px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  letter-spacing: 0.2px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#backdrop {
  position: fixed;
  inset: -20vmax;
  z-index: -1;
  /* Dark mode: black gradients across the page */
  background: radial-gradient(900px 600px at 15% 0%, rgba(0,0,0,0.30), transparent 55%),
              radial-gradient(1000px 700px at 85% -10%, rgba(0,0,0,0.30), transparent 60%);
  filter: saturate(1.0);
}

.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }

.site-header { position: sticky; top: 0; backdrop-filter: saturate(1.1) blur(6px); background: color-mix(in oklab, var(--bg), transparent 10%); border-bottom: 1px solid var(--border); z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: 0.2px; font-size: clamp(24px, 4.8vw, 42px); white-space: nowrap; }
.site-nav { display: flex; gap: 14px; align-items: center; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; transition: background var(--trans), color var(--trans); }
.site-nav a:hover { background: var(--accent-ghost); color: var(--text); }
.theme-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 6px 10px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; box-shadow: var(--shadow); }
.theme-toggle:hover { background: color-mix(in oklab, var(--surface), var(--accent-ghost)); }
.toggle-sun, .toggle-moon { display: inline-block; }

.section { padding: 64px 0; }
.section-hero { padding-top: 84px; padding-bottom: 72px; display: grid; align-items: center; }
.hero-title { font-size: clamp(28px, 5vw, 44px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 14px; }
.hero-subtitle { font-size: clamp(16px, 2.6vw, 18px); color: var(--muted); margin: 0 0 22px; max-width: 70ch; }
.hero-subtitle .hero-subnote { display: block; margin-top: 6px; font-size: 0.95em; color: color-mix(in oklab, var(--muted), var(--text) 10%); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 14px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); background: var(--surface); transition: transform var(--trans), background var(--trans), box-shadow var(--trans); box-shadow: var(--shadow); }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); color: #fff; border-color: color-mix(in oklab, var(--accent), black 8%); }
.button.primary:hover { filter: saturate(1.05); }
.button.ghost { background: transparent; }
.button.subtle { background: var(--surface); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(22px, 3.8vw, 28px); margin: 0; letter-spacing: -0.01em; }
.section-note { color: var(--muted); margin: 0; }

.projects-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.project-card { grid-column: span 12; display: grid; grid-template-columns: 1fr; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform var(--trans), box-shadow var(--trans); }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(0,0,0,0.10); }
.project-media { display: block; position: relative; overflow: hidden; }
.project-media img, .project-media video { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
.project-media.contain img, .project-media.contain video { object-fit: contain; background: color-mix(in oklab, var(--surface), black 4%); }
.project-body { padding: 14px; display: grid; gap: 8px; }
.project-title { margin: 0; font-size: 18px; }
.project-desc { margin: 0; color: var(--muted); }
.project-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (min-width: 760px) {
  .project-card { grid-column: span 6; }
}
@media (min-width: 1100px) {
  .project-card { grid-column: span 6; }
}

/* Mobile header adjustments to prevent right edge overflow */
@media (max-width: 720px) {
  .site-nav { gap: 8px; }
  .site-nav a { display: none; }
  .header-inner { padding: 10px 0; }
}

.about { display: grid; gap: 10px; padding: 0; background: transparent; border: 0; box-shadow: none; }
.about p { font-size: clamp(18px, 2.6vw, 22px); line-height: 1.65; }

/* Larger About heading only */
#about .section-head h2 { font-size: clamp(26px, 4.6vw, 36px); }

.contact-list { display: flex; flex-wrap: wrap; gap: clamp(12px, 2vw, 24px); padding: 0; margin: 0; list-style: none; align-items: center; }
.contact-link { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; padding: 8px 0; border-radius: 0; border: 0; background: transparent; }
.contact-link .icon { opacity: .9; }
.contact-link:hover { color: var(--accent); transform: none; }
.icon { opacity: 0.9; }

.site-footer { padding: 24px 0 40px; color: var(--muted); }

/* Lightbox for demo */
.lightbox { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); z-index: 100; padding: 20px; }
.lightbox[aria-hidden="false"] { display: flex; }
.lightbox-body { max-width: min(92vw, 1200px); max-height: 88vh; }
.lightbox-body img, .lightbox-body video { width: 100%; height: auto; border-radius: 12px; border: 1px solid #0003; box-shadow: 0 30px 80px rgba(0,0,0,0.45); background: #000; }
.lightbox-close { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow); }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }


/* Dark mode: deep neutral for primary button to avoid beige look */
[data-theme="dark"] .button.primary { background: #5f4b3e; border-color: #6d5a4d; }
[data-theme="dark"] .button.primary:hover { background: #6b5648; }


