/* ==========================================================
   Ganesh Dalave — Portfolio
   ========================================================== */

:root {
  color-scheme: light;
  --paper: #f2f0ea;
  --ink: #151515;
  --ink-soft: #4a4842;      /* body copy, AA on paper */
  --muted: #6b6962;         /* AA on paper */
  --orange: #f05b32;
  --orange-text: #c8421c;   /* orange for small text on paper (AA) */
  --line: #d6d2c8;
  --line-strong: #a9a69c;
  --panel: #e4e1d8;
  --card: #f6f1e8;
  --on-orange: #151515;
  --mono: 'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme='dark'] {
  color-scheme: dark;
  --paper: #151615;
  --ink: #f2f0ea;
  --ink-soft: #c3c1b8;
  --muted: #a4a39a;
  --orange: #f47a4d;
  --orange-text: #f58b64;
  --line: #333631;
  --line-strong: #5a5d56;
  --panel: #1e211e;
  --card: #232623;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

::selection { background: var(--orange); color: var(--on-orange); }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

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

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px;
  font-family: var(--mono); font-size: 12px; transition: top .2s;
}
.skip-link:focus { top: 16px; }

.scroll-progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60;
  background: var(--orange); transform: scaleX(0); transform-origin: 0 50%;
}

.icon {
  width: 14px; height: 14px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Layout shell ---------- */
.site-shell {
  display: grid;
  grid-template-columns: clamp(190px, 18vw, 270px) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 32px 28px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12px; }
.brand span {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--orange); color: var(--on-orange); font-weight: 500;
  transition: transform .4s var(--ease);
}
.brand:hover span { transform: rotate(-12deg) scale(1.08); }
.brand small { font-size: 10px; color: var(--muted); line-height: 1.3; }

.sidebar-rule { height: 1px; background: var(--line); margin: 44px 0 24px; }

.side-label, .kicker, .eyebrow, .project-type, .visual-caption, .contact-meta, footer, .project-number, .mini-heading {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
}
.side-label { color: var(--muted); margin-bottom: 9px; }
.availability { font-size: 12.5px; line-height: 1.9; }
.availability li::before { content: '→'; color: var(--orange-text); margin-right: 8px; }

.sidebar-bottom { margin-top: auto; display: grid; gap: 13px; font-family: var(--mono); font-size: 11px; }
.sidebar-bottom a {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line); padding-bottom: 10px;
  transition: color .2s, border-color .2s;
}
.sidebar-bottom a .icon { color: var(--orange-text); transition: transform .25s var(--ease); }
.sidebar-bottom a:hover { color: var(--orange-text); border-color: var(--orange); }
.sidebar-bottom a:hover .icon { transform: translate(2px, -2px); }

.content { min-width: 0; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 72px; padding: 0 clamp(24px, 5vw, 74px);
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.eyebrow, .kicker { color: var(--muted); }

.nav { display: flex; align-items: center; gap: 14px; }
.nav-links { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; }
.nav-links a { position: relative; padding: 8px 12px; transition: color .2s; }
.nav-links a::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 1px;
  background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav-links a:hover { color: var(--orange-text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--ink); }

.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink);
  cursor: pointer; transition: border-color .2s, background-color .2s;
}
.icon-btn:hover { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, transparent); }
.icon-btn .icon { grid-area: 1 / 1; width: 15px; height: 15px; transition: transform .35s var(--ease), opacity .2s; }

/* Theme toggle shows the icon of the theme you'd switch TO */
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-60deg) scale(.6); }
[data-theme='dark'] .theme-toggle .icon-moon { opacity: 0; transform: rotate(60deg) scale(.6); }
[data-theme='dark'] .theme-toggle .icon-sun { opacity: 1; transform: none; }

.menu-toggle { display: none; }
.menu-toggle .icon-close { opacity: 0; transform: rotate(-60deg) scale(.6); }
.menu-toggle[aria-expanded='true'] .icon-open { opacity: 0; transform: rotate(60deg) scale(.6); }
.menu-toggle[aria-expanded='true'] .icon-close { opacity: 1; transform: none; }

/* ---------- Shared ---------- */
.section-pad { padding: clamp(68px, 9vw, 135px) clamp(24px, 7vw, 112px); }

.hero h1, .section-heading h2, .about h2, .contact h2 {
  font-size: clamp(45px, 6.5vw, 95px); line-height: 1; letter-spacing: -.06em;
  margin: 25px 0 30px; font-weight: 700; text-wrap: balance;
}
em { font-style: normal; color: var(--orange); }

.section-heading { margin-bottom: 65px; }
.section-heading h2 { font-size: clamp(40px, 5vw, 72px); margin: 22px 0 0; max-width: 560px; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.08fr .92fr;
  gap: clamp(35px, 8vw, 120px); align-items: center;
  min-height: calc(100vh - 72px);
}
.status-dot {
  display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%;
  background: #4fbf8a; box-shadow: 0 0 0 0 rgba(79, 191, 138, .6); animation: pulse 2.4s infinite;
}
.hero-intro { max-width: 440px; color: var(--ink-soft); font-size: 16.5px; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 38px; }

.button {
  display: inline-flex; align-items: center; gap: 14px; padding: 16px 22px;
  font-family: var(--mono); font-size: 11px; border: 1px solid transparent;
  transition: transform .25s var(--ease), background-color .2s, color .2s;
}
.button-dark { background: var(--ink); color: var(--paper); }
.button-dark:hover { background: var(--orange); color: var(--on-orange); transform: translateY(-2px); }
.button .icon { transition: transform .25s var(--ease); }
.button:hover .icon { transform: translate(2px, 2px); }

.text-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 0;
  font-family: var(--mono); font-size: 11px; border-bottom: 1px solid var(--line-strong);
  transition: border-color .2s, color .2s;
}
.text-link .icon { color: var(--orange-text); transition: transform .25s var(--ease); }
.text-link:hover { border-color: var(--orange); color: var(--orange-text); }
.text-link:hover .icon { transform: translate(2px, -2px); }

.hero-visual { max-width: 520px; width: 100%; justify-self: center; }
.image-frame {
  position: relative; background: #151515; padding: 13px; transform: rotate(2deg);
  box-shadow: 18px 18px 0 color-mix(in srgb, var(--orange) 85%, transparent);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.image-frame:hover { transform: rotate(0); box-shadow: 10px 10px 0 var(--orange); }
.image-frame img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%;
  filter: grayscale(100%) contrast(1.05); opacity: .9; transition: filter .5s, opacity .5s;
}
.image-frame:hover img { filter: grayscale(0); opacity: 1; }
.image-stamp {
  position: absolute; right: -23px; bottom: 25px; padding: 13px 16px;
  background: var(--orange); color: var(--on-orange);
  font-family: var(--mono); font-size: 10px; line-height: 1.3; letter-spacing: .06em; transform: rotate(-7deg);
}
.visual-caption { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); margin-top: 30px; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden; background: var(--orange); color: var(--on-orange);
  padding: 15px 0; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
}
.marquee-track { display: flex; width: max-content; animation: marquee 28s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; flex: none; white-space: nowrap; }
.marquee-group i { font-style: normal; margin: 0 26px; }

/* ---------- Work ---------- */
.work { border-bottom: 1px solid var(--line); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }

.project-card { border-top: 1px solid var(--ink); padding-top: 13px; }
.project-link { display: block; }
.project-top { display: flex; justify-content: space-between; margin-bottom: 17px; }
.project-type { color: var(--muted); }

.project-visual {
  position: relative; overflow: hidden; min-height: 280px; display: grid; place-items: center;
}
.marketplace-visual { background: #d9d2ef; }
.academic-visual { background: #f4dcb0; }
[data-theme='dark'] .marketplace-visual { background: #3a3555; }
[data-theme='dark'] .academic-visual { background: #55442a; }

.dashboard-window {
  width: 66%; max-width: 340px; padding: 10px; background: #f6f1e8; color: #151515;
  box-shadow: 17px 16px 0 rgba(21, 21, 21, .15); transform: rotate(-4deg);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.project-link:hover .dashboard-window { transform: rotate(-1deg) scale(1.03); box-shadow: 22px 20px 0 rgba(21, 21, 21, .18); }
.window-bar { display: flex; gap: 4px; border-bottom: 1px solid #d5d1c7; padding-bottom: 8px; }
.window-bar span { width: 6px; height: 6px; border-radius: 50%; background: #f05b32; }
.window-bar span:nth-child(2) { background: #e7ba5c; }
.window-bar span:nth-child(3) { background: #7da797; }
.dashboard-content { padding: 24px 16px 14px; }
.chart-line { width: 56%; height: 6px; background: #151515; margin-bottom: 28px; }
.metric-row { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 13px; }
.metric-row b:last-child { color: #3b7d63; font-size: 10px; }
.chart-bars { height: 75px; display: flex; align-items: end; gap: 7px; margin-top: 17px; }
.chart-bars i { display: block; flex: 1; height: 38%; background: #f0805d; transform-origin: bottom; transition: transform .5s var(--ease); }
.chart-bars i:nth-child(2) { height: 70%; }
.chart-bars i:nth-child(3) { height: 50%; }
.chart-bars i:nth-child(4) { height: 85%; background: #f05b32; }
.chart-bars i:nth-child(5) { height: 60%; }
.chart-bars i:nth-child(6) { height: 92%; background: #f05b32; }
.chart-bars i:nth-child(7) { height: 68%; }
.project-link:hover .chart-bars i { animation: bar .7s var(--ease) both; }
.project-link:hover .chart-bars i:nth-child(2) { animation-delay: .05s; }
.project-link:hover .chart-bars i:nth-child(3) { animation-delay: .1s; }
.project-link:hover .chart-bars i:nth-child(4) { animation-delay: .15s; }
.project-link:hover .chart-bars i:nth-child(5) { animation-delay: .2s; }
.project-link:hover .chart-bars i:nth-child(6) { animation-delay: .25s; }
.project-link:hover .chart-bars i:nth-child(7) { animation-delay: .3s; }

.project-info { padding: 22px 0 4px; }
.project-info h3 { font-size: 22px; letter-spacing: -.03em; margin-bottom: 8px; }
.project-info p { color: var(--ink-soft); font-size: 14px; line-height: 1.65; max-width: 46ch; }
.project-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding-bottom: 4px;
  font-family: var(--mono); font-size: 11px; border-bottom: 1px solid var(--line-strong);
  transition: color .2s, border-color .2s, gap .25s var(--ease);
}
.project-cta .icon { color: var(--orange-text); }
.project-link:hover .project-cta, .project-link:focus-visible .project-cta { color: var(--orange-text); border-color: var(--orange); gap: 14px; }

.work-note { margin-top: 56px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.work-note a { color: var(--ink); border-bottom: 1px solid var(--orange); }
.work-note a:hover { color: var(--orange-text); }

/* ---------- About ---------- */
.about {
  display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.about h2 { font-size: clamp(38px, 5vw, 68px); margin: 0 0 38px; }
.about-content > p { max-width: 620px; color: var(--ink-soft); line-height: 1.8; }
.about-content > p + p { margin-top: 18px; }

.orbit-mark {
  position: relative; display: grid; place-items: center; width: 140px; height: 140px; margin-top: 45px;
  border: 1px solid var(--line-strong); border-radius: 50%; animation: spin 40s linear infinite;
}
.orbit-mark span { font-family: var(--mono); font-size: 28px; animation: spin 40s linear infinite reverse; }
.orbit-mark::before, .orbit-mark::after {
  content: ''; position: absolute; width: 10px; height: 10px; border: 1px solid var(--orange); border-radius: 50%;
}
.orbit-mark::before { top: 13px; right: 16px; }
.orbit-mark::after { bottom: 26px; left: 4px; background: var(--orange); }

.mini-heading { color: var(--muted); margin-top: 40px; }
.skill-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.skill-list li {
  border: 1px solid var(--line-strong); padding: 8px 13px; font-family: var(--mono); font-size: 11px;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease);
}
.skill-list li:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-2px); }

/* ---------- Education ---------- */
.edu-cert { border-bottom: 1px solid var(--line); }
.info-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.info-block h3 {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 8px;
}
.info-item { border-top: 1px solid var(--line); padding: 20px 0; transition: padding-left .3s var(--ease), border-color .2s; }
.info-item:last-child { border-bottom: 1px solid var(--line); }
.info-item:hover { padding-left: 10px; border-top-color: var(--orange); }
.info-title { font-weight: 700; font-size: 16px; letter-spacing: -.02em; margin-bottom: 6px; }
.info-meta { font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.info-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; margin-top: 8px; }
.badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border: 1px solid var(--orange);
  color: var(--orange-text); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; vertical-align: 1px;
}

/* ---------- Contact ---------- */
.contact {
  background: #151515; color: #f2f0ea; text-align: center;
  padding-top: clamp(95px, 12vw, 175px); padding-bottom: clamp(75px, 9vw, 120px);
}
.contact .kicker { color: #a7a49b; }
.contact h2 { margin: 25px 0 40px; font-size: clamp(48px, 7vw, 105px); }
.contact em { color: #f47a4d; }

.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 18px 24px; }
.contact-email {
  display: inline-flex; align-items: center; gap: 14px; padding-bottom: 11px;
  font-family: var(--mono); font-size: clamp(15px, 2vw, 22px); color: #fff;
  border-bottom: 1px solid #f47a4d; transition: color .2s, gap .25s var(--ease);
  overflow-wrap: anywhere;
}
.contact-email .icon { width: 18px; height: 18px; }
.contact-email:hover { color: #f47a4d; gap: 20px; }

.copy-btn {
  display: inline-grid; grid-auto-flow: column; align-items: center; gap: 8px; padding: 9px 14px;
  background: transparent; color: #f2f0ea; border: 1px solid #4a4c47; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; cursor: pointer; transition: border-color .2s, color .2s;
}
.copy-btn:hover { border-color: #f47a4d; color: #f47a4d; }
.copy-btn .icon-check { display: none; color: #4fbf8a; }
.copy-btn.copied { border-color: #4fbf8a; color: #4fbf8a; }
.copy-btn.copied .icon-copy { display: none; }
.copy-btn.copied .icon-check { display: block; }

.contact-reply { margin-top: 26px; font-size: 13px; color: #a7a49b; }
.contact-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 30px; margin-top: 72px; color: #a7a49b;
}
.contact-meta a { transition: color .2s; }
.contact-meta a:hover { color: #f47a4d; }

footer {
  display: flex; justify-content: space-between; gap: 12px; padding: 23px clamp(24px, 7vw, 112px);
  color: var(--muted); font-size: 10px;
}
footer a:hover { color: var(--orange-text); }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s var(--ease); }
.js .reveal.visible { opacity: 1; transform: none; }
.reveal-delay { transition-delay: .2s !important; }
.reveal-delay-1 { transition-delay: .15s !important; }

@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(79, 191, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 191, 138, 0); } }
@keyframes bar { from { transform: scaleY(.3); } to { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .eyebrow { display: none; }
  .topbar { justify-content: flex-end; }
}

@media (max-width: 850px) {
  .site-shell { display: block; }
  .sidebar { display: none; }
  html { scroll-padding-top: 80px; }

  .topbar { height: 64px; padding: 0 20px; justify-content: space-between; }
  .eyebrow { display: block; font-size: 9px; max-width: 60%; line-height: 1.3; }

  .menu-toggle { display: grid; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 20px 16px; background: var(--paper); border-bottom: 1px solid var(--line); font-size: 13px;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .25s, transform .25s var(--ease), visibility .25s;
  }
  .nav-links.open { visibility: visible; opacity: 1; transform: none; }
  .nav-links a { padding: 15px 0; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a::after { display: none; }
  .nav-links a.active { color: var(--orange-text); }

  .section-pad { padding-left: 22px; padding-right: 22px; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 56px; padding-top: 64px; padding-bottom: 80px; }
  .hero h1 { font-size: clamp(50px, 14vw, 86px); }
  .hero-visual { max-width: 440px; width: 86%; }
  .image-frame { box-shadow: 12px 12px 0 color-mix(in srgb, var(--orange) 85%, transparent); }

  .section-heading { margin-bottom: 42px; }
  .project-grid { grid-template-columns: 1fr; gap: 48px; }
  .project-visual { min-height: 250px; }

  .about { grid-template-columns: 1fr; gap: 30px; }
  .about-aside { display: flex; justify-content: space-between; align-items: center; }
  .orbit-mark { margin: 0; width: 90px; height: 90px; }
  .orbit-mark span { font-size: 20px; }

  .info-columns { grid-template-columns: 1fr; gap: 44px; }
  .contact-meta { margin-top: 56px; gap: 10px 22px; }
  footer { flex-direction: column; align-items: center; text-align: center; padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 420px) {
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .image-stamp { right: -10px; }
}

@media print {
  .sidebar, .topbar, .marquee, .scroll-progress, .copy-btn { display: none !important; }
  .site-shell { display: block; }
  .js .reveal { opacity: 1; transform: none; }
  .contact { background: none; color: #000; }
  .contact .kicker, .contact-reply, .contact-meta, .contact-email { color: #000; }
}
