/* ==========================================================================
   Nikhil Satav — Portfolio
   Global styles, theme tokens and animations.
   Layout styles live inline in the template (index.html).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base / reset
   -------------------------------------------------------------------------- */
body {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button:focus-visible,
input:focus-visible {
  outline: 2px solid #8F9BFF;
  outline-offset: 3px;
}

a:focus-visible {
  outline: 2px solid #8F9BFF;
  outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   2. Theme tokens
   -------------------------------------------------------------------------- */
.theme-dark {
  --bg: #0B0B0C;
  --bg-rgb: 11, 11, 12;
  --ink: #F2F1EC;
  --ink-rgb: 242, 241, 236;
  --surface: #111113;
  --surface-2: #17171A;
  --accent-soft: #1C1D24;
  --line-strong: #2A2A2D;
  --muted: #A7A69F;
  --ink-2: #C9C8C1;
  --faint: #5E5D58;
  --accent: #8F9BFF;
  --accent-rgb: 143, 155, 255;
}

.theme-light {
  --bg: #F4F3EF;
  --bg-rgb: 244, 243, 239;
  --ink: #121212;
  --ink-rgb: 18, 18, 18;
  --surface: #FFFFFF;
  --surface-2: #EAE9E4;
  --accent-soft: #E6E8FF;
  --line-strong: #DCDBD5;
  --muted: #5E5D57;
  --ink-2: #3F3F3B;
  --faint: #8A8983;
  --accent: #2B3CFF;
  --accent-rgb: 43, 60, 255;
}

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .fitsec {
    height: auto !important;
    min-height: 100vh;
    container-type: normal !important;
  }

  .fitsec .player {
    min-height: 680px !important;
  }
}

/* --------------------------------------------------------------------------
   4. Selected work — case study cards
   -------------------------------------------------------------------------- */
.s2card {
  transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.s2card:hover {
  transform: translateY(-4px);
  border-color: rgba(143, 155, 255, 0.6);
  background-color: #141416;
}

.s2card .s2arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.s2card:hover .s2arrow {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .s2card,
  .s2card .s2arrow {
    transition: none;
  }

  .s2card:hover,
  .s2card:hover .s2arrow {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   5. Process video player
   -------------------------------------------------------------------------- */
.pop {
  animation: pop 0.6s ease both;
}

.in {
  opacity: 0;
  animation: pop 0.5s ease forwards;
}

.card {
  animation: card 3s ease forwards;
}

/* Avatar mouth (talking) and eye blink */
.talk-a {
  animation: ta 0.3s steps(1) infinite;
}

.talk-b {
  opacity: 0;
  animation: tb 0.3s steps(1) infinite;
}

.idle-b {
  opacity: 0;
}

.blink {
  animation: blink 4s infinite;
}

/* Typing caret */
.caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: currentColor;
  animation: caret 1s steps(1) infinite;
}

/* Chapter markers on the timeline */
.dot .tip {
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.dot:hover .tip,
.dot:focus-visible .tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pin {
  transition: transform 0.2s;
}

.dot:hover .pin {
  transform: scale(1.5);
}

/* Seek bar (invisible range input over the progress track) */
.seek {
  position: absolute;
  inset: -10px 0;
  width: 100%;
  height: calc(100% + 20px);
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

/* Player controls */
.ctrl {
  transition: background-color 0.2s;
}

.ctrl:hover {
  background-color: rgba(242, 241, 236, 0.12);
}

.playbtn {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.playbtn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 10px rgba(143, 155, 255, 0.18);
}

.fadeup {
  animation: fadeup 0.6s ease 2.8s both;
}

.shimmer {
  animation: shim 1.6s ease-in-out infinite;
}

.hint {
  animation: pop 0.5s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .pop,
  .in,
  .card {
    animation: none;
    opacity: 1;
  }

  .card {
    display: none;
  }

  .talk-a,
  .talk-b,
  .blink,
  .caret {
    animation: none;
  }

  .talk-b {
    opacity: 0;
  }

  .fadeup,
  .shimmer,
  .hint {
    animation: none;
  }

  .playbtn {
    transition: none;
  }

  .playbtn:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   6. Contact — enquiry booth
   -------------------------------------------------------------------------- */
.ctpop {
  animation: ctpop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.cttype {
  animation: cttype 0.35s ease-in-out infinite alternate;
}

.ctwave {
  animation: ctwave 0.6s ease-in-out 4 alternate;
}

/* Field "flying" from the form to the inbox */
.ctfly {
  position: absolute;
  left: var(--sx);
  top: var(--sy);
  z-index: 20;
  pointer-events: none;
  animation: ctfly 1.5s cubic-bezier(0.45, 0, 0.25, 1) forwards;
}

.ctarc {
  animation: ctarc 1.5s ease-in-out forwards;
}

.ctchip {
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.ctsend {
  transition: transform 0.2s ease;
}

.ctsend:hover {
  transform: translateY(-2px);
}

.ctbooth {
  transition: opacity 0.5s ease, filter 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
  .ctpop,
  .cttype,
  .ctwave,
  .ctarc {
    animation: none;
  }

  .ctfly {
    animation: none;
    display: none;
  }

  .ctsend:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   7. Contact — channel cards (WhatsApp / email)
   -------------------------------------------------------------------------- */
.ct2-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
}

.ct2-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.45);
  border-color: rgba(var(--accent-rgb), 0.5);
}

.ct2-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.ct2-arrow {
  transition: transform 0.25s ease;
}

.ct2-card:hover .ct2-arrow {
  transform: translate(3px, -3px);
}

.ct2-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8696A0;
  animation: ct2dot 1.2s infinite ease-in-out;
}

.ct2-typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.ct2-typing i:nth-child(3) {
  animation-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  .ct2-typing i {
    animation: none;
  }

  .ct2-card,
  .ct2-arrow {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   8. Keyframes
   -------------------------------------------------------------------------- */
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes card {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  12% {
    opacity: 1;
    transform: none;
  }
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes ta {
  0% { opacity: 0; }
  50% { opacity: 1; }
}

@keyframes tb {
  0% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes blink {
  0%, 96%, 100% { transform: scaleY(1); }
  98% { transform: scaleY(0.1); }
}

@keyframes caret {
  50% { opacity: 0; }
}

@keyframes fadeup {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shim {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.7; }
}

@keyframes ctpop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cttype {
  from { transform: translateY(0); }
  to { transform: translateY(-2px); }
}

@keyframes ctwave {
  from { transform: rotate(-8deg); }
  to { transform: rotate(12deg); }
}

@keyframes ctfly {
  0% {
    left: var(--sx);
    top: var(--sy);
    opacity: 0;
    transform: scale(0.7);
  }
  12% {
    opacity: 1;
    transform: scale(1);
  }
  85% {
    opacity: 1;
  }
  100% {
    left: var(--ex);
    top: var(--ey);
    opacity: 0;
    transform: scale(0.8);
  }
}

@keyframes ctarc {
  0% { transform: translateY(0); }
  50% { transform: translateY(var(--arc)); }
  100% { transform: translateY(0); }
}

@keyframes ct2dot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
