@font-face {
  font-family: 'Recursive';
  src: url('assets/fonts/recursive.woff2') format('woff2');
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.85);
  --btn-overlay: rgba(0, 0, 0, 0.35);
  --gap: clamp(8px, 1.6vh, 18px);
  --radius-lg: 6px;
  --radius-md: 4px;
  --radius-sm: 2px;
  --radius-circle: 50%;
}

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

html {
  height: 100%;
  background: #0e0204;
}

.bg-video {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

body {
  font-family: 'Recursive', system-ui, sans-serif;
  font-variation-settings: 'MONO' 0, 'CASL' 0, 'slnt' 0;
  color: var(--text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: clamp(12px, 3vw, 20px);
  overflow: clip;
}

.page {
  position: relative;
  z-index: 1;
  width: min(100%, 460px, calc(100vh * 9 / 16));
  width: min(100%, 460px, calc(100dvh * 9 / 16));
  height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
  max-height: calc(100vh - 60px);
  max-height: calc(100dvh - 60px);
  padding: clamp(12px, 2vh, 22px) clamp(14px, 4vw, 22px) 15px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--gap);
  background: transparent;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  isolation: isolate;
}

.refract-layer {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  object-fit: cover;
  z-index: 0;
  filter: url(#displace-25) blur(4px);
  transform: scale(1.5);
  clip-path: inset(0);
  pointer-events: none;
  opacity: 1;
}

.page > *:not(.refract-layer) {
  position: relative;
  z-index: 1;
}

.page::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    160deg,
    rgba(255, 120, 60, 0.25) 0%,
    rgba(255, 80, 30, 0.05) 40%,
    rgba(0, 0, 0, 0.2) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.icon-btn {
  width: clamp(32px, 5vh, 40px);
  height: clamp(32px, 5vh, 40px);
  border-radius: var(--radius-circle);
  border: none;
  background: var(--btn-overlay);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.15s ease, background 0.15s ease;
}

.icon-btn svg {
  width: 55%;
  height: 55%;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: scale(1.05);
}

.icon-btn[aria-label="Share"] {
  width: clamp(35px, 5vh, 43px);
  height: clamp(35px, 5vh, 43px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.icon-btn[aria-label="Share"]:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.share-icon-btn:hover {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.debug-btn {
  display: none;
  font-size: 10px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
}

.hero-logo {
  height: clamp(32px, 4.5vh, 44px);
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.hero-statement {
  text-align: left;
  flex-shrink: 0;
}

.hero-statement h1 {
  font-size: clamp(32px, 6vh, 42px);
  font-weight: 800;
  font-style: normal;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.hero-bio {
  font-size: clamp(10px, 1.4vh, 12px);
  color: var(--text-muted);
  line-height: 1.4;
  flex-shrink: 0;
  margin-top: -15px;
  margin-bottom: 5px;
}

.link-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(5px, 0.8vh, 8px) 14px clamp(5px, 0.8vh, 8px) clamp(6px, 1vh, 10px);
  background: transparent;
  border: 1px solid #a51d1d;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: #2a0808;
  transition: transform 0.15s ease;
}

.link-btn:hover {
  box-shadow: 0 0 0 1.5px #a51d1d;
}

.link-btn .ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: #a51d1d;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.link-label {
  position: relative;
  z-index: 1;
  flex: 1;
  text-align: center;
  font-size: clamp(12px, 1.7vh, 15px);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.profile-card {
  position: relative;
  background: rgba(255, 80, 30, 0.10);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.topbar         { animation: fadeUp 0.45s ease both; animation-delay: 0s;   }
.hero-statement { animation: fadeUp 0.45s ease both; animation-delay: 0.1s; }
.profile-card   { animation: fadeUp 0.45s ease both; animation-delay: 0.2s; }
.stack-deck     { animation: fadeUp 0.45s ease both; animation-delay: 0.3s; }

/* === Stack deck === */
.stack-deck {
  --deck-offset: clamp(40px, 5.5vh, 56px);
  position: relative;
  width: 100%;
  height: auto;
  margin-top: -56px;
  overflow: visible;
  flex: 0 0 auto;
}

.deck-card {
  position: relative;
  left: 0;
  right: 0;
  cursor: pointer;
  transition: transform 0.2s ease, height 0.2s ease;
  min-height: 0;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .deck-card:hover { transform: translateY(-25px); }
}

.deck-card.touch-lift { transform: translateY(-25px); }

.deck-card.expanded ~ .deck-card.collapsed:hover {
  height: calc(var(--deck-offset) + 25px);
}

.folder-wrap {
  position: relative;
  width: 100%;
  height: auto;
  filter: drop-shadow(0px 6px 8px rgba(0, 0, 0, 0.45));
}

.folder-inner {
  position: relative;
  width: 100%;
  height: auto;
  background: rgba(255, 248, 225, 1);
  display: flex;
  flex-direction: column;
  transition: clip-path 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.deck-card.collapsed {
  bottom: auto;
  height: var(--deck-offset);
}

.deck-card.expanded ~ .deck-card.collapsed {
  top: calc(100% - var(--deck-offset));
  bottom: 0;
  height: var(--deck-offset);
}

.deck-card.expanded .folder-inner {
  height: 100%;
}

.deck-card.collapsed .folder-inner {
  height: 100%;
}

.deck-card-peek {
  display: flex;
  align-items: center;
  padding: 4px 0 0 12px;
  flex-shrink: 0;
}

.stack-label {
  font-size: clamp(13px, 1.8vh, 15px);
  font-weight: 800;
  color: #a51d1d;
  transition: transform 0.2s ease;
  letter-spacing: 0.2px;
}

.deck-card-content {
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.8vh, 8px);
  padding: clamp(4px, 0.8vh, 8px) clamp(12px, 3vw, 16px) 20px;
  color: #2a0808;
  overflow: visible;
  flex: 1 1 auto;
  min-height: 0;
}

.deck-card-content > * {
  pointer-events: all;
}

.portfolio-grid {
  display: grid;
  gap: 5px;
  width: 100%;
  flex: 1 1 auto;
}

.portfolio-item {
  position: relative;
  background-color: rgba(165, 29, 29, 0.8);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--radius-sm);
}

.layout-a {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
}

.layout-a .pi1 {
  grid-column: span 2;
  grid-row: span 2;
}

.layout-a .pi5 {
  grid-column: span 2;
}

.layout-b {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 2fr 1fr 1fr;
}

.layout-b .pi1 {
  grid-row: span 2;
}

.layout-c {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
}

.layout-c .pi1 {
  grid-row: span 2;
}

.layout-c .pi2 {
  grid-column: span 2;
}

.layout-c .pi5 {
  grid-column: span 1;
}

.layout-c .pi6 {
  grid-column: span 2;
}

.layout-d {
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
}

.layout-d .pi1 {
  grid-row: span 3;
}

.layout-f {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
}

.layout-f .pi1 { grid-column: 1; grid-row: 1; }
.layout-f .pi2 { grid-column: 2; grid-row: 1; }
.layout-f .pi3 { grid-column: 1; grid-row: 2 / span 2; }
.layout-f .pi4 { grid-column: 2; grid-row: 2; }
.layout-f .pi5 { grid-column: 2; grid-row: 3; }

.phrase-alt {
  font-weight: 300;
  font-style: italic;
}

.site-credit {
  position: fixed;
  bottom: clamp(8px, 3vh, 30px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: clamp(10px, 1.3vh, 12px);
  font-weight: 300;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  z-index: 1;
}

.site-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.site-credit a:hover {
  color: rgba(255, 255, 255, 0.9);
}

.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  border-radius: inherit;
  z-index: 99;
}

.share-overlay.on {
  opacity: 1;
  pointer-events: all;
}

.share-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(14, 2, 4, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  backdrop-filter: blur(16px);
  padding: 14px 20px 28px;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 100;
}

.share-sheet.on {
  transform: translateY(0);
}

.share-handle {
  width: 32px;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.share-icons {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.share-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
}

.share-icon-btn div {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.share-icon-btn div:hover {
  background: rgba(255, 255, 255, 0.16);
}

.share-icon-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.2px;
}

.share-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-50px);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 7px 16px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
  z-index: 101;
  pointer-events: none;
}

.share-toast.on {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.link-btn:focus-visible {
  outline: 4px solid #a51d1d;
  outline-offset: 2px;
}

.icon-btn:focus-visible {
  outline: 4px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.share-icon-btn:focus-visible {
  outline: 4px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

