/* ==========================================================================
   Pavan Dharavath — Portfolio
   Corporate & clean, editorial soul, alive with motion.
   ========================================================================== */

:root {
  --bg: #F5F2ED;
  --bg-elev: #FFFEFB;
  --ink: #14130F;
  --ink-2: #3A382F;
  --ink-3: #6B6759;
  --line: #E4DFD5;
  --line-2: #D2CCBE;
  --accent: oklch(0.52 0.18 262);
  --accent-tint: oklch(0.52 0.18 262 / 0.08);
  --accent-ink: #FFFFFF;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --nav-h: 82px;
  --pad-x: clamp(20px, 5vw, 96px);
  --max-w: 1280px;
}

[data-theme="dark"] {
  --bg: #0E0E0C;
  --bg-elev: #171613;
  --ink: #F5F2ED;
  --ink-2: #C7C2B4;
  --ink-3: #8A8577;
  --line: #2A2823;
  --line-2: #3C3A33;
  --accent: oklch(0.72 0.16 262);
  --accent-tint: oklch(0.72 0.16 262 / 0.12);
  --accent-ink: #0E0E0C;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------------- Nav ---------------- */
.nav {
  position: fixed;
  top: 16px;
  left: var(--pad-x);
  right: var(--pad-x);
  width: min(calc(100% - (var(--pad-x) * 2)), var(--max-w));
  height: 58px;
  margin: 0 auto;
  padding: 0 12px 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 100;
  background: color-mix(in oklab, var(--bg-elev) 72%, transparent);
  backdrop-filter: saturate(1.6) blur(22px);
  -webkit-backdrop-filter: saturate(1.6) blur(22px);
  border: 1px solid color-mix(in oklab, var(--line) 76%, transparent);
  border-radius: 999px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.58) inset,
    0 18px 46px rgba(20, 19, 15, 0.12);
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.nav.scrolled {
  background: color-mix(in oklab, var(--bg-elev) 84%, transparent);
  border-color: color-mix(in oklab, var(--accent) 28%, var(--line));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.64) inset,
    0 20px 54px rgba(20, 19, 15, 0.16);
}
.nav.nav--closed {
  transform: translateY(calc(-100% - 24px)) scale(0.98);
  opacity: 0;
  pointer-events: none;
}
.nav__brand {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
  min-width: max-content;
  padding: 8px 10px 8px 0;
}
.nav__brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}
.nav__links {
  display: flex; align-items: center; gap: 4px;
  font-size: 14px; font-weight: 500;
  padding: 4px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 42%, transparent);
  border: 1px solid color-mix(in oklab, var(--line) 54%, transparent);
}
.nav__links a {
  padding: 9px 15px; border-radius: 999px;
  color: var(--ink-2);
  transition: color 0.22s, background 0.22s, transform 0.22s, box-shadow 0.22s, border-color 0.22s;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  outline: none;
}
.nav__links a::before {
  content: "";
  position: absolute;
  inset: -42%;
  z-index: -1;
  opacity: 0;
  transform: scale(0.72);
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 28%, transparent) 0%, color-mix(in oklab, var(--accent) 10%, transparent) 46%, transparent 70%);
  transition: opacity 0.26s ease, transform 0.26s ease;
}
.nav__links a:hover,
.nav__links a:focus-visible {
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(20, 19, 15, 0.08);
}
.nav__links a:hover::before,
.nav__links a:focus-visible::before {
  opacity: 1;
  transform: scale(1);
}
.nav__links a.active {
  color: var(--ink);
  background: color-mix(in oklab, var(--accent) 12%, var(--bg-elev));
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 20%, transparent) inset;
}
.nav__cta {
  padding: 10px 18px !important;
  background: linear-gradient(135deg, var(--ink), color-mix(in oklab, var(--accent) 48%, var(--ink)));
  color: var(--bg) !important;
  border-radius: 999px;
  margin-left: 8px;
  box-shadow: 0 10px 24px rgba(20, 19, 15, 0.18);
}
.nav__cta:hover,
.nav__cta:focus-visible {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 62%, var(--ink))) !important;
  color: var(--accent-ink) !important;
  box-shadow: 0 14px 30px color-mix(in oklab, var(--accent) 26%, transparent);
}

@media (max-width: 720px) {
  .nav {
    top: 12px;
    height: 56px;
    padding: 0 8px 0 14px;
  }
  .nav__brand {
    font-size: 20px;
    max-width: 52vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav__links {
    background: transparent;
    border: 0;
    padding: 0;
  }
  .nav__links a:not(.nav__cta) { display: none; }
  .nav__links a.nav__cta { display: inline-block; }
  .nav__cta { margin-left: 0; padding: 9px 14px !important; }
}

/* ---------------- Layout primitives ---------------- */
main { padding-top: calc(var(--nav-h) + 6px); }
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.section { padding: clamp(80px, 12vw, 160px) 0; position: relative; }
.section--tight { padding: clamp(48px, 8vw, 96px) 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: currentColor;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; line-height: 1.05; }
.display {
  font-family: var(--serif);
  font-size: clamp(56px, 10vw, 148px);
  line-height: 0.96;
  letter-spacing: -0.035em;
}
.h1 { font-size: clamp(44px, 6vw, 84px); line-height: 1; }
.h2 { font-size: clamp(34px, 4.4vw, 64px); line-height: 1.02; }
.h3 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; }

.lead {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 62ch;
}

.italic { font-style: italic; font-family: var(--serif); }
.mono { font-family: var(--mono); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 15px; font-weight: 500;
  transition: transform 0.2s ease, background 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.btn--ghost { border: 1px solid var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn__arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}
.btn:hover .btn__arrow { transform: translate(3px, -3px); }

/* ---------------- Pills / tags ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--bg-elev);
}
.pill--live { border-color: color-mix(in oklab, var(--accent) 40%, var(--line-2)); }
.pill__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22,163,74,0.5);
  animation: pulseDot 1.8s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
}

/* ---------------- Motion reveals ---------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s cubic-bezier(0.22,1,0.36,1), transform 0.9s cubic-bezier(0.22,1,0.36,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.4s; }

.word-reveal { display: inline-block; overflow: hidden; vertical-align: bottom; }
.word-reveal > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.9s cubic-bezier(0.22,1,0.36,1);
}
.word-reveal.in > span { transform: none; }

/* ---------------- Footer ---------------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 80px var(--pad-x) 40px;
  margin-top: 40px;
}
.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 780px) { .footer__inner { grid-template-columns: 1fr; gap: 40px; } }
.footer__brand { font-family: var(--serif); font-size: 44px; letter-spacing: -0.02em; line-height: 1; }
.footer__tag { color: var(--ink-3); font-size: 14px; margin-top: 14px; max-width: 32ch; }
.footer__col h4 {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-3); margin-bottom: 18px;
}
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer__col a { color: var(--ink-2); font-size: 15px; transition: color 0.2s; }
.footer__col a:hover { color: var(--accent); }
.footer__bottom {
  max-width: var(--max-w);
  margin: 60px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
}
@media (max-width: 620px) { .footer__bottom { flex-direction: column; gap: 8px; } }

/* ---------------- Cursor blob ---------------- */
.cursor-blob {
  position: fixed;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--accent) 0%, transparent 60%);
  opacity: 0.12;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: transform 0.7s cubic-bezier(0.16,1,0.3,1);
  mix-blend-mode: multiply;
  filter: blur(20px);
}
[data-theme="dark"] .cursor-blob { mix-blend-mode: screen; opacity: 0.22; }

/* ---------------- Utilities ---------------- */
.grain::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------------- Technology showcase ---------------- */
.tech-showcase {
  position: relative;
  overflow: hidden;
  padding: clamp(88px, 12vw, 150px) 0;
  isolation: isolate;
  background:
    radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 30%), color-mix(in oklab, var(--accent) 24%, transparent), transparent 30%),
    linear-gradient(135deg, color-mix(in oklab, var(--accent) 12%, var(--bg)) 0%, var(--bg) 36%, color-mix(in oklab, #16a34a 10%, var(--bg)) 100%);
}
.tech-showcase::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(circle at 18% 18%, color-mix(in oklab, var(--accent) 24%, transparent), transparent 24%),
    radial-gradient(circle at 84% 28%, rgba(22, 163, 74, 0.16), transparent 25%),
    radial-gradient(circle at 48% 88%, rgba(14, 165, 233, 0.16), transparent 28%);
  filter: blur(34px);
  animation: techMesh 18s ease-in-out infinite alternate;
}
.tech-showcase::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(color-mix(in oklab, var(--bg-elev) 60%, transparent), color-mix(in oklab, var(--bg) 78%, transparent)),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='0.24' filter='url(%23n)'/%3E%3C/svg%3E");
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
@keyframes techMesh {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 1%, 0) scale(1.04); }
}
.tech-showcase__head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: end;
  margin-bottom: clamp(38px, 6vw, 70px);
}
.tech-showcase__badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid color-mix(in oklab, var(--accent) 34%, var(--line));
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg-elev) 70%, transparent);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 24px;
  backdrop-filter: blur(18px);
}
.tech-showcase__title {
  font-family: var(--serif);
  font-size: clamp(46px, 7.5vw, 108px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  max-width: 10ch;
}
.tech-showcase__copy {
  color: var(--ink-2);
  font-size: clamp(17px, 1.5vw, 21px);
  max-width: 56ch;
}
.tech-showcase__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.tech-marquee {
  display: grid;
  gap: 16px;
  margin-inline: calc(var(--pad-x) * -1);
  padding: 4px 0;
}
.tech-marquee__row {
  display: flex;
  width: max-content;
  gap: 16px;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  animation: techScroll 42s linear infinite;
}
.tech-marquee__row:nth-child(2) {
  animation-name: techScrollReverse;
  animation-duration: 50s;
}
.tech-marquee__row:nth-child(3) { animation-duration: 58s; }
.tech-marquee:hover .tech-marquee__row { animation-play-state: paused; }
@keyframes techScroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
@keyframes techScrollReverse {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}
.tech-card {
  --card-glow: color-mix(in oklab, var(--accent) 30%, transparent);
  position: relative;
  flex: 0 0 158px;
  min-height: 150px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid color-mix(in oklab, var(--line) 82%, var(--accent));
  border-radius: 18px;
  background: color-mix(in oklab, var(--bg-elev) 68%, transparent);
  box-shadow: 0 16px 34px rgba(20, 19, 15, 0.08);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.28s, box-shadow 0.28s, background 0.28s;
  outline: none;
}
.tech-card::before {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(-50%, 6px);
  opacity: 0;
  pointer-events: none;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
}
.tech-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid transparent;
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 72%, transparent), transparent 34%, rgba(14, 165, 233, 0.55)) border-box;
  mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.28s;
}
.tech-card:hover,
.tech-card:focus-visible {
  transform: translate3d(0, -8px, 0) scale(1.08);
  border-color: color-mix(in oklab, var(--accent) 68%, var(--line));
  background: color-mix(in oklab, var(--bg-elev) 86%, transparent);
  box-shadow: 0 24px 48px rgba(59, 91, 219, 0.22), 0 0 0 5px var(--card-glow);
  z-index: 4;
}
.tech-card:hover::before,
.tech-card:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}
.tech-card:hover::after,
.tech-card:focus-visible::after { opacity: 1; }
.tech-card__logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 22px rgba(20, 19, 15, 0.08);
}
.tech-card__logo svg {
  width: 28px;
  height: 28px;
}
.tech-card__fallback {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tech-card__name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
}
.tech-card__category {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 7px;
}
.tech-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(38px, 6vw, 64px);
}
.tech-stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  background: color-mix(in oklab, var(--bg-elev) 72%, transparent);
  backdrop-filter: blur(18px);
}
.tech-stat__value {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 74px);
  line-height: 1;
  letter-spacing: -0.03em;
}
.tech-stat__label {
  margin-top: 10px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
@media (max-width: 980px) {
  .tech-showcase__head { grid-template-columns: 1fr; }
  .tech-card { flex-basis: 148px; }
  .tech-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tech-showcase { padding: 72px 0; }
  .tech-marquee {
    overflow-x: auto;
    margin-right: calc(var(--pad-x) * -1);
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
  }
  .tech-marquee__row {
    animation: none;
    padding-left: var(--pad-x);
  }
  .tech-marquee__row:nth-child(2),
  .tech-marquee__row:nth-child(3) { display: none; }
  .tech-card {
    flex-basis: 132px;
    min-height: 132px;
    padding: 15px;
    border-radius: 16px;
    scroll-snap-align: start;
  }
  .tech-card__logo { width: 40px; height: 40px; }
  .tech-card__logo img { width: 24px; height: 24px; }
  .tech-stats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .tech-showcase::before,
  .tech-marquee__row { animation: none; }
  .tech-card:hover,
  .tech-card:focus-visible { transform: translateY(-4px); }
}

/* Photo Slot Component */
.photo-slot {
  aspect-ratio: 3/4;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.25);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.photo-slot:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 50px -15px rgba(0, 0, 0, 0.35);
}
.photo-slot__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.photo-slot:hover .photo-slot__img {
  transform: scale(1.05);
}

