/* Kartik Rawat — portfolio
   Implemented from the Claude Design component `design/Portfolio.dc.html`.
   Palette, spacing and easing are carried over 1:1 from that source. */

:root {
  --ink:    #08080A;
  --paper:  #F4F4F2;
  --accent: #F2C230;
  --muted:  #8A8A8E;
  --dim:    #4A4A4E;
  --panel:  #101013;
  --tile:   #131316;
  --chip:   #1E1E23;
  --ease:   cubic-bezier(.16, 1, .3, 1);
}

/* ── base ───────────────────────────────────────────── */

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--ink); }

* { scrollbar-width: none; }
::-webkit-scrollbar { display: none; }

.muted  { color: var(--muted); }
.accent { color: var(--accent); }

.kicker {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

.label {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── buttons ────────────────────────────────────────── */

.btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  border-radius: 999px;
  transition: transform 500ms var(--ease), color 400ms var(--ease);
}

.btn--accent { background: var(--accent); color: var(--ink); font-weight: 600; }
.btn--ghost  { background: var(--chip);   color: var(--paper); }

.btn--sm { font-size: 14px; padding: 8px 16px; }
.btn--lg { font-size: 16px; padding: 14px 26px; }
.btn:not(.btn--sm):not(.btn--lg) { font-size: 15px; padding: 13px 22px; }

.btn--sm:hover { transform: scale(1.04); }
.btn--lg:hover { transform: scale(1.03); }
.btn--accent:hover { color: var(--ink); }

.link {
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: none;
  transition: color 400ms var(--ease);
}
.link--strong { color: var(--paper); }
.link:hover { color: var(--accent); }

/* ── nav ────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 56px);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(244, 244, 242, .72);
}

.nav__brand { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  font-size: 14px;
  letter-spacing: -.01em;
  color: var(--dim);
}
.nav__links a { color: inherit; }

/* ── hero ───────────────────────────────────────────── */

.hero {
  position: relative;
  height: 100svh;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(72px + clamp(6px, 2svh, 38px)) 20px calc(72px + clamp(8px, 2svh, 24px));
  box-sizing: border-box;
  overflow: hidden;
}

.hero__wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 30%, #FFFFFF 0%, #F4F4F2 55%, #E9E9E6 100%);
}

.hero__inner {
  position: relative;
  width: 100%;
  max-width: 1180px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(4px, 1.2svh, 14px);
}

.hero__eyebrow,
.hero__title,
.hero__lede { opacity: 0; }

.hero__eyebrow {
  animation: riseIn 900ms var(--ease) 120ms forwards;
  margin: 0;
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__title {
  animation: riseIn 1100ms var(--ease) 220ms forwards;
  margin: 0;
  font-size: max(2.5rem, min(10.5vw, 13svh, 9.5rem));
  line-height: .92;
  letter-spacing: -.045em;
  font-weight: 600;
  text-wrap: balance;
}

.hero__lede {
  animation: riseIn 1100ms var(--ease) 420ms forwards;
  margin: 0;
  max-width: 30ch;
  font-size: max(15px, min(2vw, 2.6svh, 22px));
  line-height: 1.4;
  letter-spacing: -.015em;
  color: var(--dim);
}

.hero__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  aspect-ratio: 1 / 1;
  max-width: min(72vw, 460px);
  margin: 0;
  perspective: 1200px;
}

.hero__robot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Decorative. Without this the browser puts its picture-in-picture /
     media overlay on the video the moment the cursor crosses the hero. */
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: 50% 60%;
  mask-image: radial-gradient(ellipse 62% 58% at 50% 52%, #000 55%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 52%, #000 55%, transparent 78%);
  transition: opacity 700ms var(--ease);
}

.hero__robot--video { opacity: 0; }

.hero__cue {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(14px, 2.5svh, 28px);
  display: grid;
  justify-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  animation: cueDrift 2600ms ease-in-out infinite;
}

.hero__cue-line {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--muted), transparent);
}

/* ── sections ───────────────────────────────────────── */

.section--dark  { background: var(--ink);   color: var(--paper); }
.section--light { background: var(--paper); color: var(--ink); }

.section--work    { padding: clamp(90px, 12vw, 180px) clamp(20px, 5vw, 56px); }
.section--trading { padding: 0 0 clamp(90px, 12vw, 170px); }
.section--ai      { padding: 0 clamp(20px, 5vw, 56px) clamp(100px, 13vw, 190px); }
.section--light   { padding: clamp(100px, 14vw, 200px) clamp(20px, 5vw, 56px); }
.section--contact { padding: clamp(90px, 12vw, 160px) clamp(20px, 5vw, 56px) 56px; }

.wrap { max-width: 1320px; margin: 0 auto; }

.wrap--work    { display: grid; gap: clamp(36px, 5vw, 72px); }
.wrap--ai      { display: grid; gap: clamp(32px, 4vw, 60px); }
.wrap--contact { display: grid; gap: clamp(48px, 7vw, 90px); }

.wrap--trading {
  display: grid;
  gap: 12px;
  padding: 0 clamp(20px, 5vw, 56px) clamp(28px, 4vw, 48px);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.section__intro {
  display: grid;
  gap: 12px;
  max-width: 44ch;
}

.section__title {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: .98;
  letter-spacing: -.04em;
  font-weight: 600;
}

.section__note {
  margin: 0;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

/* ── media tiles ────────────────────────────────────── */

.grid { display: grid; }
.grid--portrait  { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: clamp(16px, 2vw, 26px); }
.grid--landscape { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(16px, 2vw, 28px); }

.card { display: grid; gap: 14px; }

.tile {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--tile);
  cursor: pointer;
}

.tile--portrait  { aspect-ratio: 9 / 16; }
.tile--landscape { aspect-ratio: 4 / 3; }

.tile img,
.tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile video {
  transform: scale(1.02);
  transition: transform 700ms var(--ease);
}

.tile__veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 500ms var(--ease);
  background: linear-gradient(transparent 45%, rgba(4, 4, 6, .78));
}
.tile--landscape .tile__veil { background: linear-gradient(transparent 55%, rgba(4, 4, 6, .7)); }
.tile:hover .tile__veil { opacity: 1; }

.tile__veil span { font-size: 13px; letter-spacing: .02em; color: var(--accent); }

.card__meta { display: grid; gap: 4px; }
.card__title { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.card__sub   { font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ── trading rail ───────────────────────────────────── */

.rail {
  display: flex;
  gap: clamp(12px, 1.4vw, 20px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px clamp(20px, 5vw, 56px) 8px;
}

.rail .tile {
  flex: 0 0 auto;
  width: min(280px, 66vw);
  aspect-ratio: 9 / 16;
  border-radius: 22px;
  scroll-snap-align: center;
}

.rail__chip {
  position: absolute;
  left: 14px;
  bottom: 14px;
  font-size: 12px;
  letter-spacing: .02em;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(8, 8, 10, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── about ──────────────────────────────────────────── */

.about {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  gap: 28px;
}

.about__lead {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1.28;
  letter-spacing: -.03em;
  text-wrap: pretty;
}

.about__body {
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--dim);
  max-width: 52ch;
}

/* ── services ───────────────────────────────────────── */

.section--services {
  background: var(--paper);
  color: var(--ink);
  padding: 0 clamp(20px, 5vw, 56px) clamp(100px, 13vw, 180px);
}

.wrap--services { display: grid; gap: clamp(32px, 4vw, 56px); }

.section__title--ink { color: var(--ink); }

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: clamp(16px, 2vw, 28px);
}

.service {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: clamp(22px, 2.4vw, 30px);
  border-radius: 20px;
  background: #FFFFFF;
  border: 1px solid #E4E4E0;
}

.service__num {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--accent);
}

.service__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.service__body {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--dim);
}

/* ── skills ─────────────────────────────────────────── */

.section--skills { padding: clamp(90px, 12vw, 150px) clamp(20px, 5vw, 56px); }

.wrap--skills {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: clamp(14px, 2vw, 24px);
}

.chip {
  font-size: 15px;
  letter-spacing: -.01em;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--paper);
  border: 1px solid #2A2A31;
  transition: border-color 400ms var(--ease), color 400ms var(--ease);
}

.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ── contact ────────────────────────────────────────── */

.contact__head {
  display: grid;
  gap: 24px;
  justify-items: start;
}

.contact__title {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 7rem);
  line-height: .95;
  letter-spacing: -.045em;
  font-weight: 600;
}

.contact__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 14px;
  color: var(--muted);
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}
.contact__links a { color: inherit; }

/* ── sheet ──────────────────────────────────────────── */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 8, 10, .5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
}

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  transform: translate3d(0, 110%, 0);
  will-change: transform;
  background: var(--panel);
  color: var(--paper);
  border-radius: 28px 28px 0 0;
  padding: 14px clamp(20px, 5vw, 44px) clamp(28px, 4vw, 44px);
  max-width: 960px;
  margin: 0 auto;
  touch-action: none;
}

.sheet__grab {
  display: grid;
  place-items: center;
  padding: 6px 0 18px;
  cursor: grab;
}
.sheet__grab span {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: #3A3A40;
}

.sheet__body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(20px, 3vw, 34px);
  align-items: center;
  padding-bottom: 8px;
}

.sheet__player {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  display: grid;
  place-items: center;
  justify-self: center;
}
.sheet__player[hidden] { display: none; }

.sheet__player video {
  height: min(52svh, 520px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.sheet__copy    { display: grid; gap: 16px; align-content: center; }
.sheet__heading { display: grid; gap: 8px; }

.sheet__copy h3 {
  margin: 0;
  font-size: clamp(28px, 4.6vw, 42px);
  line-height: 1.05;
  letter-spacing: -.035em;
  font-weight: 600;
}

.sheet__copy p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #A0A0A6;
  max-width: 52ch;
}

.sheet__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}

/* ── motion ─────────────────────────────────────────── */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 650ms var(--ease), transform 650ms var(--ease);
}
[data-reveal][data-shown] { opacity: 1; transform: translateY(0); }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cueDrift {
  0%, 100% { transform: translateY(0);   opacity: .35; }
  50%      { transform: translateY(8px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero__eyebrow, .hero__title, .hero__lede { opacity: 1; animation: none; }
  .hero__cue { animation: none; }
  .btn, .link, .tile video, .tile__veil { transition: none; }
}
