/*
  Tejesh Mattaparthi Portfolio — Pro Atelier v3
  Direction: Vercel precision + Linear dark depth + Runway cinematic imagery + Apple whitespace.
  Surface: Decide/Learn portfolio; one clear idea lands per section.
*/
:root {
  color-scheme: dark;
  --bg: #050507;
  --bg-2: #090a0d;
  --ink: #f7f8f8;
  --muted: #a9b0bd;
  --dim: #6f7786;
  --panel: rgba(255,255,255,.035);
  --panel-2: rgba(255,255,255,.06);
  --panel-3: rgba(255,255,255,.09);
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.16);
  --violet: #7c73ff;
  --blue: #1c8fff;
  --pink: #ff4faf;
  --ship: #ff624f;
  --success: #32d583;
  --cream: #f5f1ea;
  --cream-text: #141416;
  --cream-muted: #5e6067;
  --max: 1200px;
  --sans: 'Geist', Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --serif: 'Instrument Serif', Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-feature-settings: "liga", "cv01", "ss03";
  background:
    radial-gradient(circle at 18% 9%, rgba(124,115,255,.28), transparent 34rem),
    radial-gradient(circle at 88% 0%, rgba(28,143,255,.18), transparent 28rem),
    radial-gradient(circle at 68% 52%, rgba(255,79,175,.08), transparent 32rem),
    linear-gradient(180deg, var(--bg), var(--bg-2) 45%, #050507);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .16;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 12%, #000 0 24%, transparent 76%);
}

#neural-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .42;
}
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .08;
  background-image: radial-gradient(circle, #fff 0 1px, transparent 1.4px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}
main, header, footer { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
p { margin: 0; color: var(--muted); }
ul { color: var(--muted); }
img { max-width: 100%; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-150%);
  padding: .72rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: #050507;
  font-weight: 700;
}
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(5,5,7,.64);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: background .2s ease, border-color .2s ease;
}
.site-header[data-elevated="true"] { background: rgba(5,5,7,.9); border-color: var(--line); }
.nav {
  max-width: var(--max);
  min-height: 72px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .7rem; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(124,115,255,.96), rgba(28,143,255,.92));
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -.05em;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 16px 40px rgba(28,143,255,.22);
}
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: .95rem; font-weight: 600; letter-spacing: -.025em; }
.brand-copy small { color: var(--dim); font-size: .72rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.nav-links { display: flex; align-items: center; gap: .18rem; }
.nav-links a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: .62rem .78rem;
  color: #d8dce5;
  border-radius: 8px;
  font-size: .86rem;
  font-weight: 500;
}
.nav-links a:hover, .nav-links a:focus-visible { background: rgba(255,255,255,.06); color: #fff; }
.nav-cta { margin-left: .35rem; background: #fff !important; color: #101014 !important; }
.nav-toggle { display: none; }

.hero {
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 72px);
  padding: clamp(4rem, 7vw, 7.25rem) 1.25rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .82fr);
  grid-template-areas: "copy visual" "strip strip";
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
}
.hero-copy { grid-area: copy; }
.kicker, .section-label, .case-top span, .case-top p, time {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #c7c9ff;
}
.kicker { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035); }
.kicker span, .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 20px var(--success); }
.hero h1 {
  max-width: 11.2ch;
  margin: 1.15rem 0 0;
  font-size: clamp(4rem, 8vw, 8.7rem);
  line-height: .86;
  letter-spacing: clamp(-.38rem, -.55vw, -.14rem);
  text-wrap: balance;
}
.hero-lede {
  max-width: 64ch;
  margin-top: 1.45rem;
  color: #c8ceda;
  font-size: clamp(1.05rem, 1.45vw, 1.25rem);
  line-height: 1.62;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-actions.centered { justify-content: center; }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .82rem 1.05rem;
  border-radius: 9px;
  font-weight: 600;
  letter-spacing: -.01em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  will-change: transform;
}
.button:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgba(28,143,255,.5); outline-offset: 3px; }
.primary { background: linear-gradient(135deg, #fff, #dfe6ff); color: #050507; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 18px 60px rgba(124,115,255,.22); }
.secondary { background: rgba(255,255,255,.055); color: #fff; box-shadow: 0 0 0 1px var(--line); }
.ghost { color: #dce2f2; box-shadow: 0 0 0 1px var(--line); }
.button:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 18px 70px rgba(28,143,255,.2); }

.hero-visual { grid-area: visual; position: relative; min-height: 680px; }
.portrait-card {
  position: absolute;
  inset: 0 0 70px 58px;
  overflow: hidden;
  border-radius: 28px;
  background: #11131a;
  box-shadow: 0 0 0 1px var(--line-strong), 0 34px 120px rgba(0,0,0,.5);
}
.portrait-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, transparent 44%, rgba(5,5,7,.88)), linear-gradient(90deg, rgba(5,5,7,.2), transparent 42%);
}
.portrait-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 45%;
  transform: scale(1.03);
  filter: saturate(1.04) contrast(1.04);
  transition: transform .7s ease;
}
.portrait-card:hover img { transform: scale(1.07); }
.portrait-glow {
  position: absolute;
  inset: auto -20% -18% -20%;
  height: 42%;
  z-index: 3;
  background: radial-gradient(circle, rgba(124,115,255,.5), transparent 68%);
  filter: blur(12px);
}
.availability-card {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(6,7,11,.7);
  backdrop-filter: blur(18px);
  box-shadow: 0 0 0 1px rgba(255,255,255,.14);
}
.availability-card strong { display: block; }
.availability-card small { color: var(--muted); }
.system-console {
  position: absolute;
  left: 0;
  right: 26%;
  bottom: 0;
  z-index: 5;
  border-radius: 18px;
  background: rgba(9,10,14,.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 0 0 1px var(--line-strong), 0 25px 80px rgba(0,0,0,.4);
  overflow: hidden;
}
.console-top { display: flex; align-items: center; gap: .38rem; padding: .75rem .85rem; border-bottom: 1px solid var(--line); }
.console-top span { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.console-top span:nth-child(2) { background: #ffbd2e; }
.console-top span:nth-child(3) { background: #28c840; }
.console-top b { margin-left: .55rem; color: var(--dim); font-family: var(--mono); font-size: .72rem; font-weight: 500; }
pre { margin: 0; padding: 1rem; white-space: pre-wrap; color: #dce6ff; font-family: var(--mono); font-size: .82rem; line-height: 1.65; }

.signal-strip {
  grid-area: strip;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .8rem;
}
.signal-strip div, .metrics article, .case-card, .timeline-item, .pipeline article, .skill-bento article, .chat-shell {
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 0 0 1px var(--line);
}
.signal-strip div { min-height: 112px; padding: 1rem; border-radius: 18px; }
.signal-strip b { display: block; font-size: 1.05rem; letter-spacing: -.03em; }
.signal-strip span { display: block; margin-top: .35rem; color: var(--dim); font-size: .92rem; }

.metrics {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .8rem;
}
.metrics article { padding: 1.1rem; border-radius: 20px; }
.metrics span { display: block; color: #c7c9ff; font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.metrics strong { display: inline-block; margin-top: 1rem; font-size: clamp(2.7rem, 5vw, 5.1rem); line-height: .82; letter-spacing: -.09em; }
.metrics em { font-style: normal; color: #fff; font-size: 1rem; font-weight: 600; }
.metrics p { margin-top: .9rem; font-size: .9rem; color: #8f97a8; }

.section { padding: clamp(5rem, 8vw, 8.5rem) 1.25rem; }
.section-shell { max-width: var(--max); margin: 0 auto; }
.section-heading { display: grid; grid-template-columns: 1fr 1.25fr; gap: 2rem; align-items: end; margin-bottom: 2rem; }
.section h2, .contact h2, .intro h2 {
  margin: 0;
  font-size: clamp(2.7rem, 5.7vw, 6.4rem);
  line-height: .9;
  letter-spacing: clamp(-.24rem, -.4vw, -.08rem);
  text-wrap: balance;
}
.large { font-size: clamp(1.1rem, 1.7vw, 1.35rem); color: #c5cad5; line-height: 1.65; }
.intro { background: var(--cream); color: var(--cream-text); }
.intro p { color: var(--cream-muted); }
.intro .section-label { color: #4d5bf2; }
.intro-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(300px,.95fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.mini-list { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.35rem; }
.mini-list span, .case-tags span, .impact-row span {
  display: inline-flex;
  padding: .44rem .62rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  color: #dce2f2;
  background: rgba(255,255,255,.055);
  box-shadow: 0 0 0 1px var(--line);
}
.intro .mini-list span { color: var(--cream-text); background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04); }

.case-grid { display: grid; grid-template-columns: 1.2fr .8fr; grid-auto-rows: minmax(260px, auto); gap: .9rem; }
.case-card {
  position: relative;
  min-height: 300px;
  padding: 1.25rem;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .22s ease, box-shadow .22s ease;
}
.case-card::after {
  content: "";
  position: absolute;
  inset: auto -15% -42% -15%;
  height: 58%;
  background: radial-gradient(circle, rgba(124,115,255,.3), transparent 64%);
  pointer-events: none;
}
.case-card:hover { transform: translateY(-5px); box-shadow: inset 0 1px rgba(255,255,255,.1), 0 0 0 1px rgba(255,255,255,.18), 0 28px 90px rgba(0,0,0,.34); }
.case-card.featured { grid-row: span 2; min-height: 610px; }
.case-top { display: flex; justify-content: space-between; gap: 1rem; color: #c7c9ff; }
.case-card h3 { position: relative; z-index: 1; margin: 1.5rem 0 .75rem; font-size: clamp(2rem, 4vw, 4.8rem); line-height: .9; letter-spacing: -.08em; max-width: 10ch; }
.case-card:not(.featured) h3 { font-size: clamp(1.65rem, 2.5vw, 2.7rem); max-width: 13ch; }
.case-card p { position: relative; z-index: 1; max-width: 56ch; }
.architecture-map { position: relative; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin: 2rem 0 1rem; }
.architecture-map i { font-style: normal; padding: .52rem .62rem; border-radius: 9px; background: rgba(255,255,255,.06); color: #dce2f2; font-family: var(--mono); font-size: .72rem; }
.architecture-map b { width: 28px; height: 1px; background: linear-gradient(90deg, var(--violet), transparent); }
.case-tags { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.photo-card { padding: 0; min-height: 300px; }
.photo-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.75) saturate(1.08); transform: scale(1.02); }
.photo-card div { position: relative; z-index: 2; margin-top: auto; padding: 1.1rem; background: linear-gradient(180deg, transparent, rgba(0,0,0,.78)); }
.photo-card span { color: #c7c9ff; font-family: var(--mono); text-transform: uppercase; font-size: .72rem; letter-spacing: .08em; }
.photo-card h3 { margin: .45rem 0 0; max-width: 12ch; }

.experience { background: #08090a; }
.timeline { display: grid; gap: .9rem; }
.timeline-item { display: grid; grid-template-columns: 210px 1fr; gap: 2rem; padding: 1.25rem; border-radius: 22px; }
.timeline-item h3 { margin: 0 0 .55rem; font-size: clamp(1.4rem, 2.6vw, 2.35rem); line-height: 1.05; letter-spacing: -.045em; }
.impact-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
details { margin-top: 1rem; }
summary { cursor: pointer; color: #c7c9ff; font-weight: 600; }

.systems { background: var(--cream); color: var(--cream-text); }
.systems p { color: var(--cream-muted); }
.systems .section-label { color: #4d5bf2; }
.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; }
.pipeline article { position: relative; padding: 1rem; min-height: 210px; border-radius: 22px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 12px 35px rgba(0,0,0,.05); }
.pipeline article::before { content: ""; position: absolute; left: 1rem; right: 1rem; top: 0; height: 3px; border-radius: 0 0 99px 99px; background: linear-gradient(90deg, var(--blue), var(--pink), var(--ship)); }
.pipeline b { font-family: var(--mono); font-size: .76rem; color: #4d5bf2; }
.pipeline h3 { margin: 1rem 0 .4rem; font-size: 1.05rem; letter-spacing: -.025em; }

.skill-bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; }
.skill-bento article { min-height: 190px; padding: 1rem; border-radius: 22px; }
.skill-bento article:nth-child(1), .skill-bento article:nth-child(6) { grid-column: span 2; }
.skill-bento article:nth-child(2), .skill-bento article:nth-child(3), .skill-bento article:nth-child(4), .skill-bento article:nth-child(5) { grid-column: span 2; }
.skill-bento h3 { margin: 0 0 .6rem; font-size: 1.18rem; letter-spacing: -.035em; }

.lab { background: #08090a; }
.chat-shell { max-width: 900px; margin: 0 auto; border-radius: 24px; overflow: hidden; }
.chat-log { min-height: 250px; padding: 1rem; display: grid; align-content: start; gap: .85rem; }
.bot-msg, .user-msg { max-width: 760px; padding: 1rem; border-radius: 18px; background: rgba(255,255,255,.065); box-shadow: 0 0 0 1px var(--line); }
.user-msg { justify-self: end; background: rgba(124,115,255,.16); }
.bot-msg strong { display: block; margin-bottom: .35rem; }
.bot-msg small { display: block; margin-top: .55rem; color: #c7c9ff; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: .6rem; padding: 1rem; border-top: 1px solid var(--line); }
.chat-form input { min-height: 52px; border: 0; border-radius: 10px; background: rgba(255,255,255,.055); color: var(--ink); padding: 0 1rem; font: inherit; box-shadow: 0 0 0 1px var(--line); }
.chat-form button { min-height: 52px; border: 0; border-radius: 10px; padding: 0 1.05rem; background: #fff; color: #050507; font-weight: 700; cursor: pointer; }

.contact { padding: clamp(6rem, 10vw, 10rem) 1.25rem; text-align: center; }
.contact-shell { max-width: 980px; margin: 0 auto; }
.contact h2 { margin-top: .7rem; }
.contact p:not(.section-label) { max-width: 760px; margin: 1rem auto 0; color: #c8ceda; font-size: 1.12rem; }
.site-footer { max-width: var(--max); margin: 0 auto; padding: 2rem 1.25rem 3rem; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--dim); font-size: .9rem; }

.reveal-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity .75s ease, transform .75s ease; }
.reveal-on-scroll.in-view { opacity: 1; transform: translateY(0); }
.magnetic { transform-style: preserve-3d; }

.case-hero {
  min-height: min(760px, calc(100vh - 72px));
}
.case-hero .system-console {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  align-self: center;
  min-height: 0;
}
.case-hero .hero-copy h1 {
  max-width: 9ch;
}

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "copy" "visual" "strip"; }
  .hero h1 { max-width: 12ch; }
  .hero-visual { min-height: 720px; }
  .portrait-card { inset: 0 0 70px 0; }
  .signal-strip, .metrics { grid-template-columns: repeat(2, 1fr); }
  .section-heading, .intro-grid, .timeline-item { grid-template-columns: 1fr; }
  .case-grid { grid-template-columns: 1fr; }
  .case-card.featured { min-height: 520px; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .nav-toggle { display: grid; gap: 4px; place-content: center; width: 46px; height: 46px; border: 0; border-radius: 10px; background: rgba(255,255,255,.055); box-shadow: 0 0 0 1px var(--line); }
  .nav-toggle i { width: 18px; height: 2px; background: white; }
  .nav-links { display: none; position: absolute; top: 64px; left: 1rem; right: 1rem; padding: .65rem; border-radius: 16px; background: rgba(10,11,16,.96); box-shadow: 0 0 0 1px var(--line), 0 24px 70px rgba(0,0,0,.45); }
  .nav-links[data-open="true"] { display: grid; }
  .hero { padding-top: 3rem; }
  .hero h1 { font-size: clamp(3.45rem, 17vw, 5rem); letter-spacing: -.16rem; }
  .hero-visual { min-height: 560px; }
  .system-console { right: 8%; }
  .signal-strip, .metrics, .pipeline, .skill-bento { grid-template-columns: 1fr; }
  .skill-bento article, .skill-bento article:nth-child(1), .skill-bento article:nth-child(6) { grid-column: auto; }
  .case-card.featured { min-height: 460px; }
  .chat-form { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 440px) {
  .brand-copy small { display: none; }
  .hero-visual { min-height: 500px; }
  .portrait-card { border-radius: 22px; }
  .system-console { left: .6rem; right: .6rem; }
  pre { font-size: .72rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .reveal-on-scroll { opacity: 1; transform: none; }
  #neural-canvas { display: none; }
}
