/*
 * Ian Greer — Premium motion and surface layer
 * Release: v1.9.8
 * Built on the verified live v1.9.6 theme.
 */

:root {
  --premium-ease: cubic-bezier(.22, 1, .36, 1);
  --premium-ease-soft: cubic-bezier(.44, 0, .56, 1);
  --premium-radius: clamp(22px, 2.35vw, 36px);
  --premium-panel-gap: clamp(8px, 1vw, 14px);
  --premium-hero-y: 0px;
  --premium-hero-fade: 1;
  --premium-focus-y: 0px;
  --premium-focus-fade: 1;
  --premium-pointer-x: 50%;
  --premium-pointer-y: 50%;
  --premium-tilt-x: 0deg;
  --premium-tilt-y: 0deg;
  --premium-depth-y: 0px;
}

html.lenis,
html.lenis body {
  height: auto;
}

html.lenis,
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 75% -8%, rgba(49, 85, 245, .055), transparent 34rem),
    var(--paper);
}

/* Keep the architectural paper bar; only density and depth change on scroll. */
.site-header {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  border-bottom-color: rgba(18, 18, 18, .14);
  box-shadow: 0 0 0 rgba(18, 18, 18, 0);
  transition:
    background-color 500ms var(--premium-ease-soft),
    border-color 500ms var(--premium-ease-soft),
    box-shadow 500ms var(--premium-ease-soft),
    transform 700ms var(--premium-ease);
}

html.premium-page-scrolled .site-header {
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  border-bottom-color: rgba(18, 18, 18, .2);
  box-shadow: 0 12px 34px rgba(18, 18, 18, .055);
}

.site-header .wordmark-mark {
  box-shadow: none;
  transition: transform 600ms var(--premium-ease);
}

.site-header .wordmark:hover .wordmark-mark {
  box-shadow: 0 10px 24px rgba(49, 85, 245, .2);
  transform: rotate(-7deg) scale(1.04);
}

.desktop-nav a,
.nav-contact,
.nav-cta {
  transition: color 400ms var(--premium-ease-soft), opacity 400ms var(--premium-ease-soft);
}

.desktop-nav:has(a:hover) a:not(:hover) {
  opacity: .46;
}

.nav-cta {
  background: transparent;
  transition:
    background-color 400ms var(--premium-ease-soft),
    color 400ms var(--premium-ease-soft),
    transform 500ms var(--premium-ease);
}

.nav-cta:hover {
  background: var(--ink);
  color: white;
  transform: translateY(-1px);
}

/* The original editorial reveal, retimed to Fora's softer one-second settle. */
.reveal {
  animation-duration: 1000ms;
  animation-fill-mode: backwards;
  animation-timing-function: var(--premium-ease);
  opacity: 1;
}

.reveal-1 { animation-delay: 60ms; }
.reveal-2 { animation-delay: 150ms; }
.reveal-3 { animation-delay: 260ms; }

body.motion-ready .motion-item.is-visible {
  animation-duration: 920ms;
  animation-fill-mode: both;
  animation-timing-function: var(--premium-ease);
  opacity: 1;
  translate: 0 0;
}

/* Keep unrevealed items completely stable. Component transition rules must not
 * fade them out after JavaScript prepares the page. */
body.motion-ready .motion-item:not(.is-visible) {
  animation: none;
  opacity: 0;
  translate: 0 22px;
  transition: none !important;
}

@keyframes reveal {
  from { opacity: 0; translate: 0 24px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes motion-reveal {
  from { opacity: 0; translate: 0 22px; }
  to { opacity: 1; translate: 0 0; }
}

/* Pointer light: a masked one-pixel edge, never a loud card hover. */
[data-premium-glow] {
  --premium-glow: rgba(49, 85, 245, .6);
  isolation: isolate;
  position: relative;
}

[data-premium-glow]::after {
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  background: radial-gradient(
    520px circle at var(--premium-pointer-x) var(--premium-pointer-y),
    var(--premium-glow),
    transparent 46%
  );
  border-radius: inherit;
  content: "";
  inset: 0;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: .22;
  padding: 1px;
  pointer-events: none;
  position: absolute;
  transition: opacity 420ms var(--premium-ease-soft);
  z-index: 7;
}

[data-premium-glow].is-premium-pointer-active::after,
[data-premium-glow]:focus-visible::after {
  opacity: 1;
}

.hero-card,
.article-newsletter,
.blueprint-audio-player,
.book-page-feedback,
.consulting-final,
.site-footer {
  --premium-glow: rgba(255, 255, 255, .54);
}

.blueprint-section [data-premium-glow],
.book-page-part,
.about-page-work-elwood {
  --premium-glow: rgba(200, 255, 83, .55);
}

/* Homepage: retain the asymmetric split, but give it air and depth. */
.home-template .hero {
  gap: 0;
  grid-template-columns: minmax(0, 1.62fr) minmax(320px, .7fr);
  min-height: calc(100svh - 82px);
  overflow: clip;
}

.home-template .hero-copy {
  background:
    radial-gradient(circle at 85% 13%, rgba(49, 85, 245, .09), transparent 27rem),
    linear-gradient(145deg, rgba(255, 255, 255, .62), rgba(242, 240, 232, .78));
  overflow: hidden;
  padding-left: clamp(28px, 3.45vw, 58px);
  padding-right: clamp(28px, 3.45vw, 58px);
  position: relative;
}

.home-template .hero-copy::before {
  background:
    linear-gradient(90deg, rgba(18, 18, 18, .045) 1px, transparent 1px),
    linear-gradient(rgba(18, 18, 18, .045) 1px, transparent 1px);
  background-size: 68px 68px;
  content: "";
  inset: -12%;
  mask-image: radial-gradient(circle at 80% 15%, #000, transparent 64%);
  opacity: .38;
  pointer-events: none;
  position: absolute;
  transform: translate3d(0, var(--premium-hero-y), 0);
}

.home-template .hero-copy > * {
  position: relative;
  z-index: 1;
}

.home-template .hero h1 {
  max-width: 10.6ch;
  text-wrap: balance;
}

.home-template .hero h1 em {
  filter: saturate(1.04);
  text-shadow: 0 14px 38px rgba(49, 85, 245, .11);
}

.home-template .hero-card {
  animation: none;
  background: var(--blue);
  border-left: 1px solid rgba(255, 255, 255, .17);
  box-shadow: 0 36px 90px rgba(49, 85, 245, .23);
  min-height: 100%;
  opacity: var(--premium-focus-fade);
  transform: translate3d(0, var(--premium-focus-y), 0);
}

.home-template .hero-card::before {
  content: none;
}

.home-template .hero-card[data-premium-depth] .orbit {
  transform: perspective(900px) rotateX(var(--premium-tilt-x)) rotateY(var(--premium-tilt-y)) translate3d(0, var(--premium-depth-y), 0);
  transition: transform 480ms var(--premium-ease);
}

.home-template .hero.is-premium-hero-active .hero-copy::before,
.home-template .hero.is-premium-hero-active .hero-card,
.home-template .hero.is-premium-hero-active .hero-card[data-premium-depth] .orbit {
  will-change: transform;
}

.home-template .hero.is-premium-hero-active .hero-card {
  will-change: transform, opacity;
}

.home-template .orbit-number {
  text-shadow: 0 20px 42px rgba(20, 30, 120, .24);
}

.home-template .orbit-ring {
  animation-play-state: paused;
  will-change: auto;
}

.home-template .hero.is-premium-hero-active .orbit-ring {
  animation-play-state: running;
  will-change: transform;
}

.home-template .orbit-ring-one { animation-duration: 24s; }
.home-template .orbit-ring-two { animation-duration: 18s; }

/* Large editorial panels: colored, tactile, and still recognizably Ian. */
.home-template .blueprint-section,
.home-template .elwood-section,
.home-template .about-section,
.home-template .newsletter-section {
  border-radius: 0;
  margin: 0;
}

.home-template .blueprint-section {
  border: 1px solid rgba(255, 255, 255, .11);
  box-shadow: 0 30px 90px rgba(18, 18, 18, .13);
}

.home-template .blueprint-section::before {
  background: radial-gradient(circle at 78% 20%, rgba(49, 85, 245, .19), transparent 32rem);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.home-template .book-model-shell {
  transform: translate3d(0, var(--premium-depth-y), 0);
}

.home-template .blueprint-pillars {
  gap: 0;
}

.home-template .blueprint-pillars article {
  transition:
    background-color 500ms var(--premium-ease-soft),
    border-color 500ms var(--premium-ease-soft);
}

.home-template .blueprint-pillars article.is-premium-active {
  background: none;
}

.home-template .elwood-section {
  background: #dce7f4;
  border: 1px solid rgba(49, 85, 245, .1);
}

.home-template .elwood-board {
  background-image:
    radial-gradient(ellipse at 105% 36%, transparent 0 37%, rgba(142, 215, 246, .16) 37.2% 37.5%, transparent 37.7% 44%, rgba(142, 215, 246, .1) 44.2% 44.5%, transparent 44.7%),
    repeating-linear-gradient(0deg, transparent 0 64px, rgba(255, 255, 255, .035) 64px 65px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 26px;
  box-shadow: 0 34px 80px rgba(22, 43, 68, .19);
}

.home-template .work-section {
  padding-left: clamp(20px, 4vw, 64px);
  padding-right: clamp(20px, 4vw, 64px);
}

.home-template .article-grid {
  gap: 0;
}

.home-template .article-card,
.home-template .article-card:first-child {
  overflow: hidden;
  transition:
    background-color 500ms var(--premium-ease-soft),
    border-color 500ms var(--premium-ease-soft),
    box-shadow 600ms var(--premium-ease),
    color 500ms var(--premium-ease-soft),
    transform 650ms var(--premium-ease);
}

.home-template .article-card:is(:hover, :focus-visible, .is-active) {
  box-shadow: inset 0 0 0 1px rgba(18, 18, 18, .08);
}

.home-template .article-card:is(:hover, :focus-visible) {
  transform: translate3d(0, -2px, 0);
}

.home-template .about-section {
  border: 1px solid rgba(255, 255, 255, .14);
  overflow: hidden;
}

.home-template .about-copy > p {
  transition: opacity 460ms var(--premium-ease-soft), transform 650ms var(--premium-ease);
}

.home-template .newsletter-section {
  background:
    radial-gradient(circle at 90% 10%, rgba(49, 85, 245, .09), transparent 25rem),
    var(--acid);
  border: 1px solid rgba(18, 18, 18, .16);
  overflow: hidden;
}

.home-template .newsletter-section h2 {
  text-shadow: 0 18px 55px rgba(18, 18, 18, .08);
}

/* Shared page refinements. These do not alter the site hierarchy or content. */
.book-page-hero,
.about-page-hero,
.consulting-hero,
.newsletter-page-hero,
.contact-hero,
.archive-hero {
  background:
    radial-gradient(circle at 82% 12%, rgba(49, 85, 245, .085), transparent 28rem),
    linear-gradient(145deg, rgba(255, 255, 255, .52), rgba(242, 240, 232, .7));
  border-bottom: 1px solid rgba(18, 18, 18, .1);
  overflow: hidden;
}

.book-page-hero-copy,
.about-page-hero-copy,
.consulting-hero-copy,
.contact-heading,
.archive-hero > * {
  opacity: var(--premium-hero-fade);
  transform: translate3d(0, var(--premium-hero-y), 0);
}

.book-page-hero.is-premium-hero-active .book-page-hero-copy,
.about-page-hero.is-premium-hero-active .about-page-hero-copy,
.consulting-hero.is-premium-hero-active .consulting-hero-copy,
.contact-hero.is-premium-hero-active .contact-heading,
.archive-hero.is-premium-hero-active > * {
  will-change: transform, opacity;
}

.blueprint-audio-player {
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 32px 84px rgba(18, 18, 18, .2);
  overflow: hidden;
}

.book-page-part,
.about-page-work-card,
.contact-channel,
.newsletter-theme-grid article,
.consulting-card-grid article,
.consulting-fit-grid article,
.archive-row > a {
  transition:
    background-color 500ms var(--premium-ease-soft),
    border-color 500ms var(--premium-ease-soft),
    box-shadow 650ms var(--premium-ease),
    color 500ms var(--premium-ease-soft),
    opacity 460ms var(--premium-ease-soft),
    transform 650ms var(--premium-ease);
}

.about-page-work-card:is(:hover, :focus-visible),
.contact-channel:is(:hover, :focus-visible),
.newsletter-theme-grid article:is(:hover, :focus-within),
.consulting-card-grid article:is(:hover, :focus-within),
.archive-row > a:is(:hover, :focus-visible) {
  box-shadow: inset 0 0 0 1px rgba(18, 18, 18, .08);
  transform: translate3d(0, -2px, 0);
}

.book-page-feedback,
.consulting-final,
.article-newsletter {
  background-image: radial-gradient(circle at var(--premium-pointer-x) var(--premium-pointer-y), rgba(255, 255, 255, .09), transparent 30%);
  overflow: hidden;
}

.archive-list {
  display: grid;
  gap: 0;
}

.archive-row > a {
  overflow: hidden;
}

.site-footer {
  overflow: hidden;
}

.footer-principles > [data-premium-step] {
  transition: color 500ms var(--premium-ease-soft), opacity 500ms var(--premium-ease-soft);
}

/* The vertical strategy stack is only used while the book can remain sticky.
 * Shorter desktop viewports keep the original horizontal, non-sticky row. */
@media (min-width: 981px) and (min-height: 600px) {
  .home-template .blueprint-section {
    align-items: start;
    overflow: clip;
  }

  .home-template .blueprint-intro {
    grid-column: 1;
    grid-row: 1;
  }

  .home-template .book-stage {
    grid-column: 2;
    grid-row: 1 / span 3;
    height: calc(100vh - 106px);
    height: min(620px, calc(100svh - 106px));
    min-height: 0;
    position: sticky;
    top: clamp(86px, 12svh, 112px);
  }

  .home-template .book-model-shell {
    height: min(clamp(500px, 42vw, 660px), calc(100svh - 150px));
  }

  .home-template .book-orbit {
    height: min(480px, 42vw, calc(100svh - 140px));
    width: min(480px, 42vw, calc(100svh - 140px));
  }

  .home-template .blueprint-pillars {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: 1fr;
  }

  .home-template .blueprint-pillars article,
  .home-template .blueprint-pillars article:not(:first-child) {
    border-bottom: 1px solid rgba(255, 255, 255, .24);
    border-right: 0;
    padding: 30px 0;
  }

  .home-template .button-acid {
    grid-column: 1;
    grid-row: 3;
  }
}

@media (max-width: 980px) {
  .site-header {
    height: 72px;
  }

  .mobile-menu nav {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    box-shadow: 0 24px 58px rgba(18, 18, 18, .22);
    overflow: hidden;
    right: 0;
  }

  .home-template .hero {
    grid-template-columns: 1fr;
  }

  .home-template .hero-copy {
    min-height: calc(100svh - 94px);
  }

  .home-template .hero-copy::before,
  .home-template .hero-card,
  .book-page-hero-copy,
  .about-page-hero-copy,
  .consulting-hero-copy,
  .contact-heading,
  .archive-hero > * {
    opacity: 1;
    transform: none;
    will-change: auto;
  }

  .home-template .hero-card {
    min-height: 660px;
  }

  .home-template .blueprint-section,
  .home-template .elwood-section,
  .home-template .about-section,
  .home-template .newsletter-section,
  .site-footer {
    margin-left: 0;
    margin-right: 0;
  }

  .home-template .blueprint-pillars {
    gap: 8px;
  }

  .home-template .blueprint-pillars article,
  .home-template .blueprint-pillars article:not(:first-child) {
    padding-bottom: 30px;
    padding-top: 30px;
  }

  .book-page-hero,
  .about-page-hero,
  .consulting-hero,
  .newsletter-page-hero,
  .contact-hero,
  .archive-hero {
    margin-left: 0;
    margin-right: 0;
  }

  /* The compact Elwood board is deliberately static on touch layouts. Keep
   * those details visible rather than routing them through the reveal system. */
  body.motion-ready .elwood-board .motion-item,
  body.motion-ready .elwood-board .motion-item.is-visible {
    animation: none;
    opacity: 1;
    translate: none;
    transform: none;
  }
}

html.premium-performance-lite [data-premium-glow]::after {
  display: none;
}

html.premium-performance-lite .home-template .orbit-ring,
html.premium-performance-lite .home-template .hero.is-premium-hero-active .orbit-ring {
  animation-play-state: paused;
  will-change: auto;
}

html.premium-performance-lite .home-template .book-model-shell {
  filter: none;
}

@media (max-width: 980px), (hover: none), (pointer: coarse) {
  [data-premium-glow]::after {
    display: none;
  }

  .home-template .book-model-shell {
    filter: none;
  }
}

@media (max-width: 600px) {
  :root {
    --premium-radius: 24px;
  }

  .home-template .hero {
    padding-bottom: 0;
  }

  .home-template .hero-copy {
    padding: 46px 18px 52px;
  }

  .home-template .hero-card {
    animation: none;
    display: grid;
    gap: 18px;
    grid-template-columns: 94px minmax(0, 1fr);
    min-height: 0;
    opacity: 1;
    padding: 22px 18px 24px;
    transform: none;
  }

  .home-template .hero-card-top {
    grid-column: 1 / -1;
  }

  .home-template .hero-card .orbit {
    margin: 0;
    width: 94px;
  }

  .home-template .hero-card .orbit-number {
    font-size: 48px;
  }

  .home-template .hero-card .orbit-label {
    bottom: 17%;
    font-size: 7px;
  }

  .home-template .hero-card-copy {
    align-self: center;
  }

  .home-template .hero-card-copy h2 {
    font-size: 34px;
    margin-bottom: 11px;
  }

  .home-template .hero-card-copy p,
  .home-template .project-kicker {
    display: none;
  }

  .home-template .hero h1 {
    font-size: clamp(50px, 14.6vw, 69px);
    line-height: .9;
    margin-bottom: 8vh;
    margin-top: 8vh;
  }

  .home-template .blueprint-section,
  .home-template .elwood-section,
  .home-template .about-section,
  .home-template .newsletter-section,
  .site-footer {
    margin-left: 0;
    margin-right: 0;
  }

  .home-template .article-grid {
    gap: 0;
  }

  .book-page-hero,
  .about-page-hero,
  .consulting-hero,
  .newsletter-page-hero,
  .contact-hero,
  .archive-hero {
    margin-left: 0;
    margin-right: 0;
  }

  [data-premium-glow]::after {
    display: none;
  }

}

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

  *,
  *::before,
  *::after {
    transition-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  body.motion-ready .motion-item.is-visible,
  .home-template .hero-card,
  .home-template .orbit-ring,
  .status-dot,
  .status-dot::before {
    animation: none !important;
  }

  .home-template .hero-copy::before,
  .home-template .hero-card,
  .home-template .hero-card[data-premium-depth] .orbit,
  .home-template .book-model-shell,
  .book-page-hero-copy,
  .about-page-hero-copy,
  .consulting-hero-copy,
  .contact-heading,
  .archive-hero > *,
  [data-premium-step],
  [data-premium-glow] {
    opacity: 1 !important;
    translate: none !important;
    transform: none !important;
  }

  [data-premium-glow]::after {
    display: none;
  }
}
