/* Dheeraj Deokar portfolio. Dark by default, light for light-mode users. */
:root {
  --bg: #0b0f14;
  --bg-alt: #0f151c;
  --surface: #131b24;
  --surface-2: #18222d;
  --border: #233040;
  --text: #e8eef4;
  --muted: #93a1b0;
  --accent: #34d399;
  --accent-2: #38bdf8;
  --accent-ink: #052e1f;
  --glow-1: rgba(52, 211, 153, 0.18);
  --glow-2: rgba(56, 189, 248, 0.14);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa;
    --bg-alt: #eef2f6;
    --surface: #ffffff;
    --surface-2: #f3f6f9;
    --border: #dfe5ec;
    --text: #111a22;
    --muted: #556270;
    --accent: #059669;
    --accent-2: #0284c7;
    --accent-ink: #ffffff;
    --glow-1: rgba(5, 150, 105, 0.12);
    --glow-2: rgba(2, 132, 199, 0.1);
    --shadow: 0 20px 50px rgba(17, 26, 34, 0.12);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16.5px/1.65 "Space Grotesk", -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  padding: 8px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
}
.skip:focus { left: 8px; }

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

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.nav__mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04121c; font-weight: 700;
}
.nav__links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav__links a {
  display: block; padding: 8px 12px; border-radius: 999px; color: var(--muted);
  text-decoration: none; font-size: 15px; font-weight: 500; transition: color .2s, background .2s;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); background: var(--surface); }
.nav__links .nav__cta { color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }

@media (max-width: 720px) {
  .nav__links li:not(:last-child) { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform .2s, border-color .2s, background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2)));
  border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn--ghost { background: transparent; }
.btn--small { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn[hidden] { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; }
.hero__glow {
  position: absolute; inset: -20% -10% auto; height: 120%; pointer-events: none;
  background:
    radial-gradient(40% 50% at 20% 30%, var(--glow-1), transparent 70%),
    radial-gradient(35% 45% at 80% 20%, var(--glow-2), transparent 70%);
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(0, 30px, 0) scale(1.05); } }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(60% 60% at 50% 30%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(60% 60% at 50% 30%, #000, transparent 75%);
}
.hero__inner { position: relative; z-index: 1; }

/* Small terminal card on the right of the hero (desktop only). */
.term {
  position: absolute; right: 0; top: 50%; width: 400px; transform: translateY(-50%);
  border-radius: 14px; overflow: hidden; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
  backdrop-filter: blur(6px);
}
.js .term.reveal { transform: translateY(calc(-50% + 18px)); }
.js .term.reveal.is-in { transform: translateY(-50%); }
.term__bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.term__bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term__bar i:nth-child(2) { background: #febc2e; }
.term__bar i:nth-child(3) { background: #28c840; }
.term__bar span { margin-left: 8px; color: var(--muted); font-size: 13px; }
.term__body {
  margin: 0; padding: 18px 20px 22px; white-space: pre-wrap;
  font: 14px/1.75 "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--text);
}
.term__body .p { color: var(--accent); }
.term__body .o { color: var(--muted); }
.term__body .ok { color: var(--accent); }
.term__body .cursor { display: inline-block; width: 8px; height: 16px; margin-left: 4px; vertical-align: -3px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 1100px) { .term { display: none; } }
.hero__hello { color: var(--accent); font-weight: 600; letter-spacing: .02em; }
.hero__name {
  margin-top: 8px; font-size: clamp(44px, 8vw, 84px); font-weight: 700; letter-spacing: -0.04em;
  background: linear-gradient(120deg, var(--text) 30%, color-mix(in srgb, var(--accent) 60%, var(--text)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__role { margin-top: 14px; font-size: clamp(18px, 2.4vw, 22px); color: var(--text); font-weight: 500; }
.hero__role .dot { color: var(--accent); margin: 0 4px; }
.hero__line { margin-top: 14px; max-width: 560px; color: var(--muted); font-size: 18px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero__facts {
  display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; list-style: none;
  color: var(--muted); font-size: 15px;
}
.hero__facts li { display: flex; align-items: center; gap: 8px; }
.hero__facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero__facts strong { color: var(--text); font-weight: 700; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section--alt { background: var(--bg-alt); }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.section__title { margin-top: 6px; font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -0.02em; }
.section__head { margin-bottom: 22px; }

/* ---------- Products ---------- */
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.product {
  display: flex; flex-direction: column; gap: 22px;
  padding: 20px 20px 24px; border-radius: 20px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 70%, var(--bg)));
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.product__kind { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.badge {
  padding: 3px 10px; border-radius: 999px; font-size: 12px; letter-spacing: .02em; text-transform: none;
  color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent);
}
.product__name { margin-top: 4px; font-size: clamp(24px, 2.6vw, 28px); font-weight: 700; letter-spacing: -0.02em; }
.product__lead { margin-top: 8px; color: var(--muted); font-size: 15.5px; }
.product__features { margin-top: 14px; list-style: none; display: grid; gap: 6px; font-size: 15px; }
.product__features li { position: relative; padding-left: 26px; }
.product__features li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 14px; height: 8px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.product__links { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; list-style: none; }
.tags li {
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}

.product__media { position: relative; aspect-ratio: 16 / 10; }
.shot {
  position: absolute; margin: 0; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface-2);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.shot--main { inset: 0 12% 18% 0; z-index: 2; }
.shot--a { width: 52%; right: 0; top: 8%; z-index: 1; transform: rotate(2deg); }
.shot--b { width: 52%; right: 4%; bottom: 0; z-index: 3; transform: rotate(-2deg); }
.product:hover .shot--main { transform: translateY(-4px); }
.product:hover .shot--a { transform: rotate(3deg) translateY(-6px); }
.product:hover .shot--b { transform: rotate(-3deg) translateY(-6px); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.product__media--art { display: grid; place-items: center; overflow: hidden; border-radius: 14px; }
.product__media--art img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Experience ---------- */
.split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 48px; align-items: start; }
.split--even { grid-template-columns: 1fr 1fr; align-items: stretch; }
.timeline { list-style: none; position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2), transparent);
}
.timeline__item { position: relative; padding: 0 0 22px; }
.timeline__item::before {
  content: ""; position: absolute; left: -28px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-alt); border: 3px solid var(--accent);
}
.timeline__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.timeline__head h3 { font-size: 17px; font-weight: 700; }
.timeline__head h3 span { color: var(--muted); font-weight: 600; }
.timeline__when { color: var(--muted); font-size: 13px; }
.timeline__item ul { margin-top: 8px; list-style: none; display: grid; gap: 4px; color: var(--muted); font-size: 15px; }
.timeline__item ul li { position: relative; padding-left: 18px; }
.timeline__item ul li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }

/* ---------- Skills: one compact card, a row per group ---------- */
.stack {
  position: relative; margin: 0; padding: 6px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.stack > div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.stack > div:first-child { border-top: 0; }
.stack dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.stack dd { margin: 0; }
.stack .tags { margin-top: 0; }

/* ---------- About ---------- */
.about__text { display: grid; gap: 12px; color: var(--muted); font-size: 16.5px; }
.about__text p:first-child { color: var(--text); }
.about__open { color: var(--accent) !important; font-weight: 600; }

/* ---------- Contact ---------- */
.contact__inner {
  padding: 28px; border-radius: 20px; position: relative; overflow: hidden;
  background:
    radial-gradient(60% 80% at 50% 0%, var(--glow-1), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
}
.contact__title { margin-top: 6px; font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -0.03em; }
.contact__line { margin-top: 10px; color: var(--muted); font-size: 16px; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.contact__email { margin-top: 14px; color: var(--muted); font-size: 14px; }
.copied { color: var(--accent); font-weight: 600; margin-left: 6px; }
.contact__alt { margin-top: 6px; color: var(--muted); font-size: 13px; }
.contact__alt a { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { padding: 8px 0 32px; color: var(--muted); font-size: 14px; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); padding-top: 24px; }

/* ---------- Glow that follows the mouse (desktop, motion allowed) ---------- */
.mouse-glow {
  position: fixed; left: 0; top: 0; z-index: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  transition: opacity .4s;
  will-change: transform;
}
.mouse-glow.is-on { opacity: 1; }
main, .footer { position: relative; z-index: 1; }

/* Cards light up where the mouse is. */
.product, .stack, .contact__inner { --mx: 50%; --my: 50%; }
.product::before, .stack::before, .contact__inner::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%);
  transition: opacity .3s;
}
.product, .stack { position: relative; }
.product:hover::before, .stack:hover::before, .contact__inner:hover::before { opacity: 1; }
.product > *, .stack > *, .contact__inner > * { position: relative; }

/* Typing terminal: blinking caret while it types. */
.term__body.is-typing .cursor { animation: none; }

/* ---------- Reveal on scroll (only when JS runs) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero__glow, .term__body .cursor { animation: none; }
  .shot, .btn { transition: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .products, .split, .split--even { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .hero { padding: 48px 0 40px; }
  .section { padding: 44px 0; }
  .stack > div { grid-template-columns: 1fr; gap: 6px; }
  .btn { flex: 1 1 auto; }
}

/* ---------- Custom cursor (mouse users, motion allowed) ----------
   A sharp dot exactly at the pointer and a ring that follows smoothly.
   The ring grows over links and buttons and pulses on click. */
.cursor-dot, .cursor-ring {
  position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; border-radius: 50%;
  opacity: 0; transition: opacity .25s;
}
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.cursor-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 70%, transparent);
  transition: opacity .25s, width .25s, height .25s, margin .25s, background .25s, border-color .25s;
}
.has-cursor .cursor-dot, .has-cursor .cursor-ring { opacity: 1; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
.cursor-ring.is-link {
  width: 56px; height: 56px; margin: -28px 0 0 -28px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: var(--accent);
}
.cursor-ring.is-down { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
.cursor-dot.is-link { opacity: 0; }

.product__logo { width: 40px; height: 40px; margin-right: 12px; vertical-align: middle; border-radius: 10px; }
