/* ═══════════════════════════════════════════════════
   SONAL KANDHWAY — PORTFOLIO
   style.css  |  Shared tokens, reset, nav, footer
═══════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --accent:       #5B7BF8;
  --accent-2:     #8BA3FF;
  --accent-dim:   rgba(91, 123, 248, 0.10);
  --accent-glow:  rgba(91, 123, 248, 0.18);

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --font-d: 'Inter', system-ui, sans-serif;
  --font-b: 'Inter', system-ui, sans-serif;
  --font-m: 'Inter', system-ui, sans-serif;
}

/* ── Dark Theme — Refined Blue (true neutrals) ── */
[data-theme="dark"] {
  --bg:       #0E0E10;
  --surface:  #161618;
  --card:     #1D1D20;
  --card-h:   #26262A;
  --border:   rgba(91, 123, 248, 0.10);
  --border-s: rgba(91, 123, 248, 0.22);
  --ink-1:    #FAFAFA;
  --ink-2:    #A0A0A4;
  --ink-3:    #898993;
  --shadow:   0 8px 32px rgba(0, 0, 0, 0.5);
  --glow:     0 0 60px rgba(91, 123, 248, 0.12);
}

/* ── Light Theme — Crisp White (true neutrals) ── */
[data-theme="light"] {
  --bg:       #FAFAFA;
  --surface:  #FFFFFF;
  --card:     #F0F0F1;
  --card-h:   #E6E6E8;
  --border:   rgba(42, 66, 224, 0.10);
  --border-s: rgba(42, 66, 224, 0.30);
  --ink-1:    #0A0A0B;
  --ink-2:    #3D3D42;
  --ink-3:    #686870;
  --accent:   #2A42E0;
  --accent-2: #5B7BF8;
  --shadow:   0 8px 32px rgba(42, 66, 224, 0.08);
  --glow:     0 0 60px rgba(42, 66, 224, 0.05);
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
body {
  background: var(--bg);
  color: var(--ink-1);
  font-family: var(--font-b);
  font-weight: 400;        /* WCAG: was 300 — too thin for body */
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s, color 0.4s;
}
a    { color: inherit; text-decoration: none; }
img  { display: block; max-width: 100%; }
ul   { list-style: none; }

/* ── Noise Overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.3;
}

/* ── Custom Cursor ── */
.cur, .cur-r {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}
/* Dot — snaps instantly */
.cur {
  width: 6px;
  height: 6px;
  background: var(--accent);
  transition: width .2s var(--ease-out), height .2s var(--ease-out), opacity .2s;
}
/* Ring — trails smoothly */
.cur-r {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(91,123,248,.35);
  background: transparent;
  transition: width .3s var(--ease-out), height .3s var(--ease-out),
              border-color .3s, background .3s, border-radius .3s;
}
/* Hover over links / buttons — dot shrinks, ring inflates and fills slightly */
body:has(a:hover) .cur,
body:has(button:hover) .cur {
  width: 4px;
  height: 4px;
  opacity: .6;
}
body:has(a:hover) .cur-r,
body:has(button:hover) .cur-r {
  width: 56px;
  height: 56px;
  border-color: var(--accent);
  background: rgba(91,123,248,.07);
}
/* Hover over images — show zoom icon intent */
body:has(img:hover) .cur-r {
  width: 48px;
  height: 48px;
  border-color: rgba(255,255,255,.5);
  border-radius: 8px;
}

/* ── Scroll Progress Bar ── */
#prog {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 200;
  width: 0;
  transition: width 0.1s;
}

/* ── Navigation ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding 0.4s var(--ease-out), background 0.4s, border-color 0.4s;
}
nav.stuck {
  background: rgba(14, 14, 16, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 56px;
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] nav.stuck {
  background: rgba(250, 250, 250, 0.9);
}

.nav-logo-wrap   { display: flex; align-items: center; }
.nav-logo-img    { object-fit: contain; cursor: pointer; display: block; }
[data-theme="dark"]  .logo-dark  { display: block; }
[data-theme="dark"]  .logo-light { display: none;  }
[data-theme="light"] .logo-dark  { display: none;  }
[data-theme="light"] .logo-light { display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;             /* was unset (defaulted to 300) — now medium */
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);          /* was --ink-3 (too dim) — now --ink-2 (readable) */
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
}
.nav-links a:hover              { color: var(--ink-1); }
.nav-links a:hover::after       { width: 100%; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-cta {
  background: var(--accent);
  color: #fff !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.06em;
  padding: 9px 22px;
  border-radius: 100px;
  transition: opacity 0.2s, transform 0.2s !important;
}
.nav-cta:hover        { opacity: 0.88; transform: translateY(-1px); }
.nav-cta::after       { display: none !important; }

/* ── Theme Toggle ── */
.theme-btn {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border-s);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.3s;
}
.theme-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.35s var(--ease-spring);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
}
[data-theme="light"] .theme-knob { transform: translateX(20px); }

/* ── Section Shared ── */
section      { padding: 120px 56px; }
.divider     {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 56px;
}

.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.ey-line {
  width: 28px;
  height: 1px;
  background: var(--accent);
}
.ey-txt {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  font-family: var(--font-m);
}
.section-title {
  font-family: var(--font-d);
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink-1);
}
.section-title em { font-style: italic; color: var(--ink-2); }

/* ── Scroll Reveal ── */
.rv {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.rv.on { opacity: 1; transform: translateY(0); }
.rv.d1 { transition-delay: 0.1s; }
.rv.d2 { transition-delay: 0.2s; }
.rv.d3 { transition-delay: 0.3s; }
.rv.d4 { transition-delay: 0.4s; }

/* ── Animations ── */
@keyframes up   { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin  { to { transform: rotate(360deg); } }

/* ── Footer ── */
footer {
  padding: 28px 56px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}
.ft-copy, .ft-made {
  font-size: 0.72rem;
  color: var(--ink-3);
  font-family: var(--font-m);
}
.ft-copy {
  display: flex;
  align-items: center;
  gap: 14px;
}
/* Footer logo — only one shown based on theme */
.ft-logo {
  height: 64px;          /* large, prominent */
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
/* Theme-based visibility — !important to defeat any earlier display rules */
[data-theme="dark"]  .ft-logo.logo-dark   { display: block !important; }
[data-theme="dark"]  .ft-logo.logo-light  { display: none  !important; }
[data-theme="light"] .ft-logo.logo-dark   { display: none  !important; }
[data-theme="light"] .ft-logo.logo-light  { display: block !important; }

/* ══════════════════════════════════════════
   HAMBURGER MENU
══════════════════════════════════════════ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink-1);
  border-radius: 2px;
  transition: transform 0.35s var(--ease-spring), opacity 0.2s, width 0.3s;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 105;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}
.mobile-nav.open {
  opacity: 1;
  pointer-events: all;
}
.mobile-nav a {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--ink-2);
  padding: 12px 24px;
  transition: color 0.2s, transform 0.2s;
  transform: translateY(12px);
  opacity: 0;
  text-decoration: none;
}
.mobile-nav.open a {
  opacity: 1;
  transform: translateY(0);
}
.mobile-nav.open a:nth-child(1) { transition-delay: 0.05s; }
.mobile-nav.open a:nth-child(2) { transition-delay: 0.10s; }
.mobile-nav.open a:nth-child(3) { transition-delay: 0.15s; }
.mobile-nav.open a:nth-child(4) { transition-delay: 0.20s; }
.mobile-nav.open a:nth-child(5) { transition-delay: 0.25s; }
.mobile-nav.open a:nth-child(6) { transition-delay: 0.30s; }
.mobile-nav a:hover { color: var(--accent); transform: translateX(6px); }

.mobile-nav-cta {
  margin-top: 24px;
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 100px;
  padding: 14px 36px !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em;
}
.mobile-nav-footer {
  position: absolute;
  bottom: 40px;
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

/* ══════════════════════════════════════════
   BREAKPOINT — TABLET  ≤ 900px
══════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Nav */
  nav                           { padding: 16px 20px; }
  nav.stuck                     { padding: 12px 20px; }
  .nav-links                    { display: none; }         /* hide desktop links */
  .hamburger                    { display: flex; }         /* show hamburger */
  .mobile-nav                   { display: flex; }         /* enable drawer */

  /* Layout */
  section                       { padding: 80px 20px; }
  .divider                      { margin: 0 20px; }

  /* Footer */
  footer                        { flex-direction: column; gap: 8px; text-align: center; padding: 20px; }
  .ft-copy                      { justify-content: center; }
}

/* ══════════════════════════════════════════
   BREAKPOINT — LARGE PHONE  ≤ 600px
══════════════════════════════════════════ */
@media (max-width: 600px) {
  section                       { padding: 64px 16px; }
  .divider                      { margin: 0 16px; }
  .section-title                { font-size: clamp(1.9rem, 7vw, 2.6rem); }
}

/* ══════════════════════════════════════════
   HEURISTIC IMPROVEMENTS
══════════════════════════════════════════ */

/* ── Skip to Main Content Link (a11y) ── */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  z-index: 99999;
  text-decoration: none;
  border-radius: 0 0 12px 12px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: top 0.25s var(--ease-out);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.skip-link:focus {
  top: 0;
  outline: none;
}

/* ── Visible Keyboard Focus Styles ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.cf-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}
/* Disable focus ring on mouse clicks (only show for keyboard) */
:focus:not(:focus-visible) { outline: none; }

/* ── Active Nav Link Indicator ── */
.nav-links a.active {
  color: var(--ink-1);
}
.nav-links a.active::after {
  width: 100%;
}
.mobile-nav a.active {
  color: var(--accent);
}

/* ── Back to Top Button ── */
.back-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  box-shadow: 0 6px 20px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s, background 0.2s;
}
.back-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-top:hover {
  background: var(--accent-2);
  transform: translateY(-3px);
}
.back-top svg { transition: transform 0.2s; }
.back-top:hover svg { transform: translateY(-2px); }

@media (max-width: 600px) {
  .back-top { bottom: 20px; right: 20px; width: 44px; height: 44px; }
}

/* ── Hide Custom Cursor on Touch Devices ── */
@media (hover: none) and (pointer: coarse) {
  .cur, .cur-r { display: none !important; }
}

/* ── Larger Touch Targets on Mobile ── */
@media (hover: none) {
  .hamburger { width: 44px; height: 44px; }
}

/* ════════════════════════════════════════
   LUCIDE ICON GLOBAL RULES
════════════════════════════════════════ */

/* All Lucide SVGs — base reset */
[data-lucide] { display: inline-flex; }

/* Nav back arrow */
.nav-back svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* Back-to-top button */
.back-top svg {
  width: 20px; height: 20px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Hero CTA buttons */
.btn-p svg, .btn-g svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* Download CV icon */
.btn-g svg {
  width: 14px; height: 14px;
}

/* nc-arrow (next case study cards) */
.nc-arrow svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Figma icon in agni.html links */
.figma-link svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

/* External link icon */
a svg {
  stroke: currentColor; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Project card placeholder icons */
.project-img-slot i svg {
  stroke: currentColor; fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Lightbox ─────────────────────────────────────────── */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lb-overlay.lb-open {
  opacity: 1;
  visibility: visible;
}
.lb-img-wrap {
  position: relative;
  max-width: min(90vw, 1200px);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img-wrap img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  display: block;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  transform: scale(.94);
  transition: transform .28s cubic-bezier(.22,1,.36,1);
  object-fit: contain;
}
.lb-overlay.lb-open .lb-img-wrap img {
  transform: scale(1);
}
.lb-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  transition: background .15s ease, transform .15s ease;
  z-index: 10000;
}
.lb-close:hover {
  background: rgba(255,255,255,.22);
  transform: scale(1.1);
}
/* Make every case-study image feel clickable */
.cs-hero-screenshot,
.cs-hero-img img,
.cp-screen-cell img,
.ba-img,
.agni-img img {
  cursor: zoom-in;
}
