/* ==========================================================================
   VINAY BHAGWAT — PORTFOLIO STYLES
   Colours and fonts live in :root. Change them there and the whole site updates.
   ========================================================================== */
:root {
  --ink: #0a0c10;
  --ink-2: #10141b;
  --ink-3: #171c25;
  --line: rgba(236, 233, 225, .13);
  --text: #ece9e1;
  --muted: #a3a6a2;
  --mint: #6df0c2;   /* security / code */
  --ember: #ff6a45;  /* art / paint */
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --wrap: 1180px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--ink); color: var(--text); font: 400 1.0625rem/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.05; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--mint); color: #04130e; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
.mono { font-family: var(--mono); }

/* progress bar */
.progress { position: fixed; inset: 0 auto auto 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--mint), var(--ember)); z-index: 60; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(10, 12, 16, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { font-family: var(--serif); font-size: 1.45rem; display: flex; align-items: center; gap: 10px; }
.brand i { font-style: normal; color: var(--mint); font-size: 1.1rem; transition: transform .5s; }
.brand:hover i { transform: rotate(180deg); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: 99px; font-size: .94rem; color: var(--muted); transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a.is-active, .nav-links a.is-current { color: var(--text); background: var(--ink-3); }
.nav-links .nav-cta { color: #04130e; background: var(--mint); font-weight: 600; margin-left: 8px; }
.nav-links .nav-cta:hover { background: #9af6d6; color: #04130e; }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 42px; position: relative; }
.menu-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text); transition: transform .25s, top .25s; }
.menu-toggle span:first-child { top: 16px; } .menu-toggle span:last-child { top: 24px; }
.menu-toggle[aria-expanded="true"] span:first-child { top: 20px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { top: 20px; transform: rotate(-45deg); }

/* buttons + small pieces */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 99px; font-weight: 600; border: 1px solid transparent; transition: transform .2s, background .2s, border-color .2s; }
.btn-primary { background: var(--mint); color: #04130e; }
.btn-primary:hover { background: #9af6d6; transform: translateY(-2px); }
.btn-ghost { border-color: var(--line); }
.btn-ghost:hover { border-color: var(--mint); color: var(--mint); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(109, 240, 194, .6); animation: ping 2.2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(109, 240, 194, 0); } 100% { box-shadow: 0 0 0 0 rgba(109, 240, 194, 0); } }

/* reveal on scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- HERO ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 80px); align-items: center; min-height: calc(100vh - 68px); padding: 56px 0 72px; position: relative; }
.hero::before { content: ''; position: absolute; inset: -40px -24px auto; height: 100%; z-index: -1; background-image: radial-gradient(rgba(236, 233, 225, .11) 1px, transparent 1px); background-size: 28px 28px; -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000, transparent 75%); mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000, transparent 75%); }
.status { display: inline-flex; align-items: center; gap: 12px; font: 500 .8rem var(--mono); color: var(--muted); border: 1px solid var(--line); padding: 7px 14px; border-radius: 99px; }
.hero h1 { font-size: clamp(2.9rem, 6.6vw, 5.7rem); margin: 28px 0 24px; line-height: .98; }
.hero h1 .line { display: block; }
.hero h1 .line + .line { font-style: italic; color: var(--mint); }
.lede { max-width: 54ch; color: var(--muted); font-size: 1.15rem; }
.roles { margin: 28px 0 34px; font: 500 1rem var(--mono); display: flex; align-items: center; gap: 8px; min-height: 1.6em; }
.roles .slash { color: var(--ember); }
.caret { width: 9px; height: 1.15em; background: var(--mint); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 38px; font-size: .92rem; color: var(--muted); }
.socials a { border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.socials a:hover { color: var(--text); border-color: var(--mint); }

/* the decrypt-lens card */
.scanner { display: block; position: relative; }
.scanner-box { position: relative; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--ink-2); cursor: crosshair; box-shadow: 0 30px 80px -30px rgba(109, 240, 194, .18), 0 0 0 8px rgba(236, 233, 225, .03); }
.scanner-box canvas { width: 100%; height: 100%; touch-action: pan-y; }
.scanner-log { position: absolute; left: 12px; bottom: 12px; font: 500 .72rem var(--mono); background: rgba(10, 12, 16, .82); color: var(--mint); padding: 6px 10px; border-radius: 4px; pointer-events: none; }
.scanner-cap { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: .9rem; color: var(--muted); }
.scanner-cap b { color: var(--text); font-weight: 500; font-family: var(--serif); font-size: 1.15rem; }
.scanner:hover .scanner-cap span:last-child { color: var(--ember); }

/* ---------- SECTIONS ---------- */
section { padding: clamp(64px, 9vw, 120px) 0; }
.section-head { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: end; margin-bottom: 52px; }
.section-head h2 { font-size: clamp(2.2rem, 4.8vw, 3.9rem); }
.section-head p { color: var(--muted); max-width: 44ch; }
.section-head h2 em { color: var(--muted); }

/* stats */
.stats { padding: 0; border-block: 1px solid var(--line); }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { padding: 34px 0 34px 28px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font: 400 clamp(2.4rem, 5vw, 3.8rem)/1 var(--serif); }
.stat span { color: var(--muted); font-size: .95rem; }

/* work / terminal */
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 64px); align-items: center; }
.terminal { background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font: 400 .92rem/1.9 var(--mono); }
.term-top { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.term-top i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); border: 1px solid var(--line); }
.term-top span { margin-left: auto; }
.term-body { padding: 22px 24px 26px; min-height: 250px; }
.t-line { opacity: 0; }
.t-prompt { color: var(--mint); } .t-cmt { color: var(--muted); } .t-dir { color: var(--ember); }
.terminal.is-visible .t-line { animation: type-in .01s forwards; animation-delay: calc(var(--d) * .55s); }
@keyframes type-in { to { opacity: 1; } }
html:not(.js) .t-line { opacity: 1; }
.work-copy h3 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin-bottom: 16px; }
.work-copy p { color: var(--muted); margin-bottom: 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tags span, .chip { font: 500 .78rem var(--mono); border: 1px solid var(--line); border-radius: 99px; padding: 6px 13px; color: var(--muted); background: none; }

/* research */
.research-list { border-top: 1px solid var(--line); }
.research-row { display: grid; grid-template-columns: 1fr auto 28px; gap: 24px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 30px 0; transition: padding .3s, background .3s; }
.research-row:hover { padding-left: 18px; background: linear-gradient(90deg, rgba(109, 240, 194, .07), transparent); }
.research-row h3 { font-size: clamp(1.25rem, 2.3vw, 1.75rem); line-height: 1.2; max-width: 38em; }
.research-row p { color: var(--muted); font-size: .92rem; margin-top: 10px; }
.status-chip { font: 500 .74rem var(--mono); color: var(--mint); border: 1px solid rgba(109, 240, 194, .4); border-radius: 99px; padding: 5px 12px; white-space: nowrap; }
.status-chip.open { color: var(--ember); border-color: rgba(255, 106, 69, .45); }
.row-arrow { color: var(--muted); font-size: 1.3rem; transition: transform .3s, color .3s; }
.research-row:hover .row-arrow { transform: translate(4px, -4px); color: var(--mint); }
.fine { margin-top: 18px; color: var(--muted); font-size: .88rem; }

/* art features */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; align-items: start; }
.feature-card:nth-child(2) { margin-top: 56px; }
.feature-card:nth-child(3) { margin-top: 112px; }
.art-frame { position: relative; background: var(--ink-2); border-radius: 4px; overflow: hidden; width: 100%; }
.art-frame img { width: 100%; height: 100%; object-fit: contain; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.feature-card:hover .art-frame img, .tile:hover .art-frame img { transform: scale(1.04); }
.art-missing { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; text-align: center; font: 500 .78rem/1.7 var(--mono); color: var(--muted); border: 1px dashed var(--line); background: repeating-linear-gradient(45deg, var(--ink-2), var(--ink-2) 12px, var(--ink-3) 12px, var(--ink-3) 24px); padding: 16px; }
.art-frame.is-missing img { visibility: hidden; }
.art-frame.is-missing .art-missing { display: flex; }
.feature-info { padding-top: 16px; }
.feature-info h3 { font-size: 1.6rem; transition: color .2s; }
.feature-card:hover h3 { color: var(--ember); }
.feature-info p { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.center-cta { margin-top: 72px; display: flex; justify-content: center; }

/* credentials / experience */
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel { border: 1px solid var(--line); border-radius: 10px; padding: 34px; background: var(--ink-2); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; transition: border-color .3s; }
.panel:hover { border-color: rgba(109, 240, 194, .45); }
.panel h3 { font-size: 2rem; }
.panel p { color: var(--muted); flex: 1; }
.thm-row { display: flex; align-items: center; gap: 22px; margin-top: 24px; padding: 24px 28px; border: 1px solid var(--line); border-radius: 10px; }
.thm-row b { font: 400 2.6rem/1 var(--serif); color: var(--mint); }
.thm-row p { color: var(--muted); flex: 1; }
.thm-row a { color: var(--mint); border-bottom: 1px solid currentColor; }

/* contact */
.contact { text-align: center; }
.contact h2 { font-size: clamp(2.4rem, 6vw, 5rem); max-width: 14em; margin: 0 auto 22px; }
.contact > .wrap > p { color: var(--muted); max-width: 50ch; margin: 0 auto 36px; }
.mail-line { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; }
.mail-line a.mail { font: 400 clamp(1.3rem, 3.4vw, 2.2rem) var(--serif); border-bottom: 1px solid var(--mint); padding-bottom: 4px; transition: color .2s; }
.mail-line a.mail:hover { color: var(--mint); }
.copy-btn { border: 1px solid var(--line); background: none; border-radius: 99px; padding: 8px 16px; font: 500 .8rem var(--mono); transition: border-color .2s, color .2s; }
.copy-btn:hover { border-color: var(--mint); color: var(--mint); }
.social-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 72px; text-align: left; }
.social-card { border: 1px solid var(--line); border-radius: 10px; padding: 22px; transition: transform .25s, border-color .25s, background .25s; display: block; }
.social-card:hover { transform: translateY(-4px); border-color: var(--mint); background: var(--ink-2); }
.social-card b { display: block; font: 400 1.5rem var(--serif); }
.social-card small { color: var(--muted); font-size: .86rem; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 34px 0 44px; display: flex; flex-wrap: wrap; gap: 14px 32px; justify-content: space-between; align-items: center; color: var(--muted); font-size: .9rem; }
.site-footer .brand { color: var(--text); font-size: 1.25rem; }
.site-footer a:hover { color: var(--mint); }

/* dialogs */
dialog { background: var(--ink-2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 0; max-width: min(720px, 92vw); width: 100%; max-height: 88vh; overflow: auto; }
dialog::backdrop { background: rgba(4, 6, 9, .78); backdrop-filter: blur(6px); }
dialog[open] { animation: pop .3s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.dialog-inner { padding: 44px 40px 36px; }
.dialog-inner h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; margin: 10px 0 22px; }
.dialog-inner h3 { font: 600 1rem var(--sans); margin: 24px 0 8px; }
.dialog-inner p, .dialog-inner li { color: #cfccc4; }
.dialog-inner ul { padding-left: 20px; margin: 0; }
.dialog-kicker { font: 500 .75rem var(--mono); color: var(--mint); }
.dialog-note { margin-top: 26px; padding: 14px 16px; border-left: 2px solid var(--ember); background: var(--ink-3); font-size: .92rem; color: var(--muted); }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--ink-3); font-size: 1.4rem; line-height: 1; z-index: 2; }
.dialog-close:hover { border-color: var(--mint); color: var(--mint); }

/* ---------- GALLERY PAGE ---------- */
.page-head { padding: clamp(48px, 7vw, 96px) 0 36px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: end; }
.page-head h1 { font-size: clamp(2.8rem, 7vw, 5.6rem); }
.page-head h1 em { color: var(--muted); }
.page-head p { color: var(--muted); max-width: 46ch; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 18px 0; border-block: 1px solid var(--line); margin-bottom: 40px; }
.chip { transition: color .2s, border-color .2s, background .2s; }
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.is-active { background: var(--mint); color: #04130e; border-color: var(--mint); }
.filter-bar .count { margin-left: auto; font: 500 .78rem var(--mono); color: var(--muted); }
.masonry { columns: 3; column-gap: 26px; padding-bottom: 40px; }
.tile { display: block; break-inside: avoid; margin-bottom: 38px; }
.tile[hidden] { display: none; }
.tile-info { padding-top: 12px; }
.tile-info h2 { font-size: 1.45rem; transition: color .2s; }
.tile:hover h2 { color: var(--ember); }
.tile-info p { color: var(--muted); font-size: .86rem; }

/* ---------- PAINTING DETAIL ---------- */
.detail-layout { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 5vw, 72px); padding: 48px 0 80px; align-items: start; }
.detail-visual { margin: 0; position: sticky; top: 92px; }
.zoom-btn { position: relative; display: block; width: 100%; padding: 0; background: none; border: 0; cursor: zoom-in; }
.detail-frame { border: 1px solid var(--line); border-radius: 4px; max-height: 80vh; margin-inline: auto; width: auto; max-width: 100%; }
.detail-frame img { max-height: 80vh; width: 100%; }
.zoom-hint { position: absolute; right: 12px; bottom: 12px; font: 500 .72rem var(--mono); background: rgba(10, 12, 16, .85); padding: 6px 10px; border-radius: 4px; opacity: 0; transition: opacity .25s; }
.zoom-btn:hover .zoom-hint, .zoom-btn:focus-visible .zoom-hint { opacity: 1; }
.back-link { color: var(--muted); font-size: .92rem; }
.back-link:hover { color: var(--mint); }
.detail-copy h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin: 20px 0 20px; }
.detail-lede { font: 400 1.35rem/1.45 var(--serif); color: var(--text); max-width: 34em; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 32px 0; border-block: 1px solid var(--line); }
.meta div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.meta div:nth-last-child(-n+2) { border-bottom: 0; }
.meta dt { font: 500 .72rem var(--mono); color: var(--ember); margin-bottom: 4px; }
.meta dd { margin: 0; }
.detail-text { display: grid; gap: 16px; color: #cfccc4; max-width: 62ch; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 44px; }
.pager a { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; transition: border-color .25s, transform .25s; }
.pager a:hover { border-color: var(--mint); transform: translateY(-3px); }
.pager a:last-child { text-align: right; }
.pager span { display: block; font: 500 .72rem var(--mono); color: var(--muted); }
.pager strong { font: 400 1.15rem/1.25 var(--serif); }
.zoom-dialog { max-width: 96vw; width: auto; background: transparent; border: 0; overflow: visible; }
.zoom-dialog img { max-height: 92vh; max-width: 96vw; object-fit: contain; border-radius: 4px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
  .hero, .work-grid, .detail-layout, .page-head, .section-head { grid-template-columns: 1fr; }
  .hero { min-height: 0; }
  .scanner { max-width: 440px; }
  .detail-visual { position: static; }
  .masonry { columns: 2; }
  .social-grid { grid-template-columns: 1fr 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
  .feature-card:nth-child(n) { margin-top: 0; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .nav-links { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 14px 24px 22px; background: var(--ink); border-bottom: 1px solid var(--line); display: none; }
  .nav-links.is-open { display: flex; }
  .nav-links .nav-cta { margin: 8px 0 0; text-align: center; }
}
@media (max-width: 600px) {
  .wrap { width: min(var(--wrap), 100% - 36px); }
  .masonry, .feature-grid { columns: 1; grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .stat { border-left: 0; border-top: 1px solid var(--line); padding: 22px 0; }
  .stat:first-child { border-top: 0; }
  .research-row { grid-template-columns: 1fr 24px; } .research-row .status-chip { grid-row: 2; justify-self: start; }
  .social-grid { grid-template-columns: 1fr; }
  .thm-row { flex-direction: column; align-items: flex-start; }
  .dialog-inner { padding: 52px 22px 26px; }
  .pager { grid-template-columns: 1fr; } .pager a:last-child { text-align: left; }
  .meta { grid-template-columns: 1fr; } .meta div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .t-line { opacity: 1; }
}
