/* ─────────────────────────────────────────────
   sachinpa.tel — Portfolio
   Built with Claude Code
   ───────────────────────────────────────────── */

:root {
  --bg: #0a0a0a;
  --bg-elev: #0f0f10;
  --surface: #131316;
  --surface-2: #1a1a1d;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-subtle: #71717a;
  --text-faint: #52525b;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --accent-glow: rgba(245, 158, 11, 0.35);
  --green: #10b981;

  --max: 1180px;
  --pad: clamp(20px, 4vw, 56px);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms var(--ease);
}

button {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

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

/* ───── Background grain + glow ───── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.05 0 0 0 0 0.05 0 0 0 0 0.05 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 480px;
  height: 480px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    circle,
    rgba(245, 158, 11, 0.08) 0%,
    rgba(245, 158, 11, 0.02) 30%,
    transparent 60%
  );
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 400ms var(--ease);
  opacity: 0;
  filter: blur(40px);
}

body.cursor-active .cursor-glow {
  opacity: 1;
}

/* ───── Layout helpers ───── */
.section {
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(80px, 12vw, 160px) var(--pad);
  position: relative;
  z-index: 2;
}

.section__head {
  margin-bottom: clamp(40px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section__num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section__title {
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--text);
}

.section__sub {
  color: var(--text-muted);
  max-width: 56ch;
  font-size: 17px;
  line-height: 1.6;
}

/* ───── Nav ───── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms var(--ease), background 300ms var(--ease);
}

.nav.is-scrolled {
  border-color: var(--border);
  background: rgba(10, 10, 10, 0.85);
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.nav__mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}

.nav__links {
  display: flex;
  gap: clamp(18px, 3vw, 32px);
  font-size: 14px;
  color: var(--text-muted);
}

.nav__links a {
  position: relative;
  padding: 6px 2px;
}

.nav__links a:hover {
  color: var(--text);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 250ms var(--ease);
}

.nav__links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

@media (max-width: 540px) {
  .nav__name {
    display: none;
  }
}

/* ───── Hero ───── */
.hero {
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(140px, 18vw, 200px) var(--pad) clamp(80px, 12vw, 120px);
  position: relative;
  z-index: 2;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero__inner {
  max-width: 900px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: start;
}

.hero__photo {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  margin: 0;
  position: relative;
  z-index: 1;
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero__body {
  min-width: 0;
}

@media (min-width: 880px) {
  .hero__inner {
    grid-template-columns: 1fr 240px;
    gap: 64px;
  }

  .hero__body {
    grid-column: 1;
    grid-row: 1;
  }

  .hero__photo {
    grid-column: 2;
    grid-row: 1;
    max-width: 240px;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-bottom: 36px;
}

.eyebrow__flag {
  width: 22px;
  height: 11px;
  border-radius: 1.5px;
  display: block;
  flex: none;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.15);
}

.hero__title {
  font-size: clamp(44px, 6.6vw, 88px);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.038em;
  color: var(--text);
}

.hero__title .line {
  display: block;
}

.hero__title .muted {
  color: var(--text-muted);
  margin-top: 18px;
  font-weight: 500;
  font-size: clamp(22px, 2.6vw, 34px);
  letter-spacing: -0.018em;
  line-height: 1.28;
  max-width: 28ch;
}

.hero__title .muted em {
  font-family: var(--font-sans);
  font-style: italic;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.018em;
  padding-right: 0;
}

.hero__title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.02em;
  padding-right: 0.04em;
}

.hero__lede {
  margin-top: 24px;
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 56ch;
  letter-spacing: -0.005em;
}

.hero__lede:first-of-type {
  margin-top: 36px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 44px;
}

.hero__meta {
  position: absolute;
  right: var(--pad);
  bottom: clamp(32px, 6vw, 60px);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__meta-time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .hero__meta {
    position: static;
    margin-top: 48px;
  }
}

/* ───── Buttons ───── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform 200ms var(--ease), background 200ms var(--ease),
    border-color 200ms var(--ease), color 200ms var(--ease);
  cursor: pointer;
}

.btn--primary {
  background: var(--text);
  color: var(--bg);
}

.btn--primary:hover {
  transform: translateY(-1px);
  background: #ffffff;
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

.btn--ghost:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
}

/* ───── Links ───── */
.link {
  color: var(--text);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color 200ms var(--ease), background-size 280ms var(--ease);
  padding-bottom: 1px;
}

.link:hover {
  color: var(--accent);
}

/* ───── Work ───── */
.work .section__head {
  margin-bottom: clamp(56px, 8vw, 96px);
}

.projects {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 40px);
}

@media (min-width: 880px) {
  .projects {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

.project {
  list-style: none;
}

.project__link {
  display: block;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  outline: none;
}

.project__link:focus-visible .project__card {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.project__card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    180deg,
    var(--surface) 0%,
    var(--bg-elev) 100%
  );
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  height: 100%;
  transition: border-color 300ms var(--ease), transform 400ms var(--ease),
    box-shadow 400ms var(--ease);
  isolation: isolate;
}

.project__card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    480px circle at var(--mx, 50%) var(--my, 50%),
    rgba(245, 158, 11, 0.07),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 400ms var(--ease);
  pointer-events: none;
  z-index: 1;
}

.project__link:hover .project__card {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--border);
}

.project__link:hover .project__card::before {
  opacity: 1;
}

.project__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.project__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 700ms var(--ease);
  background: var(--bg);
}

.project__link:hover .project__image {
  transform: scale(1.025);
}

.project__body {
  padding: clamp(20px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  position: relative;
  z-index: 2;
}

.project__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project__title {
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
}

.project__desc {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 52ch;
}

.project__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-subtle);
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.02);
}

.project__cta {
  margin-top: auto;
  padding-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  transition: color 250ms var(--ease), gap 250ms var(--ease);
}

.project__cta svg {
  transition: transform 300ms var(--ease);
}

.project__link:hover .project__cta {
  color: var(--accent);
}

.project__link:hover .project__cta svg {
  transform: translate(2px, -2px);
}

/* ───── Connect ───── */
.connect {
  text-align: center;
}

.connect__inner {
  max-width: 760px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.connect__title {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-top: 8px;
}

.connect__title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.connect__sub {
  color: var(--text-muted);
  max-width: 40ch;
  font-size: 17px;
}

.connect__email {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 18px 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  font-size: clamp(18px, 2.4vw, 24px);
  letter-spacing: -0.015em;
  font-weight: 500;
  transition: border-color 300ms var(--ease), background 300ms var(--ease),
    transform 300ms var(--ease);
}

.connect__email:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  background: var(--bg-elev);
}

.connect__email svg {
  transition: transform 300ms var(--ease);
}

.connect__email:hover svg {
  transform: translate(3px, -3px);
}

.connect__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(18px, 3vw, 28px);
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

.connect__links a:hover {
  color: var(--text);
}

/* ───── Footer ───── */
.footer {
  max-width: var(--max);
  margin-inline: auto;
  padding: 32px var(--pad) 56px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  position: relative;
  z-index: 2;
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.footer__dot {
  color: var(--text-faint);
  opacity: 0.5;
}

.footer__sub {
  color: var(--text-subtle);
}

/* ───── Reveal animations ───── */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger reveal for hero items */
.hero [data-reveal]:nth-child(1) { transition-delay: 0ms; }
.hero [data-reveal]:nth-child(2) { transition-delay: 80ms; }
.hero [data-reveal]:nth-child(3) { transition-delay: 160ms; }
.hero [data-reveal]:nth-child(4) { transition-delay: 240ms; }
.hero [data-reveal]:nth-child(5) { transition-delay: 320ms; }

/* ───── Reduced motion ───── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .cursor-glow {
    display: none;
  }
}

/* ───── Mobile niceties ───── */
@media (max-width: 540px) {
  .hero {
    min-height: 86vh;
  }

  .hero__title {
    letter-spacing: -0.035em;
  }

  .nav {
    padding: 14px var(--pad);
  }

  .footer__row {
    flex-direction: column;
    gap: 4px;
  }

  .footer__dot {
    display: none;
  }
}

/* ───── Focus styles ───── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
