/* Artha Portfolios Holding Page
   Built on the Nexus Observatory 04 v5/v6 design system with continuous Dusk solar theme,
   Silk Caustics 80% ambient backdrop, metallic Ephesis calligraphy and Geist UI typography. */

@font-face {
  font-family: 'Geist';
  src: url('./fonts/geist.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Ephesis';
  src: url('./fonts/Ephesis-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Evening default tokens (t = 0.84) prior to JS hydration */
  --bg: rgb(11, 12, 24);
  --bg-rgb: 11, 12, 24;
  --bg-card-solid: rgb(18, 21, 37);
  --ink: rgb(246, 247, 254);
  --ink-rgb: 246, 247, 254;
  --ink-soft: rgb(211, 217, 235);
  --ink-muted: rgb(162, 172, 196);
  --ink-dim: rgb(115, 126, 155);
  --border: rgba(255, 255, 255, 0.09);
  --border-hi: rgba(255, 255, 255, 0.17);
  --gold: rgb(237, 187, 107);
  --gold-rgb: 237, 187, 107;
  --gold-bright: rgb(255, 227, 175);
  --gold-bright-rgb: 255, 227, 175;
  --gold-deep: rgb(213, 148, 56);
  --indigo-ice: rgb(202, 211, 255);
  --indigo-beam-rgb: 153, 166, 255;

  --grid-line: rgba(255, 255, 255, 0.024);
  --aura-a: rgba(116, 129, 242, 0.11);
  --aura-b: rgba(235, 179, 103, 0.08);
  --control-bg: rgba(18, 21, 37, 0.68);
  --gold-tint-bg: rgba(237, 187, 107, 0.12);

  --footer-dot-core: #fffaf0;
  --footer-dot-mid: #ffd98e;
  --footer-dot-edge: #d49438;
  --footer-dot-glow: rgba(237, 187, 107, 0.65);

  --dusk-bezel-top: rgb(63, 67, 90);
  --dusk-bezel-bottom: rgb(33, 36, 52);
  --dusk-bezel-rim: rgba(255, 255, 255, 0.15);
  --dusk-bezel-shadow: 0 8px 24px rgba(0, 0, 0, 0.68), 0 0 26px rgba(93, 91, 139, 0.34);

  --font-ui: 'Geist', system-ui, -apple-system, sans-serif;
  --font-script: 'Ephesis', cursive;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --handover-landing-duration: 1450ms;
}

html.is-theme-crossing,
html.is-theme-crossing body,
html.is-theme-crossing .holding-footer,
html.is-theme-crossing .motion-toggle {
  transition:
    background-color 240ms ease,
    color 220ms ease,
    border-color 220ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

button {
  font: inherit;
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================================
   AMBIENT BACKDROP: SILK CAUSTICS 80% + GRID + POINTER AURA
   ======================================================== */
.caustics-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 68% 58% at 50% 42%, rgba(var(--indigo-beam-rgb), 0.14), transparent 72%),
    radial-gradient(ellipse 52% 46% at 54% 52%, rgba(var(--gold-rgb), 0.1), transparent 70%);
}

html[data-webgl='silk-caustics'] .caustics-stage {
  background: none;
}

.caustics-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.nexus-grid-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 84% 70% at 50% 46%, #000 28%, transparent 92%);
  -webkit-mask-image: radial-gradient(ellipse 84% 70% at 50% 46%, #000 28%, transparent 92%);
}

.pointer-aura {
  position: fixed;
  top: 0;
  left: 0;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--aura-a) 0%, var(--aura-b) 36%, transparent 70%);
  transform: translate3d(-999px, -999px, 0);
  pointer-events: none;
  z-index: 2;
  will-change: transform;
}

/* ========================================================
   TOP MENU BAR: SLIDER + PAUSE MOTION ONLY
   ======================================================== */
.top-fade-veil {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 128px;
  z-index: 32;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(var(--bg-rgb), 0.88) 0%,
    rgba(var(--bg-rgb), 0.44) 55%,
    rgba(var(--bg-rgb), 0) 100%
  );
}

.nexus-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: 88px;
  padding-inline: clamp(20px, 3.2vw, 56px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  pointer-events: auto;
}

.dusk-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.dusk-bezel {
  padding: 3.5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--dusk-bezel-top) 0%, var(--dusk-bezel-bottom) 100%);
  box-shadow:
    inset 0 1px 0 var(--dusk-bezel-rim),
    inset 0 -1px 1px rgba(0, 0, 0, 0.28),
    var(--dusk-bezel-shadow);
  transition: transform 180ms var(--ease-out);
}

.dusk-track {
  position: relative;
  width: 122px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background: #0b0f22;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.52);
}

.dusk-control.is-dragging .dusk-track {
  cursor: grabbing;
}

.dusk-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
}

.motion-toggle {
  padding: 9px 14px;
  border-radius: 4px;
  border: 1px solid var(--border-hi);
  background: var(--control-bg);
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    background-color 180ms var(--ease-out);
}

.motion-toggle:hover {
  color: var(--ink);
  border-color: var(--gold);
}

.motion-toggle[aria-pressed='true'] {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: var(--gold-tint-bg);
}

/* ========================================================
   MAIN HOLDING STAGE (SINGLE VIEWPORT)
   ======================================================== */
.holding-shell {
  position: relative;
  z-index: 12;
  min-height: 100svh;
  width: min(1620px, calc(100% - clamp(28px, 4.5vw, 76px)));
  margin-inline: auto;
  padding: 96px 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.holding-center {
  position: relative;
  margin-block: auto;
  padding-block: clamp(24px, 5vh, 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.signature-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2vh, 14px);
  max-width: 100%;
}

@keyframes foilSheen {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.handover-name {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  column-gap: 0.24em;
  row-gap: 0.02em;
  width: 100%;
  font-size: clamp(4.2rem, min(11.4vw, 20svh), 11.4rem);
  font-weight: 400;
  line-height: 0.94;
}

.handover-word-wrap {
  position: relative;
  display: inline-block;
  width: max-content;
  max-width: 100%;
  text-align: left;
}

.handover-word {
  display: block;
  padding-inline: 0.06em 0.14em;
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: 0.005em;
  white-space: nowrap;
  color: transparent;
  background-image: linear-gradient(
    118deg,
    #788399 0%,
    #dfe6f4 16%,
    #ffffff 25%,
    #6c778e 39%,
    #eef2fa 54%,
    #ffffff 62%,
    #768198 76%,
    #d6deee 90%,
    #9aa6be 100%
  );
  background-size: 210% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.24))
    drop-shadow(0 3px 5px rgba(0, 0, 0, 0.78))
    drop-shadow(0 0 18px rgba(212, 224, 248, 0.16));
  animation: foilSheen 10s ease-in-out infinite;
  -webkit-mask-image: linear-gradient(
    102deg,
    #000 calc(var(--write-p, 114%) - 7%),
    transparent calc(var(--write-p, 114%) + 3%)
  );
  mask-image: linear-gradient(
    102deg,
    #000 calc(var(--write-p, 114%) - 7%),
    transparent calc(var(--write-p, 114%) + 3%)
  );
}

.handover-last {
  font-size: 0.96em;
}

html[data-theme-polarity='light'] .handover-word {
  background-image: linear-gradient(
    118deg,
    #252c3e 0%,
    #727e96 18%,
    #a2adc4 27%,
    #1c2333 42%,
    #7e8aa4 58%,
    #b0bacf 66%,
    #232a3b 80%,
    #69748c 100%
  );
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.78))
    drop-shadow(0 2px 3px rgba(18, 22, 34, 0.24));
}

/* Twin-layer anchor keeps .handover-word childless so WebKit/Safari never hides the dotless "ı" */
.handover-dot-anchor {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  padding-inline: 0.06em 0.14em;
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: 0.005em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-fill-color: transparent;
  pointer-events: none;
  user-select: none;
}

.handover-partner {
  position: relative;
  display: inline-block;
}

/* Exact native Ephesis 'i' dot coordinates derived from Ephesis-Regular.ttf */
.handover-dot {
  position: absolute;
  width: 0.076em;
  height: 0.076em;
  left: 0.205em;
  top: 0.294em;
  border-radius: 50%;
}

html[data-theme-polarity='light'] .holding-center {
  --footer-dot-core: #fff7df;
  --footer-dot-mid: #d6a348;
  --footer-dot-edge: #8c5e18;
  --footer-dot-glow: rgba(176, 126, 40, 0.42);
}

.handover-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 32%,
    var(--footer-dot-core) 0%,
    var(--footer-dot-mid) 48%,
    var(--footer-dot-edge) 100%
  );
  filter: drop-shadow(0 0 6px var(--footer-dot-glow));
}

.handover-dot::after {
  content: '';
  position: absolute;
  inset: -110%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(var(--gold-bright-rgb), 0.78) 0%,
    rgba(var(--gold-rgb), 0.36) 40%,
    transparent 74%
  );
  opacity: 0;
  transform: scale(0.45);
  pointer-events: none;
}

.holding-center[data-signature-state='writing'] .handover-dot {
  visibility: hidden;
}

.holding-center[data-signature-state='landed'] .handover-dot::before {
  animation: handoverBreathe var(--handover-landing-duration) var(--ease-out) forwards;
}

.holding-center[data-signature-state='landed'] .handover-dot::after {
  animation: handoverBloom var(--handover-landing-duration) var(--ease-out) forwards;
}

.signature-sphere {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  background: radial-gradient(
    circle at 35% 32%,
    var(--footer-dot-core) 0%,
    var(--footer-dot-mid) 48%,
    var(--footer-dot-edge) 100%
  );
  box-shadow:
    0 0 12px var(--footer-dot-glow),
    0 0 28px rgba(var(--gold-rgb), 0.42);
}

@keyframes handoverBreathe {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 7px var(--footer-dot-glow));
  }
  34% {
    transform: scale(1.36);
    filter: drop-shadow(0 0 16px rgba(var(--gold-bright-rgb), 0.85));
  }
  72% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1.04);
    filter: drop-shadow(0 0 9px var(--footer-dot-glow));
  }
}

@keyframes handoverBloom {
  0% {
    opacity: 0;
    transform: scale(0.45);
  }
  30% {
    opacity: 0.78;
    transform: scale(1.48);
  }
  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

.handover-tagline {
  display: inline-block;
  margin: 0;
  padding-inline: 0.14em;
  font-family: var(--font-script);
  font-size: clamp(2rem, min(3.8vw, 6.4svh), 3.8rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: transparent;
  background-image: linear-gradient(
    115deg,
    #b6863d 0%,
    #f3cf8d 18%,
    #fff4d8 29%,
    #c59446 44%,
    #ffe6b6 60%,
    #fff7e2 68%,
    #ba8b40 82%,
    #f1ca85 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 1px 0 rgba(255, 246, 224, 0.22))
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.74))
    drop-shadow(0 0 14px rgba(234, 185, 104, 0.18));
  animation: foilSheen 8.5s ease-in-out infinite;
  -webkit-mask-image: linear-gradient(
    -102deg,
    #000 calc(var(--write-rtl, 114%) - 7%),
    transparent calc(var(--write-rtl, 114%) + 3%)
  );
  mask-image: linear-gradient(
    -102deg,
    #000 calc(var(--write-rtl, 114%) - 7%),
    transparent calc(var(--write-rtl, 114%) + 3%)
  );
}

html[data-theme-polarity='light'] .handover-tagline {
  background-image: linear-gradient(
    115deg,
    #7c5318 0%,
    #cfa04b 20%,
    #ebd08c 31%,
    #885b1a 48%,
    #dab05e 66%,
    #784f15 84%,
    #c29240 100%
  );
  filter:
    drop-shadow(0 1px 0 rgba(255, 250, 236, 0.75))
    drop-shadow(0 2px 3px rgba(48, 32, 12, 0.2));
}

/* "Website coming soon..." set cleanly in Geist directly below the calligraphy */
.coming-soon {
  margin: clamp(22px, 3.6vh, 38px) 0 0;
  font-family: var(--font-ui);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 780ms var(--ease-out),
    transform 780ms var(--ease-out);
}

.coming-soon[data-visible='false'] {
  opacity: 0;
  transform: translateY(10px);
}

/* ========================================================
   FOOTER
   ======================================================== */
.holding-footer {
  position: relative;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  font-family: var(--font-ui);
  color: var(--ink-muted);
  text-shadow: 0 1px 12px rgba(var(--bg-rgb), 0.9);
}

.holding-footer::before {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 150px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(var(--bg-rgb), 0.86) 0%,
    rgba(var(--bg-rgb), 0.48) 54%,
    rgba(var(--bg-rgb), 0) 100%
  );
}

.footer-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  font-size: 13px;
}

.footer-email {
  color: var(--ink-soft);
  transition: color 180ms var(--ease-out);
}

.footer-credit {
  margin: 0;
  color: var(--ink-muted);
  text-align: right;
}

.footer-credit a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--border-hi);
  text-underline-offset: 3px;
  transition:
    color 180ms var(--ease-out),
    text-decoration-color 180ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .footer-email:hover,
  .footer-credit a:hover {
    color: var(--gold-bright);
    text-decoration-color: var(--gold);
  }
}

.footer-legal {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-dim);
  max-width: 96ch;
}

.footer-legal p {
  margin: 0;
}

/* ========================================================
   PAUSED MOTION & PREFERS-REDUCED-MOTION (WCAG 2.2.2)
   ======================================================== */
html[data-motion='paused'] *,
html[data-motion='paused'] *::before,
html[data-motion='paused'] *::after {
  animation: none !important;
  transition-duration: 0ms !important;
}

html[data-motion='paused'] .pointer-aura {
  display: none !important;
}

html[data-motion='paused'] .handover-word,
html[data-motion='paused'] .handover-tagline {
  -webkit-mask-image: none;
  mask-image: none;
}

html[data-motion='paused'] .handover-dot {
  visibility: visible;
}

html[data-motion='paused'] .signature-sphere {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .pointer-aura,
  .signature-sphere {
    display: none;
  }
  .handover-word,
  .handover-tagline {
    -webkit-mask-image: none;
    mask-image: none;
    animation: none !important;
  }
  .handover-dot {
    visibility: visible;
  }
  .handover-dot::before,
  .handover-dot::after {
    animation: none !important;
  }
  .coming-soon {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ========================================================
   RESPONSIVE REFINEMENTS
   ======================================================== */
@media (max-width: 1060px) {
  .handover-name {
    font-size: clamp(3.6rem, 13vw, 7.6rem);
  }
  .handover-tagline {
    font-size: clamp(1.9rem, 5.2vw, 3.1rem);
  }
}

@media (max-width: 640px) {
  .top-fade-veil {
    height: 108px;
  }
  .nexus-nav {
    height: 70px;
    padding-inline: 16px;
  }
  .nav-controls {
    gap: 10px;
  }
  .dusk-bezel {
    padding: 2.5px;
  }
  .dusk-track {
    width: 92px;
    height: 34px;
  }
  .motion-toggle {
    padding: 7px 10px;
    font-size: 11px;
  }
  .holding-shell {
    padding: 82px 0 20px;
  }
  .handover-name {
    font-size: clamp(3.3rem, 15.5vw, 5.2rem);
  }
  .handover-tagline {
    font-size: clamp(1.65rem, 7.4vw, 2.35rem);
  }
  .coming-soon {
    font-size: 0.97rem;
  }
  .footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .footer-credit {
    text-align: left;
  }
}
