/* ==========================================================
   joshuamasih.com, v3 · homepage
   Red-orange banner, Snowy White page, Yellow Punk motion
   ========================================================== */

.home {
  --red: #F42902;
  --snow: #FDFDFF;
  --lime: #D4FB52;
  --ink: #111111;
  --display: 'Archivo', 'Instrument Sans', system-ui, sans-serif;
  --bg: var(--snow);
  --fg: var(--ink);
  --accent: var(--red);
  --tile: #F1F1F4;
  --line: #E2E2E6;
  --muted: #5E5E62;
}

/* ---------------- Hero banner ---------------- */
.hero-wrap { padding: 14px; }
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(calc(100svh - 28px), 980px);
  min-height: max(640px, min(calc(100svh - 28px), 980px));
  padding: 22px clamp(18px, 2.6vw, 36px) 28px;
  border-radius: clamp(20px, 2.4vw, 32px);
  background-color: var(--red);
  background-image:
    linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: -1px -1px;
  color: #fff;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Nav inside the banner */
.hero-nav { position: relative; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 0; }
.logo:hover { color: inherit; }
.logo-bubble {
  position: relative; display: inline-block;
  padding: 7px 14px 7px; background: #fff; color: var(--ink);
  font-family: var(--display); font-weight: 900; font-stretch: 110%; font-size: 15px; letter-spacing: .01em;
  border-radius: 999px;
}
.logo-bubble::after { /* speech-bubble tail */
  content: ''; position: absolute; left: 12px; bottom: -6px; width: 12px; height: 12px;
  background: #fff; clip-path: polygon(0 0, 100% 0, 0 100%);
}
.logo-tag {
  margin-left: -4px; padding: 5px 12px; border: 2px solid var(--lime); color: var(--lime);
  font-family: var(--display); font-weight: 900; font-stretch: 110%; font-size: 13px; letter-spacing: .02em;
  border-radius: 999px; transform: rotate(-4deg); background: var(--red);
}
.hero-pills { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.hero-pills a, .hero-cta {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px;
  border: 1.5px solid rgba(255,255,255,.55); border-radius: 999px;
  font-size: 14px; font-weight: 600; color: #fff; transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.hero-pills a:hover { background: #fff; color: var(--red); border-color: #fff; }
.hero-cta { min-height: 42px; padding: 0 22px; border-color: #fff; border-width: 2px; }
.hero-cta:hover { background: var(--lime); border-color: var(--lime); color: var(--ink); }

/* Big type */
.hero-type {
  position: relative; z-index: 3;
  align-self: center;
  margin: 0; padding: clamp(24px, 4vw, 48px) 0 0;
  display: flex; flex-direction: column;
  font-family: var(--display); font-weight: 900; font-stretch: 118%;
  font-size: clamp(56px, 9.6vw, 172px); line-height: .84; letter-spacing: -0.035em;
  text-transform: uppercase; color: #fff;
  pointer-events: none;
}
.hero-type .line { display: block; white-space: nowrap; }
.hero-type .line:nth-child(2) { padding-left: .9em; }
.hash {
  display: inline-block; color: var(--lime); margin-right: .02em;
  transform-origin: 50% 60%;
  animation: hash-wobble 3.2s cubic-bezier(.45,.05,.3,1.3) infinite;
}
@keyframes hash-wobble {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.08) translateY(-.03em); }
}

/* 3D portrait */
.portrait3d {
  position: absolute; z-index: 4;
  right: clamp(-60px, -1vw, 0px); bottom: 0;
  height: 92%; aspect-ratio: 0.92;
  max-width: 62%;
  cursor: grab;
}
.portrait3d canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.portrait-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; transition: opacity .6s ease; }
.portrait3d.is-3d .portrait-fallback { opacity: 0; }
.portrait3d canvas { opacity: 0; transition: opacity .8s ease; }
.portrait3d.is-3d canvas { opacity: 1; }

/* Lime squiggles */
.squiggle { position: absolute; z-index: 5; overflow: visible; pointer-events: none; fill: none; stroke: var(--lime); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.squiggle--loop { width: clamp(110px, 13vw, 210px); top: 14%; right: 41%; transform: rotate(8deg); }
.squiggle--zig { width: clamp(80px, 8vw, 140px); bottom: 7%; left: 34%; transform: rotate(-4deg); }
.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 5.5s cubic-bezier(.65,0,.35,1) infinite; }
.draw--head { animation-name: draw-head; }
.squiggle--zig .draw { animation-delay: 1.1s; }
@keyframes draw {
  0% { stroke-dashoffset: 1; }
  30%, 72% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -1; }
}
@keyframes draw-head {
  0%, 26% { stroke-dashoffset: 1; }
  38%, 72% { stroke-dashoffset: 0; }
  84%, 100% { stroke-dashoffset: -1; }
}
.squiggle { animation: squiggle-float 4s ease-in-out infinite alternate; }
@keyframes squiggle-float { to { translate: 0 -10px; } }

.sparkle { position: absolute; z-index: 5; fill: var(--lime); pointer-events: none; animation: sparkle 2.6s cubic-bezier(.3,1.7,.5,1) infinite; }
.sparkle--a { width: 34px; top: 22%; left: 47%; }
.sparkle--b { width: 22px; bottom: 34%; left: 8%; animation-delay: -1.3s; }
@keyframes sparkle {
  0%, 15% { transform: scale(0) rotate(0); }
  35%, 70% { transform: scale(1) rotate(90deg); }
  90%, 100% { transform: scale(0) rotate(180deg); }
}

/* Frosted stickers */
.sticker {
  position: absolute; z-index: 6;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 12px 18px 12px 12px; min-width: 200px;
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 22px; color: #fff;
  box-shadow: 0 20px 40px -20px rgba(80, 10, 0, .5);
  transition: background-color .3s ease, transform .3s ease;
}
.sticker:hover { color: #fff; background: rgba(255,255,255,.28); }
.sticker-thumb { grid-row: span 2; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; border: 3px solid var(--lime); background: #fff; }
.sticker-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sticker-title { font-family: var(--display); font-weight: 800; font-stretch: 110%; font-size: 16px; line-height: 1.1; }
.sticker-sub { font-size: 13px; opacity: .85; }
.sticker--a { left: 45%; bottom: 13%; rotate: -7deg; animation: float-a 6s ease-in-out infinite alternate; }
.sticker--b { right: 3%; top: 20%; rotate: 6deg; animation: float-b 7s ease-in-out infinite alternate; }
@keyframes float-a { to { translate: 6px -14px; } }
@keyframes float-b { to { translate: -8px 12px; } }

/* Bottom row */
.hero-foot { position: relative; z-index: 5; display: flex; flex-direction: column; gap: 18px; max-width: 420px; }
.hero-foot p { margin: 0; font-size: 17px; line-height: 1.45; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px; font-weight: 600; font-size: 16px; transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .25s ease; }
.pill:hover { transform: translateY(-2px); }
.pill--white { background: #fff; color: var(--red); }
.pill--white:hover { background: var(--lime); color: var(--ink); }
.pill--outline { border: 2px solid #fff; color: #fff; }
.pill--outline:hover { background: #fff; color: var(--red); }

/* Spinning badge */
.badge { position: absolute; z-index: 6; right: clamp(16px, 3vw, 44px); bottom: clamp(18px, 3vw, 40px); width: clamp(110px, 10vw, 156px); aspect-ratio: 1; }
.badge svg { width: 100%; height: 100%; overflow: visible; }
.badge-bg { fill: var(--lime); }
.badge-ring { transform-origin: 100px 100px; animation: spin 14s linear infinite; }
.badge-ring text { font-family: var(--display); font-weight: 800; font-stretch: 112%; font-size: 17px; fill: var(--ink); letter-spacing: .02em; }
.badge-arrow { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; transform-origin: 100px 100px; animation: nudge 1.8s ease-in-out infinite; }
.badge:hover .badge-ring { animation-duration: 4s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes nudge { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(4px,-4px); } }

.hero-hint { position: absolute; z-index: 5; left: 50%; bottom: 22px; translate: -50% 0; margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; display: flex; gap: 8px; align-items: center; }
.hero-hint::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* Menu buttons */
.menu-btn { display: none; width: 46px; height: 46px; border-radius: 50%; border: 2px solid #fff; background: transparent; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 6px; padding: 0; }
.menu-btn span { width: 18px; height: 2px; background: #fff; border-radius: 2px; }
.menu-btn--dark { border-color: var(--ink); }
.menu-btn--dark span { background: var(--ink); }

/* ---------------- Floating compact nav ---------------- */
.float-nav {
  position: fixed; z-index: 200; top: 14px; left: 50%;
  display: flex; align-items: center; gap: 28px;
  padding: 8px 8px 8px 20px;
  background: rgba(253, 253, 255, .86);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 10px 30px -14px rgba(0,0,0,.25);
  transform: translate(-50%, -140%); opacity: 0; pointer-events: none;
  transition: transform .5s var(--ease), opacity .3s ease;
}
.float-nav.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.float-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.float-name .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--lime); }
.float-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; font-size: 14px; }
.float-nav li a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; }
.float-nav li a:hover { background: var(--tile); color: var(--ink); }
.float-nav .pill-dark { background: var(--ink); color: #fff; }
.float-nav .pill-dark:hover { background: var(--red); color: #fff; }

/* Mobile menu */
.mobile-menu { position: fixed; inset: 0; z-index: 300; background: var(--red); color: #fff; padding: 24px; display: flex; flex-direction: column; clip-path: circle(0 at calc(100% - 46px) 46px); transition: clip-path .6s var(--ease); }
.mobile-menu.open { clip-path: circle(150% at calc(100% - 46px) 46px); }
.mobile-menu ul { list-style: none; margin: auto 0; padding: 0; }
.mobile-menu li a { display: block; padding: 6px 0; font-family: var(--display); font-weight: 900; font-stretch: 115%; font-size: clamp(40px, 12vw, 64px); line-height: 1; text-transform: uppercase; letter-spacing: -0.02em; }
.mobile-menu li a:hover { color: var(--lime); }
.menu-close { align-self: flex-end; background: #fff; color: var(--red); border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer; }

/* ---------------- Marquee ---------------- */
.marquee { margin: 0 14px; overflow: hidden; background: var(--lime); color: var(--ink); border-radius: 999px; }
.marquee-track { display: flex; width: max-content; align-items: center; gap: 28px; padding: 14px 0; animation: marquee 32s linear infinite; font-family: var(--display); font-weight: 800; font-stretch: 112%; font-size: clamp(18px, 1.8vw, 26px); text-transform: uppercase; letter-spacing: -0.01em; white-space: nowrap; }
.marquee-track i { font-style: normal; color: var(--red); display: inline-block; animation: spin 6s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------- Below-fold sections ---------------- */
.home .facts { border-top: 0; padding: 56px 0 96px; gap: 12px; }
.home .fact { padding: 20px 22px; border: 1px solid var(--line); border-radius: 22px; }
.home .fact span:last-child { font-family: var(--display); font-weight: 800; font-stretch: 110%; font-size: 22px; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 10px; }
.live { width: 10px; height: 10px; border-radius: 50%; background: #2BB24C; box-shadow: 0 0 0 0 rgba(43,178,76,.5); animation: live 2s ease-out infinite; }
@keyframes live { to { box-shadow: 0 0 0 10px rgba(43,178,76,0); } }

.home .section-bar { border-bottom: 2px solid var(--ink); padding-bottom: 18px; align-items: flex-end; }
.home .section-bar h2 { font-family: var(--display); font-weight: 900; font-stretch: 116%; text-transform: uppercase; font-size: clamp(34px, 4.6vw, 68px); line-height: .9; letter-spacing: -0.03em; }
.hash-sm { color: var(--red); display: inline-block; margin-right: .04em; }

/* Work index */
.home .work-row { position: relative; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); transition: padding .45s var(--ease), opacity .3s ease; }
.home .work-row .ttl { font-family: var(--display); font-weight: 900; font-stretch: 114%; text-transform: uppercase; font-size: clamp(30px, 3.8vw, 60px); letter-spacing: -0.03em; line-height: .95; transition: color .3s ease; }
.home .work-row .go { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--lime); color: var(--ink); font-size: 22px; transform: scale(0) rotate(-45deg); transition: transform .45s cubic-bezier(.3,1.6,.5,1); }
.home .work-row.is-active { padding-left: 20px; }
.home .work-row.is-active .ttl { color: var(--red); }
.home .work-row.is-active .go { transform: scale(1) rotate(0); }
.home .work-row.is-active .idx { color: var(--red); }
.home .work-row .tag { flex-basis: 140px; }
.home .preview-frame { border-radius: 26px; }

/* AI */
.home .ai-home-intro p .em { color: var(--red); }
.home .btn { border-radius: 999px; }
.home .build-card img { border-radius: 20px; }
.home .build-title { font-family: var(--display); font-weight: 800; font-stretch: 108%; }
.home .build-meta .n { color: var(--red); }

/* About */
.home .about { background: var(--tile); border-top: 0; margin: 0 14px; border-radius: clamp(20px, 2.4vw, 32px); }
.home .about-side h2 { font-family: var(--display); font-weight: 900; font-stretch: 116%; text-transform: uppercase; font-size: clamp(34px, 4.6vw, 68px); line-height: .9; letter-spacing: -0.03em; }
.home .skills { border-top: 2px solid var(--ink); }
.home .skill span:first-child { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center; background: var(--lime); color: var(--ink); font-weight: 600; }

/* Contact */
.home .contact { padding: 140px 0 60px; }
.contact-title { font-family: var(--display); font-weight: 900; font-stretch: 118%; text-transform: uppercase; font-size: clamp(48px, 9vw, 160px); line-height: .86; letter-spacing: -0.04em; }
.underlined { position: relative; display: inline-block; color: var(--red); }
.underlined svg { position: absolute; left: 0; right: 0; bottom: -.12em; width: 100%; height: .22em; overflow: visible; fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: round; }
.underlined .draw { animation-duration: 4.5s; }
.home .contact-email { display: inline-flex; align-items: center; gap: 12px; padding: 18px 30px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; transition: background-color .25s ease, color .25s ease; }
.home .contact-email:hover { background: var(--lime); color: var(--ink); }

.home .site-footer { border-top: 1px solid var(--line); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px) {
  .hero-pills { display: none; }
  .menu-btn { display: inline-flex; }
  .hero-cta { margin-left: auto; }
  .sticker--a { left: 40%; }
}
@media (max-width: 900px) {
  .float-nav ul { display: none; }
  .float-nav .menu-btn { display: inline-flex; width: 40px; height: 40px; }
  .float-nav { gap: 16px; padding-left: 18px; }
}
@media (max-width: 760px) {
  .hero-wrap { padding: 10px; }
  .hero { min-height: auto; display: flex; flex-direction: column; padding-bottom: 20px; background-size: 48px 48px; }
  .hero-cta { display: none; }
  .hero-type { font-size: clamp(48px, 15.5vw, 96px); padding-top: 40px; }
  .hero-type .line:nth-child(2) { padding-left: 0; }
  .portrait3d { position: relative; right: auto; bottom: auto; height: auto; width: 100%; max-width: none; margin: -12vw auto 0; aspect-ratio: .92; z-index: 2; }
  .squiggle--loop { top: 30%; right: 6%; width: 90px; }
  .squiggle--zig { display: none; }
  .sticker { min-width: 0; padding: 8px 12px 8px 8px; }
  .sticker-thumb { width: 38px; height: 38px; }
  .sticker-title { font-size: 13px; }
  .sticker-sub { font-size: 11px; }
  .sticker--a { left: 4%; top: auto; bottom: 34%; }
  .sticker--b { right: 4%; top: 46%; }
  .sticker--b .sticker-sub { display: none; }
  .hero-foot { max-width: none; margin-top: 4px; }
  .badge { width: 96px; top: auto; bottom: calc(100% - 300px); right: 12px; display: none; }
  .hero-hint { display: none; }
  .sparkle--a { top: 12%; left: 82%; }
  .marquee { margin: 0 10px; }
  .home .about { margin: 0 10px; }
  .home .work-row .go { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hash, .squiggle, .sparkle, .sticker, .badge-ring, .badge-arrow, .marquee-track, .marquee-track i, .live, .hero-hint::before { animation: none !important; }
  .draw { animation: none !important; stroke-dashoffset: 0; }
}

/* fixes */
.home .section-bar h2 .hash-sm, .home .about-side h2 .hash-sm { font-size: inherit; color: var(--red); }
.home .about-side h2 { white-space: nowrap; font-size: clamp(34px, 4vw, 60px); }
.home .work-row .ttl { font-size: clamp(28px, 3.3vw, 54px); }
@media (max-width: 760px) {
  .hero-type { align-self: stretch; font-size: clamp(40px, 13vw, 96px); }
  .sticker--b { display: none; }
  .sticker--a { left: 0; bottom: 6%; }
  .squiggle--loop { top: auto; bottom: 30%; right: 4%; width: 80px; }
  .mobile-menu li a { font-size: clamp(32px, 10vw, 60px); }
  .home .work-row { gap: 4px 16px; }
  .home .work-row .idx { flex-basis: 100%; }
  .home .work-row .tag { flex: 1 1 100%; text-align: left; }
  .home .section-bar { flex-wrap: wrap; }
  .home .section-bar h2 { font-size: clamp(30px, 10vw, 48px); }
  .home .section-bar > span { display: none; }
}
@media (max-width: 760px) {
  .sticker { display: none; }
  .squiggle--loop { bottom: auto; top: 36%; right: 6%; }
  .mobile-menu li a { font-size: clamp(30px, 9vw, 56px); }
}
