/* Styles for design.html and motion.html. Load after portfolio.css. */

.nav { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }

/* ================= PAGE HERO ================= */

.page-hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 150px 6vw 110px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 80% at 50% 45%, var(--bg-1) 0%, transparent 75%),
    radial-gradient(ellipse at 0% 100%, var(--c-800) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 0%, var(--tint-1) 0%, transparent 50%),
    var(--bg-1);
}
.page-hero::after { content: ""; position: absolute; inset: 0; background-image: var(--grain); opacity: 0.5; pointer-events: none; }
.page-hero > * { position: relative; z-index: 2; }
.page-hero .frame { position: absolute; z-index: 1; }
.page-hero h1 { font-size: clamp(3rem, 9vw, 7.5rem); margin: 22px 0 26px; }
.page-hero h1 .text-3d { display: block; }
.page-hero .section-kicker { justify-content: center; }
.page-hero .section-kicker::after { content: ""; width: 48px; height: 1px; background: var(--line); }
.page-hero p.lead { max-width: 640px; color: var(--muted); line-height: 1.75; font-size: 1.05rem; }
.page-hero .tool-row { display: flex; gap: 14px; justify-content: center; margin-top: 30px; }
.page-hero .tool-row .tool { width: 64px; height: 64px; font-size: 1.35rem; }
.page-hero .float { position: absolute; z-index: 3; padding: 18px 26px; font-family: var(--serif); letter-spacing: 0.2em; font-size: 0.9rem; }
.page-hero .float.a { top: 22%; left: 8%; transform: rotate(-4deg); }
.page-hero .float.b { bottom: 18%; right: 8%; transform: rotate(3deg); font-style: italic; font-size: 1.6rem; letter-spacing: 0.04em; }

/* ================= FEATURE SPLIT ================= */

.feature { padding: 110px 6vw; background: linear-gradient(180deg, var(--bg-2), var(--bg-3)); }
.feature-inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: center; }
.feature-copy h2 { font-size: clamp(2.2rem, 4vw, 3.4rem); margin: 18px 0 20px; }
.feature-copy p { color: var(--muted); line-height: 1.75; }
.feature-copy .spec-list { margin-top: 26px; width: 100%; }

/* ================= BEFORE / AFTER ================= */

.compare { position: relative; aspect-ratio: 3 / 4; width: min(100%, 57vh); margin: 0 auto; border-radius: 24px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5); user-select: none; touch-action: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .before { filter: grayscale(1) contrast(0.85) brightness(1.15); clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: var(--c-50); transform: translateX(-1px); pointer-events: none; }
.compare .handle::after {
  content: "\f337";
  font: 900 1rem "Font Awesome 6 Free";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--c-950);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.compare .label { position: absolute; top: 16px; padding: 6px 12px; border-radius: 999px; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; background: rgba(0, 0, 0, 0.45); color: #fff; }
.compare .label.l { left: 16px; }
.compare .label.r { right: 16px; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }

/* ================= ART GALLERY ================= */

.art-grid { columns: 3 320px; column-gap: 26px; max-width: 1320px; margin: 0 auto; }
.art {
  break-inside: avoid;
  margin-bottom: 26px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--tint-2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: zoom-in;
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
  position: relative;
}
.art:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--c-300) 55%, transparent); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45); }
.art.hide { display: none; }
.art img { width: 100%; display: block; }
.art .app { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 0.9rem; background: rgba(0, 0, 0, 0.5); color: var(--accent); border: 1px solid color-mix(in srgb, var(--c-300) 45%, transparent); }

.lightbox { margin: auto; max-width: 94vw; max-height: 92vh; border: 0; padding: 0; border-radius: 22px; background: var(--tint-3); color: var(--text); overflow: hidden; }
.lightbox::backdrop { background: color-mix(in srgb, var(--c-950) 85%, transparent); backdrop-filter: blur(6px); }
.lightbox img { display: block; max-width: 94vw; max-height: calc(92vh - 70px); }
.lightbox figcaption { padding: 18px 24px; display: flex; justify-content: space-between; gap: 20px; align-items: center; font-size: 0.9rem; }
.lightbox figcaption b { color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.lightbox .close { position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(0, 0, 0, 0.45); color: #fff; cursor: pointer; }

/* ================= SKILL CHIPS ================= */

.chips { padding: 100px 6vw; background: var(--bg-2); }
.chip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 980px; margin: 0 auto; }
.chip-row span { padding: 12px 20px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c-300) 35%, transparent); background: color-mix(in srgb, var(--c-300) 6%, transparent); font-size: 0.9rem; }
.chip-row span i { color: var(--accent); margin-right: 8px; }

.next-page { padding: 90px 6vw 60px; background: var(--bg-2); text-align: center; }
.next-page a.big { display: inline-block; font-size: clamp(2.2rem, 6vw, 4.5rem); margin-top: 18px; transition: transform 0.3s; }
.next-page a.big:hover { transform: translateX(10px); }
.next-page footer { margin-top: 80px; }

/* ================= MOTION: SHOWREEL ================= */

.reel-wrap { max-width: 1240px; margin: -60px auto 0; padding: 0 6vw; position: relative; z-index: 4; }
.reel { position: relative; aspect-ratio: 16 / 9; border-radius: 26px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55); background: var(--c-950); }
.reel video { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 16px; font-family: var(--serif); letter-spacing: 0.2em; font-size: 0.78rem; color: rgba(255, 255, 255, 0.6); text-transform: uppercase; }

/* The animated scenes stand in for a video until the video file exists. */
.scene { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 50%, var(--c-800), var(--c-950) 75%); }
.has-video .scene { display: none; }
.no-video video { display: none; }

.scene-reel .rings span { position: absolute; left: 50%; top: 50%; border: 2px solid var(--c-400); border-radius: 50%; transform: translate(-50%, -50%) scale(0); animation: ring 3.2s ease-out infinite; }
.scene-reel .rings span:nth-child(1) { width: 30vmin; height: 30vmin; }
.scene-reel .rings span:nth-child(2) { width: 30vmin; height: 30vmin; animation-delay: 0.8s; border-color: var(--c-300); }
.scene-reel .rings span:nth-child(3) { width: 30vmin; height: 30vmin; animation-delay: 1.6s; border-color: var(--c-600); }
@keyframes ring { 0% { transform: translate(-50%, -50%) scale(0); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(4); opacity: 0; } }
.scene-reel .title { font-size: clamp(2.4rem, 7vw, 6rem); text-align: center; animation: pop 3.2s ease-in-out infinite; }
.scene-reel .title small { display: block; font-family: var(--serif); font-size: 0.9rem; letter-spacing: 0.4em; color: var(--c-200); margin-top: 18px; text-shadow: none; }
@keyframes pop { 0%, 100% { transform: scale(0.96); } 50% { transform: scale(1.04); } }

/* ================= MOTION: CLIP CARDS ================= */

#clips .grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); max-width: 1180px; }

.clip { border-radius: 24px; overflow: hidden; background: var(--tint-2); border: 1px solid rgba(255, 255, 255, 0.07); transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s; }
.clip:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--c-300) 55%, transparent); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45); }
.clip .screen { position: relative; aspect-ratio: 16 / 10; background: var(--c-950); }
.clip .screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip .len { position: absolute; bottom: 12px; right: 12px; z-index: 2; padding: 4px 10px; border-radius: 8px; font-size: 0.72rem; font-weight: 700; background: rgba(0, 0, 0, 0.55); color: #fff; }

/* Logo reveal */
.s-logo .word { display: flex; gap: 0.08em; font-size: clamp(2rem, 4vw, 3rem); }
.s-logo .word span { display: inline-block; animation: drop 3s cubic-bezier(0.3, 1.6, 0.5, 1) infinite; }
.s-logo .word span:nth-child(2) { animation-delay: 0.1s; }
.s-logo .word span:nth-child(3) { animation-delay: 0.2s; }
.s-logo .word span:nth-child(4) { animation-delay: 0.3s; }
.s-logo .word span:nth-child(5) { animation-delay: 0.4s; }
@keyframes drop { 0% { transform: translateY(-140%); opacity: 0; } 20%, 75% { transform: none; opacity: 1; } 100% { transform: translateY(40%); opacity: 0; } }

/* Kinetic type */
.s-kinetic { font-family: var(--sans); font-weight: 900; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: 0.04em; }
.s-kinetic span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: 0; animation: kin 4.5s infinite; color: var(--c-100); }
.s-kinetic span:nth-child(2) { animation-delay: 1.5s; color: var(--c-300); }
.s-kinetic span:nth-child(3) { animation-delay: 3s; -webkit-text-stroke: 1.5px var(--c-200); color: transparent; }
@keyframes kin { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2) rotate(-6deg); } 8%, 28% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 34%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.6) translateY(40px); } }

/* Coin spin */
.s-coin { perspective: 600px; }
.s-coin .coin { width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe9a3, #e0a822 60%, #a8751a); border: 5px solid #8a5a00; display: grid; place-items: center; font: 900 1.4rem var(--sans); color: #8a5a00; animation: spin 2.4s linear infinite, bounce 1.2s ease-in-out infinite; }
.s-coin .shadow { position: absolute; bottom: 22%; width: 70px; height: 12px; border-radius: 50%; background: rgba(0, 0, 0, 0.45); animation: squash 1.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotateY(360deg); } }
@keyframes bounce { 0%, 100% { translate: 0 18px; } 50% { translate: 0 -28px; } }
@keyframes squash { 0%, 100% { transform: scaleX(1); opacity: 0.6; } 50% { transform: scaleX(0.6); opacity: 0.25; } }

/* XP drop UI */
.s-ui .panel { width: 70%; }
.s-ui .bar { height: 14px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.15); }
.s-ui .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--c-500), var(--c-200)); animation: fill 3s ease-in-out infinite; }
.s-ui .row { display: flex; justify-content: space-between; font: 700 0.8rem var(--sans); color: var(--c-200); margin-bottom: 8px; letter-spacing: 0.08em; }
.s-ui .xp { position: absolute; right: 18%; top: 30%; font: 900 1.2rem var(--sans); color: #ffd34d; text-shadow: 0 2px 0 #000; animation: xp 3s ease-out infinite; }
@keyframes fill { 0% { width: 8%; } 70%, 100% { width: 92%; } }
@keyframes xp { 0%, 20% { opacity: 0; transform: translateY(20px); } 35% { opacity: 1; } 80%, 100% { opacity: 0; transform: translateY(-40px); } }

/* Shape layers */
.s-shapes .dot { position: absolute; width: 26px; height: 26px; border-radius: 50%; background: var(--c-300); animation: orbit 3s ease-in-out infinite; }
.s-shapes .dot:nth-child(2) { background: var(--c-500); animation-delay: -1s; border-radius: 6px; }
.s-shapes .dot:nth-child(3) { background: var(--c-100); animation-delay: -2s; border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.s-shapes .core { width: 70px; height: 70px; border: 3px solid var(--c-200); animation: morph 3s ease-in-out infinite; }
@keyframes orbit { 0% { transform: rotate(0deg) translateX(70px) rotate(0deg) scale(1); } 50% { transform: rotate(180deg) translateX(30px) rotate(-180deg) scale(1.5); } 100% { transform: rotate(360deg) translateX(70px) rotate(-360deg) scale(1); } }
@keyframes morph { 0%, 100% { border-radius: 50%; transform: rotate(0deg); } 50% { border-radius: 12px; transform: rotate(135deg); } }

/* Lower third */
.s-lower { place-items: end start; padding: 0 0 12% 8%; }
.s-lower .lt { display: flex; flex-direction: column; gap: 6px; }
.s-lower .lt b, .s-lower .lt span { display: inline-block; padding: 8px 16px; animation: slide 4s cubic-bezier(0.7, 0, 0.2, 1) infinite; }
.s-lower .lt b { background: var(--accent); color: var(--c-950); font-size: 1.1rem; letter-spacing: 0.04em; }
.s-lower .lt span { background: var(--c-950); color: var(--c-100); font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; width: fit-content; animation-delay: 0.15s; }
@keyframes slide { 0% { clip-path: inset(0 100% 0 0); } 15%, 75% { clip-path: inset(0 0 0 0); } 90%, 100% { clip-path: inset(0 0 0 100%); } }

/* ================= MOTION: TIMELINE ================= */

.timeline-sec { padding: 110px 6vw; background: linear-gradient(180deg, var(--bg-3), var(--bg-2)); }
.timeline { max-width: 1100px; margin: 0 auto; border-radius: 20px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); background: #19171b; font: 600 0.78rem var(--sans); }
.tl-head { display: grid; grid-template-columns: 200px 1fr; background: #232026; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.tl-head div { padding: 10px 16px; color: var(--muted); }
.tl-ruler { position: relative; display: flex; justify-content: space-between; }
.tl-row { display: grid; grid-template-columns: 200px 1fr; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.tl-row .name { padding: 14px 16px; display: flex; align-items: center; gap: 10px; color: var(--text); border-right: 1px solid rgba(255, 255, 255, 0.06); }
.tl-row .name i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.tl-row .track { position: relative; }
.tl-row .bar { position: absolute; top: 9px; bottom: 9px; left: var(--from); width: var(--len); border-radius: 6px; background: color-mix(in srgb, var(--c) 35%, transparent); border: 1px solid var(--c); }
.tl-row .key { position: absolute; top: 50%; left: var(--at); width: 11px; height: 11px; background: #ffd34d; transform: translate(-50%, -50%) rotate(45deg); border: 1px solid #000; }
.tl-body { position: relative; }
.playhead { position: absolute; top: 0; bottom: 0; left: 200px; width: 2px; background: #3d8bff; animation: play 6s linear infinite; z-index: 2; }
.playhead::before { content: ""; position: absolute; top: -2px; left: -6px; border: 7px solid transparent; border-top-color: #3d8bff; }
@keyframes play { from { left: 200px; } to { left: 100%; } }

@media (max-width: 900px) {
  .feature-inner { grid-template-columns: 1fr; }
  .page-hero .float { display: none; }
  .tl-head, .tl-row { grid-template-columns: 110px 1fr; }
  .playhead { left: 110px; animation-name: play-sm; }
  @keyframes play-sm { from { left: 110px; } to { left: 100%; } }
}
