/* Motion and interaction polish for the portfolio's static GitHub Pages build. */

:root {
  scroll-behavior: smooth;
  --polish-shadow: 0 13px 30px rgba(0, 0, 0, 0.18);
  --polish-shadow-strong: 0 19px 42px rgba(0, 0, 0, 0.26);
  --polish-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="light"] {
  --polish-shadow: 0 13px 28px rgba(54, 35, 21, 0.13);
  --polish-shadow-strong: 0 20px 42px rgba(54, 35, 21, 0.2);
}

html,
body {
  scroll-behavior: smooth;
}

html.smooth-driver {
  scroll-behavior: auto;
}

body,
.section,
.dock,
.tool-trigger,
.tool-grid > button,
.experience-section,
.site-footer {
  transition: background-color 360ms ease, color 360ms ease, border-color 360ms ease,
    box-shadow 360ms ease;
}

/* A quiet, always-on cinematic movement for the landing scene. */
.hero .paddock {
  animation: heroPaddockDrift 18s var(--polish-ease) infinite alternate;
  transform-origin: 65% 73%;
  will-change: transform;
}

.hero .hero-shade {
  animation: heroAtmosphere 10s ease-in-out infinite alternate;
}

@keyframes heroPaddockDrift {
  from { transform: scale(1.03) translate3d(-0.4%, 0, 0); }
  to { transform: scale(1.09) translate3d(0.7%, -0.45%, 0); }
}

@keyframes heroAtmosphere {
  from { opacity: 0.82; }
  to { opacity: 1; }
}

html.motion-ready .upward-reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 600ms var(--polish-ease) var(--upward-delay, 0ms),
    transform 760ms var(--polish-ease) var(--upward-delay, 0ms);
  will-change: opacity, transform;
}

html.motion-ready .upward-reveal.upward-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* A compact, two-part footer that holds its rhythm in either theme. */
.contact footer.site-footer {
  width: 100%;
  margin-top: clamp(56px, 9vw, 112px);
  padding-top: 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--text);
}

.site-footer .footer-mark {
  color: var(--red);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.8;
  text-decoration: none;
}

/* More notes, with smaller cards and clearer rhythm. */
#notes .notes-row {
  gap: 16px;
}

#notes .notes-row > * {
  flex: 0 0 clamp(190px, 17vw, 220px);
  min-height: 150px;
  padding: 18px;
}

#notes .notes-row .visitor-note p,
#notes .notes-row .editor-note p {
  font-size: 13px;
  line-height: 1.45;
}

#notes .notes-row .visitor-note strong {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer .footer-credit {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (hover: hover) {
  .available,
  .theme,
  .dock > a,
  .hero-cta,
  .contact-key,
  .email-copy,
  .tool-trigger,
  .tool-grid > button,
  .experience-entry,
  .primary,
  .secondary {
    transition: transform 260ms var(--polish-ease), box-shadow 260ms var(--polish-ease),
      background-color 260ms ease, border-color 260ms ease, color 260ms ease;
  }

  .available:hover,
  .theme:hover,
  .hero-cta:hover,
  .contact-key:hover,
  .email-copy:hover,
  .tool-trigger:hover,
  .primary:hover,
  .secondary:hover {
    transform: translateY(-3px);
    box-shadow: var(--polish-shadow);
  }

  .dock > a:hover {
    transform: translateY(-2px);
  }

  .tool-grid > button:hover {
    transform: translateY(-5px);
    border-color: var(--red);
    box-shadow: var(--polish-shadow);
  }

  .experience-entry:hover {
    transform: translateX(5px);
    box-shadow: var(--polish-shadow);
  }

}

@media (max-width: 560px) {
  .contact footer.site-footer {
    margin-top: 62px;
    padding-top: 17px;
  }

  .site-footer .footer-mark {
    font-size: 38px;
  }

  .site-footer .footer-credit {
    font-size: 8px;
    letter-spacing: 0.12em;
  }

}

@media (max-width: 760px) {
  .project-deck.has-seven-projects {
    height: 380px;
  }

  .project-deck.has-seven-projects .project-card {
    width: 255px;
    height: 322px;
    left: auto;
    top: auto;
  }

  .project-deck.has-seven-projects .project-image {
    height: 125px;
  }

  #notes .notes-row > * {
    flex-basis: 184px;
    min-height: 142px;
    padding: 16px;
  }

  #notes .notes-row .visitor-note p,
  #notes .notes-row .editor-note p {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  body {
    scroll-behavior: auto;
  }

  html.motion-ready .upward-reveal,
  html.motion-ready .upward-reveal.upward-visible,
  .available,
  .theme,
  .dock > a,
  .hero-cta,
  .contact-key,
  .email-copy,
  .tool-trigger,
  .tool-grid > button,
  .experience-entry,
  .primary,
  .secondary {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero .paddock,
  .hero .hero-shade {
    animation: none;
  }

}

/* Keep experience numbers free of the leading divider rule. */
#experience .experience-entry { border-top: 0; }

/* Match the toolkit icon language within experience. */
.role-tools{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
.role-tool{display:flex;align-items:center;gap:8px;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--text);font-size:11px;transition:border-color .25s,transform .25s,box-shadow .25s}
.role-tool svg{width:24px;height:24px;color:var(--red)}
@media(hover:hover){.role-tool:hover{transform:translateY(-3px);border-color:var(--red);box-shadow:0 8px 20px #ef3c3420}}
@media(prefers-reduced-motion:reduce){.role-tool{transition:none}.role-tool:hover{transform:none}}
#about .photo-note img{aspect-ratio:1.5;object-fit:contain;background:#090505}
.about-note{background:#2a2424!important;color:#f6f1e9!important;border:1px solid #ef3c3459}
.about-note .eyebrow{color:#ff756e}.about-note p{color:#ddd4ce}
.small-note{background:#b82723!important;color:#fff5ed!important}
.location-note{background:#ede5da!important;color:#252020!important;border-top:3px solid #ef3c34}
.visitor-note{background:#262323!important;color:#f6f1e9!important;border-top:3px solid #ef3c34;box-shadow:0 12px 28px #0003}
.visitor-note:nth-of-type(2n){background:#8d2422!important;color:#fff5ed!important}
.visitor-note strong{color:inherit}
.editor-note{background:#eee5d8!important;color:#282020!important;border-top:3px solid #ef3c34}
.empty-note{background:#231b1b;color:#f6f1e9;border-color:#ef3c3480;transition:background .3s,border-color .3s,transform .4s var(--motion-ease)}
.empty-note:hover,.empty-note:focus-visible{background:#3c1c1b;border-color:#ef3c34;transform:translateY(-5px)}

/* Ferrari reference image behind the About introduction. */
#about{position:relative;isolation:isolate}
#about::before{content:"";position:absolute;z-index:-1;pointer-events:none;inset:0 0 auto;height:clamp(440px,44vw,640px);background-image:linear-gradient(90deg,#141414 8%,rgba(20,20,20,.94) 30%,rgba(20,20,20,.15) 76%),linear-gradient(0deg,#141414 0%,transparent 26%),url('./assets/about-f1-matched-car.webp');background-size:100% 100%,100% 100%,68% auto;background-position:center,center,right center;background-repeat:no-repeat}
#about>.about-lead{color:#d5d0c9}
@media(max-width:700px){#about::before{height:520px;background-size:100% 100%,100% 100%,auto 100%;background-position:center,center,62% center;background-image:linear-gradient(90deg,rgba(20,20,20,.94),rgba(20,20,20,.55)),linear-gradient(0deg,#141414 0%,transparent 35%),url('./assets/about-f1-matched-car.webp')}}

.hero h1 em.rotating-curiosity{display:inline-block;min-width:7.8ch;white-space:nowrap;vertical-align:baseline;transition:opacity .2s ease,transform .2s ease;font-family:"Barlow Condensed","Noto Sans Gujarati","Noto Sans Devanagari","Noto Sans CJK SC",sans-serif}
.hero h1 em.rotating-curiosity.word-changing{opacity:0;transform:translateY(7px)}
@media(prefers-reduced-motion:reduce){.hero h1 em.rotating-curiosity{transition:none}.hero h1 em.rotating-curiosity.word-changing{transform:none}}

/* Case-study story blocks (The challenge / My approach / The outcome) — hover, for every project. */
.case-story article{position:relative;padding:24px 22px 26px;border:1px solid transparent;border-top:3px solid transparent;border-radius:14px;transition:transform .35s cubic-bezier(.22,1,.36,1),background-color .3s ease,border-color .3s ease,box-shadow .35s ease}
.case-story article>span{display:inline-block;transition:transform .35s cubic-bezier(.22,1,.36,1)}
.case-story article h2,.case-story article p{transition:color .3s ease}
.case-dialog .tags span{transition:transform .3s cubic-bezier(.22,1,.36,1),border-color .3s ease,background-color .3s ease,box-shadow .3s ease}
@media(hover:hover){
.case-story article:hover{transform:translateY(-6px);background:var(--surface);border-color:var(--line);border-top-color:var(--red);box-shadow:0 18px 36px rgba(0,0,0,.22)}
.case-story article:hover>span{transform:translateY(-2px) scale(1.15)}
.case-story article:hover h2{color:var(--red)}
.case-story article:hover p{color:var(--text)}
.case-dialog .tags span:hover{transform:translateY(-3px);border-color:var(--red);background:var(--surface);box-shadow:0 8px 20px rgba(239,60,52,.13)}
}
@media(prefers-reduced-motion:reduce){.case-story article,.case-story article>span,.case-dialog .tags span{transition:none}.case-story article:hover,.case-dialog .tags span:hover{transform:none}}

/* Keep the upper About card compact and clear of the two lower cards. */
@media (min-width: 761px) {
  #about .moodboard .about-note {
    top: 7%;
    padding: 18px 22px;
    width: 30%;
    box-sizing: border-box;
    transform: rotate(1deg);
  }
  #about .moodboard .about-note .eyebrow { margin-bottom: 8px; }
  #about .moodboard .about-note h3 {
    font-size: clamp(24px, 2.4vw, 31px);
    line-height: 1.04;
    margin-bottom: 10px;
  }
  #about .moodboard .about-note p {
    font-size: clamp(11px, 1vw, 13px);
    line-height: 1.4;
    margin: 0 0 9px;
  }
  #about .moodboard .about-note p:last-child { margin-bottom: 0; }
}

/* Tighten the About pinboard: bring the lower postcards into the open middle. */
@media (min-width: 901px) {
  #about .moodboard { height: 610px; }
  #about .moodboard .small-note { bottom: 5%; }
  #about .moodboard .location-note { bottom: 5%; }
}
@media (min-width: 761px) and (max-width: 900px) {
  #about .moodboard { height: 650px; }
  #about .moodboard .small-note { bottom: 5%; }
  #about .moodboard .location-note { bottom: 5%; }
}
