/* ============================================================
   Papaya Coco — dev1 · refined editorial portfolio
   A premium refinement of the existing site: same structure,
   elevated typography, spacing, motion and micro-interactions.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream: #FBF6F4;
  --white: #FDFCFB;
  --ink:   #17110F;
  --ink-2: #2A2320;
  --muted: #8C8A87;
  --line:  rgba(23,17,15,0.10);
  --line-2: rgba(23,17,15,0.06);
  --pink:  #F2295B;
  --coral: #FF7878;
  --magenta: #F878FF;
  --grad: linear-gradient(100deg, #FF7878 0%, #F878FF 100%);
  --grad-soft: linear-gradient(100deg, rgba(255,120,120,0.12), rgba(248,120,255,0.12));
  --shadow-sm: 0 2px 10px rgba(23,17,15,0.05);
  --shadow-md: 0 18px 50px rgba(23,17,15,0.10);
  --shadow-lg: 0 40px 90px rgba(23,17,15,0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.5rem, 5vw, 5rem);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--white);
  color: var(--ink);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(242,41,91,0.16); }
img, video { display: block; max-width: 100%; }
em { font-style: italic; }
.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; font-style: italic;
}

/* subtle film grain for a premium, less "flat" surface */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- scroll progress ---------- */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--grad); z-index: 200; transition: width 0.1s linear;
}

/* ---------- NAV ---------- */
nav {
  position: sticky; top: 0; z-index: 100;
  padding: 1.25rem var(--pad);
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(253,252,250,0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: padding 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
nav.scrolled { padding-top: 0.85rem; padding-bottom: 0.85rem; border-bottom-color: var(--line); }
.logo img { height: 26px; width: auto; display: block; transition: transform 0.4s var(--ease); }
nav.scrolled .logo img { height: 22px; }
.nav-links { display: flex; gap: 2.4rem; }
.nav-links a {
  position: relative; text-decoration: none; color: var(--muted);
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  transition: color 0.25s; padding: 0.2rem 0;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: var(--ink); transition: width 0.35s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after, .nav-links a:hover::after { width: 100%; }

/* ---------- HERO ---------- */
.hero {
  padding: clamp(6rem, 13vw, 11rem) var(--pad) clamp(5rem, 10vw, 9rem);
  background: #141414 url('images/hero.webp') center/cover no-repeat;
  position: relative; overflow: hidden;
}
.hero-glow    { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hero-overlay { position: absolute; inset: 0; z-index: 3; background: rgba(8,6,6,0.93); pointer-events: none; }
.hero-grad-orb { position: absolute; top: -10%; left: -10%; width: 55%; height: 120%; background: var(--grad); filter: blur(120px); opacity: 0.20; border-radius: 50%; pointer-events: none; z-index: 1; }
.hero-left { position: relative; z-index: 4; max-width: 760px; mix-blend-mode: difference; }
.hero-eyebrow { font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: rgba(255,255,255,0.55); display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.hero-eyebrow::before { content: ''; width: 2.5rem; height: 1px; background: rgba(255,255,255,0.4); }
.hero-title { font-family: 'Playfair Display', serif; font-size: clamp(48px, 6.5vw, 92px); font-weight: 900; line-height: 0.96; letter-spacing: -0.03em; margin-bottom: 2rem; color: #fff; }
.hero-sub { font-size: clamp(1rem, 1.3vw, 1.1rem); font-weight: 300; color: rgba(255,255,255,0.7); max-width: 440px; line-height: 1.8; }
.hero-disciplines { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 2.5rem; }
.disc { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 0.45rem 0.95rem; border: 1px solid rgba(255,255,255,0.24); color: rgba(255,255,255,0.88); border-radius: 100px; transition: background 0.3s, border-color 0.3s; }
.disc:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }

/* ---------- SECTION HEAD / labels ---------- */
.sec-head { padding: clamp(2.5rem,5vw,4rem) var(--pad) 0; display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); }
.sec-label { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--pink); font-weight: 500; }
.sec-count { font-family: 'Playfair Display', serif; font-size: 0.95rem; color: var(--muted); }

/* ---------- ABOUT ---------- */
.about { padding: clamp(4rem,8vw,7rem) var(--pad); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem,5vw,5rem); align-items: start; border-bottom: 1px solid var(--line); }
.about h2 { font-family: 'Playfair Display', serif; font-size: clamp(40px, 5.5vw, 84px); font-weight: 900; line-height: 0.98; letter-spacing: -0.03em; margin-bottom: 1.4rem; }
.about-by { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.02em; }
.about p { color: var(--ink-2); font-size: 0.98rem; line-height: 1.85; font-weight: 300; margin-bottom: 1.15rem; }
.about p:last-child { margin-bottom: 0; }
.about p strong { color: var(--ink); font-weight: 600; }

/* ---------- CASES (shared) ---------- */
.case-num { font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.3rem; }
.case-title { font-family: 'Playfair Display', serif; font-size: clamp(34px, 4.2vw, 64px); font-weight: 900; line-height: 0.98; letter-spacing: -0.025em; margin-bottom: 1.4rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.8rem; }
.tag { font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.36rem 0.85rem; border: 1px solid var(--line); border-radius: 100px; color: var(--muted); transition: border-color 0.3s, color 0.3s; }
.tag:hover { border-color: var(--pink); color: var(--ink); }
.case-desc { font-size: 0.96rem; line-height: 1.8; color: var(--ink-2); font-weight: 300; max-width: 420px; margin-bottom: 2.4rem; }
.case-desc strong { color: var(--ink); font-weight: 600; }
.case-link { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); text-decoration: none; font-weight: 600; }
.case-link span { transition: transform 0.35s var(--ease); display: inline-block; }
.case-link:hover span { transform: translateX(7px); }
.case-logo-chip { display: inline-flex; align-items: center; background: var(--ink); padding: 0.7rem 1.1rem; border-radius: 10px; margin-bottom: 1.4rem; width: fit-content; }
.case-logo-chip img { height: 26px; width: auto; max-width: 180px; object-fit: contain; display: block; }

.case-body { padding: clamp(2.2rem,4.5vw,4.5rem); display: flex; flex-direction: column; justify-content: center; background: var(--white); }

/* split */
.case-split { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.case-split.flip .case-img { order: 2; }
.case-split.flip .case-body { order: 1; }
.case-img { overflow: hidden; position: relative; min-height: 60vh; background: var(--cream); touch-action: pan-y; }
.case-img img, .case-img video { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.case-split:hover .case-img > img { transform: scale(1.04); }

/* slider track */
.slide-track { position: absolute; inset: 0; display: flex; height: 100%; will-change: transform; }
.slide-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; }
.dots { position: absolute; bottom: 1.4rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.6rem; z-index: 10; }
.dot { width: 8px; height: 8px; border-radius: 50%; padding: 0; cursor: pointer; background: rgba(255,255,255,0.4); border: 1.5px solid rgba(255,255,255,0.7); transition: transform 0.35s, background 0.35s; }
.dot.active { background: #fff; transform: scale(1.4); }
.dots.dark .dot { background: rgba(20,20,20,0.25); border-color: rgba(20,20,20,0.5); }
.dots.dark .dot.active { background: var(--ink); }

/* cinema */
.case-cinema { position: relative; overflow: hidden; min-height: 70vh; display: flex; align-items: flex-end; border-top: 1px solid var(--line); background: var(--cream); touch-action: pan-y; }
.cinema-bg { position: absolute; inset: 0; }
.cinema-bg video, .cinema-bg img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.case-cinema:hover .cinema-bg video, .case-cinema:hover .cinema-bg > img { transform: scale(1.05); }
.cinema-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(14,12,10,0.9) 0%, rgba(14,12,10,0.25) 55%, transparent 100%); }
.cinema-content { position: relative; z-index: 2; padding: clamp(2.5rem,5vw,4.5rem) var(--pad); width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: flex-end; gap: 3rem; color: #fff; }
.cinema-content .case-title { color: #fff; margin-bottom: 1rem; }
.cinema-content .case-num { color: rgba(255,255,255,0.6); }
.cinema-content .tag { border-color: rgba(255,255,255,0.25); color: rgba(255,255,255,0.75); }
.cinema-content .tag:hover { border-color: #fff; color: #fff; }
.cinema-content .case-desc { color: rgba(255,255,255,0.82); max-width: 540px; }
.cinema-content .case-desc strong { color: #fff; }
.cinema-content .case-link { color: #fff; }

/* macbook mockup */
.case-mockup { border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; }
.case-mockup.flip .mockup-stage { order: 2; }
.case-mockup.flip .case-body { order: 1; }
.mockup-stage { display: flex; align-items: center; justify-content: center; padding: clamp(2rem,5vw,4.5rem); position: relative; overflow: hidden; min-height: 60vh; }
.mockup-mondo { background: radial-gradient(circle at 50% 35%, #2c2c2c 0%, #141414 72%); }
.mockup-ch { background: radial-gradient(circle at 50% 35%, #3c2f29 0%, #1a1310 72%); }
.macbook { width: 100%; max-width: 560px; transition: transform 0.8s var(--ease); }
.case-mockup:hover .macbook { transform: translateY(-6px); }
.mb-screen { background: #0a0a0a; border-radius: 14px 14px 0 0; padding: 12px 12px 0; box-shadow: 0 30px 60px rgba(0,0,0,0.5); }
.mb-bezel { background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 16/10; position: relative; }
.mb-bar { height: 22px; background: #1a1a1a; display: flex; align-items: center; gap: 6px; padding: 0 10px; }
.mb-dot { width: 8px; height: 8px; border-radius: 50%; }
.mb-dot.r { background: #ff5f57; } .mb-dot.y { background: #febc2e; } .mb-dot.g { background: #28c840; }
.mb-url { flex: 1; text-align: center; font-size: 9px; color: #888; font-family: monospace; }
.mb-content { width: 100%; height: calc(100% - 22px); overflow: hidden; }
.mb-content img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.mb-hinge { height: 6px; background: linear-gradient(180deg,#8a8a8e,#b8b8bc); border-radius: 0 0 12px 12px; margin: 0 30px; }
.mb-base { height: 14px; background: linear-gradient(180deg,#c8c8cc,#9a9a9e); border-radius: 0 0 4px 4px; position: relative; }
.mb-notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 90px; height: 7px; background: #7a7a7e; border-radius: 0 0 8px 8px; }
.scope-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-top: 0.4rem; max-width: 420px; }
.scope-item { display: flex; align-items: center; gap: 0.55rem; font-size: 0.66rem; letter-spacing: 0.05em; padding: 0.42rem 0.65rem; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.scope-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--pink); flex-shrink: 0; }

/* Ideal of Sweden reel */
.ios-section { border-top: 1px solid var(--line); background: var(--ink); padding: clamp(3.5rem,6vw,5.5rem) var(--pad) clamp(3rem,5vw,4.5rem); color: #fff; }
.ios-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 3rem; flex-wrap: wrap; gap: 2rem; }
.ios-title { font-family: 'Playfair Display', serif; font-size: clamp(34px, 5vw, 72px); font-weight: 900; line-height: 0.96; letter-spacing: -0.02em; }
.ios-sub { font-size: 0.95rem; color: rgba(255,255,255,0.62); font-weight: 300; max-width: 380px; line-height: 1.75; }
.ios-sub .tag { border-color: rgba(255,255,255,0.25); color: rgba(255,255,255,0.7); margin-bottom: 0; }
.ios-reel { overflow: hidden; position: relative; margin: 0 calc(-1 * var(--pad)); cursor: grab; user-select: none; touch-action: pan-y; }
.ios-reel.is-dragging { cursor: grabbing; }
.ios-reel::before, .ios-reel::after { content: ''; position: absolute; top: 0; bottom: 0; width: 8vw; z-index: 3; pointer-events: none; }
.ios-reel::before { left: 0; background: linear-gradient(90deg, var(--ink), transparent); }
.ios-reel::after { right: 0; background: linear-gradient(270deg, var(--ink), transparent); }
.ios-reel-track { display: flex; gap: 1rem; padding: 2.5rem var(--pad) 3rem; will-change: transform; }
.ios-item { width: 220px; flex-shrink: 0; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 9/16; position: relative; z-index: 1; transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease); }
@media (hover: hover) { .ios-item:hover { transform: scale(1.45) translateY(-6%); z-index: 25; box-shadow: 0 40px 90px rgba(0,0,0,0.82); } }
.ios-item img, .ios-item video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ios-stats { display: flex; gap: clamp(1.5rem,4vw,3.5rem); margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid rgba(255,255,255,0.14); flex-wrap: wrap; }
.ios-sn { font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 900; }
.ios-sl { font-size: 0.68rem; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.3rem; }

/* ---------- CTA ---------- */
.cta { padding: clamp(5rem,9vw,8rem) var(--pad); text-align: center; background: var(--cream); border-top: 1px solid var(--line); }
.cta-logo { width: 220px; max-width: 55vw; height: auto; margin: 0 auto 2.4rem; }
.cta h2 { font-family: 'Playfair Display', serif; font-size: clamp(48px, 7vw, 98px); font-weight: 900; line-height: 0.96; letter-spacing: -0.03em; margin-bottom: 1.8rem; }
.cta p { color: var(--ink-2); font-size: 1.02rem; font-weight: 300; max-width: 420px; margin: 0 auto 2.6rem; line-height: 1.75; }
.btn { display: inline-block; padding: 1.05rem 2.9rem; background: var(--ink); color: var(--white); text-decoration: none; font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; border-radius: 100px; transition: transform 0.3s var(--ease), box-shadow 0.4s var(--ease), background 0.4s; }
.btn:hover { transform: translateY(-3px); background: var(--grad); box-shadow: 0 16px 40px rgba(242,41,91,0.35); }
.cta-foot { margin-top: 2.6rem; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.cta-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.cta-foot a:hover { color: var(--ink); }

/* ---------- reveal animations ---------- */
.r { opacity: 0; transform: translateY(34px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.r.on { opacity: 1; transform: none; }
.r-stagger > * { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.r-stagger.on > * { opacity: 1; transform: none; }
.r-stagger.on > *:nth-child(2) { transition-delay: 0.08s; }
.r-stagger.on > *:nth-child(3) { transition-delay: 0.16s; }
.r-stagger.on > *:nth-child(4) { transition-delay: 0.24s; }
.r-stagger.on > *:nth-child(5) { transition-delay: 0.32s; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .about, .case-split, .case-mockup { grid-template-columns: 1fr; }
  .case-split.flip .case-img { order: -1; }
  .case-split.flip .case-body { order: 0; }
  .case-mockup.flip .mockup-stage { order: -1; }
  .case-mockup.flip .case-body { order: 0; }
  .case-img, .mockup-stage { min-height: 56vh; }
  .case-cinema { min-height: auto; flex-direction: column; align-items: stretch; }
  .cinema-bg { position: relative; height: 56vh; inset: auto; }
  .cinema-overlay { display: none; }
  .cinema-content { background: var(--white); grid-template-columns: 1fr; gap: 1rem; align-items: flex-start; }
  .cinema-content .case-title { color: var(--ink); }
  .cinema-content .case-num { color: var(--muted); }
  .cinema-content .tag { border-color: var(--line); color: var(--muted); }
  .cinema-content .case-desc { color: var(--ink-2); }
  .cinema-content .case-desc strong { color: var(--ink); }
  .cinema-content .case-link { color: var(--ink); }
  .ios-head { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .ios-sub { max-width: 100%; }
  .ios-item { width: 150px; }
  .ios-reel-track { gap: 0.7rem; }
  .scope-list { grid-template-columns: 1fr; }
  .nav-links { gap: 1.3rem; }
  .macbook { max-width: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .r, .r-stagger > * { opacity: 1 !important; transform: none !important; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
