/* Custom styles that sit alongside Tailwind utilities. */

:root {
  /* Aynu Labs: deep teal ink + the teal of the logo mark. */
  --navy-900: #0a242c;
  --navy-800: #0e2f38;
  --brand: #2f9aaa;
  --brand-soft: #cff0ee;
  --mist: #eef4f5;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

html { scroll-padding-top: 84px; }
body { background: var(--mist); }
::selection { background: var(--brand); color: #fff; }

/* ---------- Scroll progress ---------- */
#progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 70;
  background: linear-gradient(90deg, #3ebfb8, #2f9aaa 60%, #a3e1dd);
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- Navigation ---------- */
#nav { transition: background-color .35s ease, box-shadow .35s ease, color .35s ease, backdrop-filter .35s ease; }
#nav.is-scrolled { background: rgba(255, 255, 255, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 6px 30px -12px rgba(14, 47, 56, .25); }
#nav .nav-link { position: relative; }
#nav .nav-link::after {
  content: ''; position: absolute; left: 50%; right: 50%; bottom: -6px; height: 2px; border-radius: 2px;
  background: currentColor; transition: left .3s var(--ease-out), right .3s var(--ease-out);
}
#nav .nav-link.is-active::after, #nav .nav-link:hover::after { left: 14%; right: 14%; }
#nav:not(.is-scrolled) { color: #fff; }
#nav.is-scrolled { color: var(--navy-800); }
#nav.is-scrolled .nav-link.is-active { color: var(--brand); }

#mobile-menu { transition: opacity .3s ease, visibility .3s ease; }
#mobile-menu.is-open { opacity: 1; visibility: visible; }
#mobile-menu .m-link { transform: translateY(14px); opacity: 0; transition: transform .45s var(--ease-out), opacity .45s ease; }
#mobile-menu.is-open .m-link { transform: none; opacity: 1; }

/* ---------- Reveal on scroll ---------- */
/* Uses the individual `translate`/`scale` properties so it composes with Tailwind's `transform` utilities. */
html .reveal { opacity: 0; translate: 0 28px; transition: opacity .8s var(--ease-out), translate .8s var(--ease-out), scale .8s var(--ease-out), transform .4s var(--ease-out), box-shadow .4s ease, background-color .3s ease, border-color .3s ease; transition-delay: var(--d, 0ms); }
html .reveal.zoom { translate: none; scale: .94; }
html .reveal.is-in { opacity: 1; translate: none; scale: none; }
.nav-btn { border: 1px solid color-mix(in srgb, currentColor 28%, transparent); }

/* ---------- Hero collage ---------- */
.collage {
  position: absolute; inset: -30% -18%; display: flex; gap: 26px;
  transform: perspective(1600px) rotateX(16deg) rotateZ(-13deg) translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform .9s var(--ease-out);
}
.collage-col { flex: 1 0 0; min-width: 0; will-change: transform; animation: collage-up var(--dur, 80s) linear infinite; }
.collage-col.is-down { animation-direction: reverse; }
.collage-col img { display: block; width: 100%; height: auto; margin-bottom: 26px; border-radius: 10px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .7); }
@keyframes collage-up { from { transform: translateY(0); } to { transform: translateY(-50%); } }

.hero-veil {
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(14, 47, 56, .55) 0%, rgba(14, 47, 56, .86) 70%),
    linear-gradient(180deg, rgba(10, 36, 44, .55) 0%, rgba(14, 47, 56, .7) 60%, rgba(10, 36, 44, .97) 100%);
}

/* The script wordmark "writes" itself in. */
.write-in { clip-path: inset(-10% 100% -10% 0); animation: write-in 2.4s cubic-bezier(.65, 0, .35, 1) .35s forwards; }
.write-in.delay { animation-delay: 1.9s; animation-duration: 1.4s; }
@keyframes write-in { to { clip-path: inset(-10% -2% -10% 0); } }

.fade-up { opacity: 0; transform: translateY(18px); animation: fade-up .9s var(--ease-out) forwards; animation-delay: var(--d, 0s); }
@keyframes fade-up { to { opacity: 1; transform: none; } }

.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; background: currentColor; vertical-align: -0.15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.scroll-cue span { animation: scroll-cue 1.8s ease-in-out infinite; }
@keyframes scroll-cue { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

/* ---------- PDF-style panels ---------- */
.panel { background: #fff; border-radius: 18px; box-shadow: 0 1px 0 rgba(14, 47, 56, .04), 0 18px 40px -28px rgba(14, 47, 56, .35); }
.panel-title {
  display: inline-flex; align-items: center; gap: .5rem; padding: .45rem 1rem; border-radius: 8px;
  background: var(--brand-soft); color: #236676; font-weight: 600; font-size: .95rem;
}

/* Cursor spotlight on cards */
.spotlight { position: relative; isolation: isolate; }
.spotlight::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(47, 154, 170, .13), transparent 45%);
  transition: opacity .35s ease;
}
.spotlight:hover::before { opacity: 1; }

/* ---------- Experience timeline ---------- */
.timeline-rail { background: linear-gradient(180deg, transparent, #a3e1dd 8%, #a3e1dd 92%, transparent); }
.timeline-dot { box-shadow: 0 0 0 6px var(--mist), 0 0 0 7px #a3e1dd; }
.tab-btn[aria-selected="true"] { background: var(--accent, var(--brand)); color: #fff; box-shadow: 0 8px 18px -10px var(--accent, var(--brand)); }
.tab-panel { animation: tab-in .45s var(--ease-out); }
@keyframes tab-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Browser + phone frames ---------- */
.browser { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(10, 36, 44, .55), 0 0 0 1px rgba(10, 36, 44, .06); }
.browser-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: #f1f4f8; border-bottom: 1px solid #e4e9f0; }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: #d4dbe4; }
.browser-bar i:nth-child(1) { background: #ff6159; }
.browser-bar i:nth-child(2) { background: #ffbd2e; }
.browser-bar i:nth-child(3) { background: #28c941; }
.browser-url { margin-left: 10px; flex: 1; height: 17px; border-radius: 6px; background: #fff; font-size: 10px; line-height: 17px; padding: 0 8px; color: #7a8699; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Screenshot that pans top-to-bottom on hover — shows the whole page. */
.pan { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: object-position 1.1s var(--ease-out); }
.group:hover .pan, .group:focus-visible .pan { object-position: 50% 100%; transition: object-position var(--pan, 7s) cubic-bezier(.45, 0, .55, 1); }

.phone {
  position: relative; border-radius: 30px; padding: 7px; background: #12151c;
  box-shadow: 0 30px 50px -25px rgba(0, 0, 0, .7), inset 0 0 0 1.5px #3a404d;
}
.phone::before { content: ''; position: absolute; top: 12px; left: 50%; width: 30%; height: 12px; transform: translateX(-50%); background: #12151c; border-radius: 0 0 10px 10px; z-index: 2; }
.phone img { display: block; width: 100%; border-radius: 24px; }

/* ---------- Project cards ---------- */
.project-card { transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), opacity .4s ease; transform-style: preserve-3d; }
.project-card:hover { box-shadow: 0 40px 70px -35px rgba(10, 36, 44, .5); }
.project-card.is-hidden { display: none; }
.project-card .cover { background: var(--grad); }
.project-card .cover::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 15% 0%, rgba(255, 255, 255, .28), transparent 50%);
}
.chip[aria-pressed="true"] { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---------- Project detail page (project.html) ---------- */
.viewer { height: min(68vh, 640px); overflow-y: auto; scroll-behavior: auto; overscroll-behavior: contain; }
.viewer.viewer-tall { height: min(78vh, 760px); }
.jump.is-active { color: var(--accent, var(--brand)); border-left-color: var(--accent, var(--brand)); font-weight: 600; }
.project-page #nav:not(.is-scrolled) .nav-link.is-active::after { left: 14%; right: 14%; }
.viewer::-webkit-scrollbar { width: 8px; }
.viewer::-webkit-scrollbar-thumb { background: #c9d3df; border-radius: 8px; }
.thumb[aria-current="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }

#lightbox { transition: opacity .3s ease, visibility .3s ease; }
#lightbox.is-open { opacity: 1; visibility: visible; }

/* ---------- Toast ---------- */
#toast { transition: opacity .3s ease, transform .3s var(--ease-out); }
#toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.bar-fill { transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.4s var(--ease-out); transition-delay: var(--d, 0ms); }
.is-in .bar-fill { transform: scaleX(var(--v)); }

body.no-scroll { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .collage-col { animation: none !important; }
  html .reveal, .fade-up { opacity: 1; transform: none; translate: none; scale: none; }
  .write-in { clip-path: none; }
}

.phone.mini::before { display: none; }

/* Landscape app screens (tablets / phones held sideways). */
.tablet {
  position: relative; border-radius: 18px; padding: 8px; background: #12151c; overflow: hidden;
  box-shadow: 0 30px 50px -25px rgba(0, 0, 0, .7), inset 0 0 0 1.5px #3a404d;
}
.tablet img { border-radius: 11px; }

/* Script line under the hero wordmark. */
.font-script { line-height: 1.1; padding: 0 .15em; }

/* =====================================================================
   Device mockups for mobile screenshots.
   Markup: <div class="mk mk-STYLE"><div class="mk-body"><img></div></div>
   .mk is a size container, so bezels/radii (cqw) scale from card thumbnails
   up to the large showcase. --accent tints Pixel / Clay / Flat / Stack.
   ===================================================================== */
.mk { container-type: inline-size; position: relative; }
.mk-body { position: relative; }
.mk-screen { position: relative; overflow: hidden; }
.mk-screen img { display: block; width: 100%; height: auto; }

/* Raw screens sit in a phone-shaped display, cropped from the top, so every device is the same height. */
:is(.mk-iphone, .mk-pixel, .mk-clay, .mk-glass, .mk-flat) .mk-screen { aspect-ratio: 9 / 19.5; display: flex; flex-direction: column; background: #fff; }
:is(.mk-iphone, .mk-pixel, .mk-clay, .mk-glass, .mk-flat) .mk-screen img { flex: 1 1 0; min-height: 0; height: 100%; object-fit: cover; object-position: top; }

/* Fake status bar for screens captured from a mobile browser (they have none). */
.mk-status {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  height: 11.5cqw; padding: 1.6cqw 8cqw 0 9cqw; font: 600 4.3cqw/1 -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif; letter-spacing: -.01em;
}
.mk-status svg { height: 3.6cqw; width: auto; }
.mk-status-light { background: #fff; color: #111; }
.mk-status-dark { background: #0c0c0c; color: #fff; }
.mk-pixel .mk-status, .mk-glass .mk-status { justify-content: space-between; padding-left: 6cqw; padding-right: 6cqw; font-family: Roboto, "Segoe UI", sans-serif; }

/* iPhone: titanium frame, Dynamic Island, side buttons */
.mk-iphone .mk-body {
  padding: 3.6cqw; border-radius: 15cqw;
  background: linear-gradient(145deg, #4a4f57, #15171b 40%, #2d3138);
  box-shadow: inset 0 0 0 .55cqw #a3a8b0, inset 0 0 0 1.1cqw #191b1f, 0 7cqw 14cqw -7cqw rgba(0, 0, 0, .6);
}
.mk-iphone .mk-screen { border-radius: 11.6cqw; }
.mk-iphone .mk-body::before {
  content: ''; position: absolute; z-index: 2; top: 6.2cqw; left: 50%; transform: translateX(-50%);
  width: 27cqw; height: 7.4cqw; border-radius: 99px; background: #050505;
}
.mk-iphone .mk-body::after {
  content: ''; position: absolute; right: -2px; top: 27%; width: 3px; height: 13%; border-radius: 0 3px 3px 0; background: #6d727a;
}
.mk-iphone::before {
  content: ''; position: absolute; left: -2px; top: 21%; width: 3px; height: 7%; border-radius: 3px 0 0 3px; background: #6d727a;
}

/* Pixel: slim black bezel, coloured rail, punch-hole camera */
.mk-pixel .mk-body {
  padding: 2.6cqw; border-radius: 11cqw; background: #16191c;
  box-shadow: inset 0 0 0 .8cqw color-mix(in srgb, var(--accent, #2f9aaa) 60%, #dfe3e6), 0 7cqw 15cqw -8cqw rgba(0, 0, 0, .55);
}
.mk-pixel .mk-screen { border-radius: 8.4cqw; }
.mk-pixel .mk-body::before {
  content: ''; position: absolute; z-index: 2; top: 5.6cqw; left: 50%; transform: translateX(-50%);
  width: 4.4cqw; height: 4.4cqw; border-radius: 50%; background: #050505; box-shadow: 0 0 0 .6cqw rgba(255, 255, 255, .08);
}
.mk-pixel .mk-body::after {
  content: ''; position: absolute; right: -2px; top: 24%; width: 3px; height: 9%; border-radius: 0 3px 3px 0;
  background: color-mix(in srgb, var(--accent, #2f9aaa) 70%, #000);
}

/* Clay: soft, matte 3D body tinted with the project colour */
.mk-clay .mk-body {
  padding: 4.6cqw; border-radius: 16cqw;
  background: color-mix(in srgb, var(--accent, #2f9aaa) 24%, #f6f3ee);
  box-shadow:
    inset 0 1.2cqw 1.6cqw rgba(255, 255, 255, .85), inset 0 -2.4cqw 3.6cqw rgba(0, 0, 0, .12),
    0 9cqw 18cqw -9cqw color-mix(in srgb, var(--accent, #2f9aaa) 75%, #000);
}
.mk-clay .mk-screen { border-radius: 11.5cqw; }
.mk-clay .mk-body::before {
  content: ''; position: absolute; z-index: 2; top: 1.9cqw; left: 50%; transform: translateX(-50%);
  width: 15cqw; height: 1.2cqw; border-radius: 99px; background: rgba(0, 0, 0, .16);
}

/* Glass: frosted bezel, gloss streak, 3D tilt that straightens on hover */
.mk-glass { perspective: 900px; }
.mk-glass .mk-body {
  padding: 2.4cqw; border-radius: 12cqw;
  background: color-mix(in srgb, var(--accent, #2f9aaa) 22%, rgba(255, 255, 255, .45));
  border: 1px solid rgba(255, 255, 255, .7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10cqw 20cqw -10cqw rgba(0, 0, 0, .5), inset 0 0 0 .5cqw rgba(255, 255, 255, .35);
  transform: rotateY(-14deg) rotateX(6deg); transition: transform .7s var(--ease-out);
}
.mk-glass:hover .mk-body, .mk-glass:focus-within .mk-body { transform: none; }
.mk-glass .mk-screen { border-radius: 9.6cqw; }
.mk-glass .mk-body::after {
  content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .08) 30%, rgba(255, 255, 255, 0) 42%);
}

/* Flat: outline device with a solid offset shadow */
.mk-flat .mk-body {
  padding: 2.4cqw; border-radius: 12cqw; background: #fff;
  border: max(2px, .9cqw) solid var(--navy-800); box-shadow: 4.5cqw 4.5cqw 0 var(--accent, #2f9aaa);
  transition: box-shadow .35s var(--ease-out), translate .35s var(--ease-out);
}
.mk-flat:hover .mk-body { translate: -1cqw -1cqw; box-shadow: 6cqw 6cqw 0 var(--accent, #2f9aaa); }
.mk-flat .mk-screen { border-radius: 9cqw; outline: max(1px, .4cqw) solid var(--navy-800); }

/* Poster: for store graphics that already include a device */
.mk-poster .mk-body { border-radius: 7cqw; overflow: hidden; box-shadow: 0 9cqw 18cqw -9cqw rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .06); }

/* Stack: white card with a tinted card fanned out behind it */
.mk-stack .mk-body { padding: 2.6cqw; border-radius: 7cqw; background: #fff; box-shadow: 0 9cqw 18cqw -9cqw rgba(0, 0, 0, .5); }
.mk-stack .mk-body::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: color-mix(in srgb, var(--accent, #2f9aaa) 55%, #fff); transform: rotate(-6deg) translate(-3cqw, 2cqw);
}
.mk-stack .mk-screen { border-radius: 4.6cqw; }

/* Showcase stage on project pages — three layouts */
.mk-stage {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 28px;
  display: flex; align-items: flex-end; justify-content: center; gap: 4%; padding: 56px 6% 64px; perspective: 1400px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, color-mix(in srgb, var(--accent, #2f9aaa) 30%, #fff), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent, #2f9aaa) 9%, #fff), #fff);
  box-shadow: inset 0 0 0 1px rgba(14, 47, 56, .06);
}
.mk-stage::after {
  content: ''; position: absolute; left: 12%; right: 12%; bottom: 26px; height: 40px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(14, 47, 56, .22), transparent);
}
.mk-stage > * { flex: 0 1 30%; max-width: 250px; transition: transform .7s var(--ease-out); }
.mk-stage > :nth-child(2) { z-index: 2; flex-basis: 34%; max-width: 280px; }
.mk-stage[data-layout="tilt"] > :nth-child(1) { transform: rotateY(24deg) translateX(10%) scale(.9); }
.mk-stage[data-layout="tilt"] > :nth-child(3) { transform: rotateY(-24deg) translateX(-10%) scale(.9); }
.mk-stage[data-layout="fan"] { align-items: center; }
.mk-stage[data-layout="fan"] > :nth-child(1) { transform: rotate(-9deg) translate(18%, 6%); }
.mk-stage[data-layout="fan"] > :nth-child(3) { transform: rotate(9deg) translate(-18%, 6%); }
.mk-stage[data-layout="stagger"] > :nth-child(1) { transform: translateY(-14%); }
.mk-stage[data-layout="stagger"] > :nth-child(3) { transform: translateY(10%); }
.mk-stage[data-count="2"] > * { flex-basis: 34%; max-width: 270px; }
.mk-stage[data-count="2"] > :nth-child(1) { transform: rotate(-5deg) translateX(6%); }
.mk-stage[data-count="2"] > :nth-child(2) { transform: rotate(5deg) translate(-6%, -6%); }
.mk-stage:hover > * { transform: none; }

.mk-switch [aria-pressed="true"] { background: var(--navy-800); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .mk-glass .mk-body { transform: none; }
}

/* Landscape phones (.mk-land): same devices turned sideways. cqw is now the long side, so sizes shrink ~9/19.5. */
.mk-land .mk-body { padding: 1.7cqw; border-radius: 7cqw; }
.mk-land .mk-screen { aspect-ratio: 19.5 / 9; border-radius: 5.4cqw; }
.mk-iphone.mk-land .mk-body::before { top: 50%; left: 2.9cqw; transform: translateY(-50%); width: 3.4cqw; height: 12.6cqw; }
.mk-iphone.mk-land .mk-body::after { right: auto; top: -2px; left: 26%; width: 13%; height: 3px; border-radius: 3px 3px 0 0; }
.mk-iphone.mk-land::before { top: auto; bottom: -2px; left: 20%; width: 7%; height: 3px; border-radius: 0 0 3px 3px; }
.mk-pixel.mk-land .mk-body { padding: 1.3cqw; border-radius: 5.2cqw; }
.mk-pixel.mk-land .mk-screen { border-radius: 4cqw; }
.mk-pixel.mk-land .mk-body::before { top: 50%; left: 2.4cqw; transform: translateY(-50%); width: 2cqw; height: 2cqw; }
.mk-pixel.mk-land .mk-body::after { right: auto; top: -2px; left: 24%; width: 9%; height: 3px; border-radius: 3px 3px 0 0; }
.mk-clay.mk-land .mk-body { padding: 2.2cqw; border-radius: 8cqw; }
.mk-clay.mk-land .mk-body::before { top: 50%; left: .8cqw; transform: translateY(-50%); width: .6cqw; height: 7cqw; }
.mk-glass.mk-land .mk-body { padding: 1.2cqw; border-radius: 6cqw; transform: rotateY(-8deg) rotateX(5deg); }
.mk-flat.mk-land .mk-body { padding: 1.2cqw; border-radius: 6cqw; border-width: max(2px, .45cqw); box-shadow: 2.2cqw 2.2cqw 0 var(--accent, #2f9aaa); }

/* Home cards: website with the phone app overlapping it */
.combo-phone { position: absolute; z-index: 3; right: 6%; bottom: -14%; width: 23%; transition: transform .6s var(--ease-out); }
.combo-phone.is-land { width: 44%; bottom: 6%; }
.group:hover .combo-phone { transform: translateY(-10%) rotate(-3deg); }
.mk-stage.mk-stage-land { padding: 48px 10% 60px; align-items: center; }
.mk-stage.mk-stage-land > * { flex: 0 1 100%; max-width: 640px; }
