/* ==========================================================================
   Base — reset, typography defaults, shared primitives and keyframes
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-sans);
  font-weight: var(--fw-light);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Page scroll is locked while the flow or a full-screen modal is open. */
html.is-locked,
html.is-locked body {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
  text-align: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* ---- Shared primitives ----------------------------------------------- */

/* The oversized brand full stop that closes headings: "Portfolio." */
.dot {
  font-size: 1.5em;
  line-height: 0;
  vertical-align: baseline;
}

.dot--accent {
  color: var(--accent);
}

/* Uppercase micro label */
.label {
  font-weight: var(--fw-medium);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

/* Inline SVG chevron (replaces the bundle's 1024px PNG) */
.chev {
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .34s var(--ease-out);
}

.chev--left { transform: scaleX(-1); }
.chev--up { transform: rotate(-90deg); }
.chev--down { transform: rotate(90deg); }

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

/* Close "✕" drawn as SVG so it is crisp at every size */
.close-x {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: inherit;
  transition: transform var(--dur-1) var(--ease-out), opacity var(--dur-1);
}

.close-x svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.close-x:active {
  transform: scale(.9);
}

/* ---- Keyframes -------------------------------------------------------- */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes planIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slideFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes boxUp { from { opacity: 0; transform: translateY(calc(72% + 70px)); } to { opacity: 1; transform: translateY(72%); } }
@keyframes dropIn {
  from { opacity: 0; transform: perspective(1200px) translateY(-80px) rotateX(30deg); }
  to { opacity: 1; transform: perspective(1200px) translateY(0) rotateX(0); }
}
@keyframes caretBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes aiPulse { 0%, 100% { opacity: .25; } 50% { opacity: .9; } }
@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@keyframes aiwave { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes aiscan { from { left: -45%; } to { left: 110%; } }
@keyframes popIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes scOpen { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@keyframes scClose { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.9); } }
@keyframes checkMorph { 0% { stroke-dashoffset: 120; opacity: 0; } 30% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes ringMorph { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
@keyframes scanline { from { top: -10%; } to { top: 110%; } }
@keyframes pinDrop { 0% { opacity: 0; transform: translateY(-42px); } 60% { transform: translateY(3px); } 100% { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---- Click → expand → dissolve transition overlay ---------------------- */

.expand-overlay {
  position: fixed;
  z-index: var(--z-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius);
  pointer-events: none;
  transition:
    top .62s var(--ease-expand),
    left .62s var(--ease-expand),
    width .62s var(--ease-expand),
    height .62s var(--ease-expand),
    border-radius .62s var(--ease-expand),
    opacity .42s ease;
}

.expand-overlay__label {
  padding: 0 6vw;
  font-weight: var(--fw-thin);
  font-size: min(7vw, 86px);
  line-height: 1;
  text-align: center;
  transform: scale(.42);
  transition: transform .62s var(--ease-expand), opacity .42s ease;
}

.expand-overlay.is-expanded {
  border-radius: 0;
}

.expand-overlay.is-expanded .expand-overlay__label {
  transform: scale(1);
}

.expand-overlay.is-dissolving,
.expand-overlay.is-dissolving .expand-overlay__label {
  opacity: 0;
}

/* ---- Reduced motion --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
