/* =========================================================
   Ondics – Progressive-enhancement one-pager

   BASE (no .enhanced)  → robust native VERTICAL layout.
                          Works without JS and on old browsers.
   body.enhanced        → fixed HORIZONTAL parallax experience
                          (added by JS only when supported).
   ========================================================= */

:root {
  --accent:      #1a5cff;
  --accent-dk:   #1248d4;
  --accent-soft: #e9f0ff;
  --fg:          #14161c;
  --muted:       #5b6271;
  --ease:        cubic-bezier(.22, .61, .36, 1);
}

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

html, body {
  min-height: 100%;
  background: #eef1f6;
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { overflow-x: hidden; }

img, svg { display: block; }

/* ---------- Shared typography ---------- */
.slide-kicker {
  font-size: .8rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}
.slide-title { font-weight: 700; line-height: 1.12; letter-spacing: -.01em; color: var(--fg); }
.slide-text  { line-height: 1.5; color: var(--muted); }
.slide-btn {
  align-self: flex-start; margin-top: 6px;
  background: var(--accent); color: #fff; font-weight: 600;
  padding: 11px 22px; border-radius: 999px; text-decoration: none;
  transition: background .2s;
}
.slide-btn:hover { background: var(--accent-dk); }
.slide-imprint { line-height: 1.55; color: var(--muted); }
.slide-imprint strong { color: var(--fg); }
.slide-imprint a { color: var(--accent); }
.slide-note {
  align-self: flex-start; color: var(--accent);
  background: var(--accent-soft); padding: 5px 12px; border-radius: 6px;
}

/* =========================================================
   FALLBACK (base): vertical document
   ========================================================= */
.panorama, .panorama-overlay, .scrim-bottom, .headline-bar, .nav-arrow, .pager,
.cam-view, .chat-header, .chat-input, .scroll-cue { display: none; }

/* fallback: the chat renders as a simple message list */
.chat { display: flex; flex-direction: column; gap: 12px; width: 100%; align-items: flex-start; }
.msg {
  max-width: min(60ch, 88%); padding: 12px 18px; border-radius: 18px;
  line-height: 1.45; font-size: clamp(1rem, 1.5vw, 1.15rem);
}
.msg.in  { background: #eceff4; color: var(--fg); border-bottom-left-radius: 6px; }
.msg.out { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.msg.in a  { color: var(--accent); }
.msg.out a { color: #fff; text-decoration: underline; }
.msg.img { background: none; padding: 0; max-width: 360px; }
.msg.img svg { display: block; width: 100%; height: auto; border-radius: 14px; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 clamp(20px, 5vw, 56px);
  background: rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(20,22,28,.08);
}
.logo { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; color: var(--fg); text-decoration: none; }
.logo::after { content: "."; color: var(--accent); }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav button {
  background: none; border: 0; font: inherit; font-size: .86rem; font-weight: 500;
  color: var(--muted); padding: 8px 12px; border-radius: 999px; cursor: pointer;
}
.topnav button:hover { color: var(--fg); }

/* phone frame is neutralised in fallback */
.phone-stage, .phone, .phone-screen, .phone-viewport { display: block; position: static; }
.phone-island, .phone-home, .phone-btn { display: none; }
.phone-track { display: block; }

.slide {
  position: relative;
  min-height: 78vh;
  display: flex; flex-direction: column; justify-content: center;
  gap: 14px;
  padding: 14vh clamp(24px, 8vw, 120px);
  background-image:
    linear-gradient(100deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.74) 55%, rgba(255,255,255,.5) 100%),
    var(--bg);
  background-size: cover; background-position: center;
  border-bottom: 1px solid rgba(20,22,28,.06);
}
.slide::before {                       /* the UPPERCASE headline, no JS needed */
  content: attr(data-headline);
  text-transform: uppercase;
  font-size: clamp(2rem, 7vw, 4.2rem);
  font-weight: 800; letter-spacing: .03em; line-height: 1.04;
  color: var(--fg);
}
.slide-title { font-size: clamp(1.4rem, 3.4vw, 2.1rem); max-width: 22ch; }
.slide-text  { font-size: clamp(1rem, 1.6vw, 1.2rem); max-width: 52ch; }
.slide-imprint { font-size: clamp(.95rem, 1.4vw, 1.05rem); }
.slide-note { font-size: .85rem; }

/* =========================================================
   ENHANCED: fixed horizontal parallax experience
   ========================================================= */
body.enhanced { overflow: hidden; height: 100%; background: #0b0d12; }

/* one continuous panorama, panned by JS (width/height set in JS) */
body.enhanced .panorama {
  display: block; position: fixed; top: 0; left: 0;
  background-image: url('img/panorama.jpg');
  background-size: cover; background-position: center; background-repeat: no-repeat;
  will-change: transform; transform: translate3d(0,0,0);
  z-index: 0;
}
body.enhanced .panorama-overlay {
  display: block; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(110deg, rgba(255,255,255,.72) 0%, rgba(255,255,255,.5) 45%, rgba(255,255,255,.34) 100%),
    radial-gradient(120% 90% at 82% 112%, rgba(26,92,255,.16), transparent 60%);
}

body.enhanced .scrim-bottom {
  display: block; position: fixed; left: 0; right: 0; bottom: 0;
  height: clamp(120px, 24vh, 240px);
  background: linear-gradient(to top, rgba(255,255,255,.94), rgba(255,255,255,.55) 45%, transparent);
  z-index: 2; pointer-events: none;
}

/* ---- schematic iPhone (landscape) ---- */
body.enhanced .phone-stage {
  display: grid; place-items: center;
  position: fixed; inset: 0; pointer-events: none; z-index: 3;
  padding: 72px 0 clamp(120px, 16vh, 170px);   /* clear the top bar and bottom headline */
}
body.enhanced .phone {
  position: relative;
  width: clamp(220px, 26vw, 380px);
  aspect-ratio: 1 / 2.09;
  background: linear-gradient(150deg, #2b2f38 0%, #14171d 46%, #0a0c11 100%);
  border-radius: clamp(44px, 4.6vw, 74px);   /* uniform; JS sets the exact value */
  padding: clamp(9px, 1.5%, 15px);
  box-shadow:
    0 0 0 2px rgba(255,255,255,.05) inset,
    0 1px 1px rgba(255,255,255,.14) inset,
    0 36px 70px -22px rgba(8,15,40,.55),
    0 14px 30px -14px rgba(8,15,40,.5);
}
body.enhanced .phone-screen {
  display: block; position: relative; height: 100%; width: 100%;
  border-radius: clamp(20px, 3.4vw, 60px);   /* JS sets the exact concentric value */
  background: #ffffff;
  overflow: hidden;
  /* San Francisco on Apple devices, graceful fallback elsewhere */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
}
body.enhanced .phone-island {            /* Dynamic Island — top centre */
  display: block; position: absolute; z-index: 4;
  left: 50%; top: clamp(8px, 1.6%, 14px); transform: translateX(-50%);
  width: clamp(78px, 30%, 130px); height: clamp(18px, 4.6%, 26px);
  background: #08090c; border-radius: 999px; pointer-events: none;
}
body.enhanced .phone-home {              /* home indicator — bottom centre */
  display: block; position: absolute; z-index: 4;
  left: 50%; bottom: clamp(7px, 1.2%, 11px); transform: translateX(-50%);
  width: clamp(96px, 34%, 150px); height: clamp(4px, .9%, 6px);
  background: rgba(10,12,18,.32); border-radius: 999px; pointer-events: none;
}
body.enhanced .phone-btn { display: block; position: absolute; background: #15181e; border-radius: 4px; }
body.enhanced .phone-btn--top    { top: 26%; right: -2px; width: 4px; height: clamp(42px, 10%, 64px); }  /* power, right */
body.enhanced .phone-btn--bottom { top: 17%; left: -2px;  width: 4px; height: clamp(26px, 6%, 44px); }   /* volume, left */

/* ---- Messages-style chat (iMessage) ---- */
body.enhanced .chat-header {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: clamp(1px, .4%, 3px);
  position: absolute; z-index: 4; top: 0; left: 0; right: 0;
  height: clamp(70px, 15%, 104px); padding-bottom: clamp(5px, 1.4%, 9px);
  background: rgba(248,248,250,.82);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(60,60,67,.16);
}
body.enhanced .chat-back {
  position: absolute; left: clamp(8px, 4%, 16px); bottom: clamp(12px, 4%, 22px);
  display: grid; place-items: center; background: none; border: 0; padding: 0; cursor: pointer;
}
body.enhanced .chat-back svg { width: clamp(13px, 4.4vmin, 19px); height: clamp(13px, 4.4vmin, 19px); }
body.enhanced .chat-avatar {
  display: grid; place-items: center;
  width: clamp(26px, 7vmin, 38px); height: clamp(26px, 7vmin, 38px); border-radius: 50%;
  background: linear-gradient(160deg, #4a90ff, #1a5cff); color: #fff;
  font-size: clamp(.7rem, 3vmin, .95rem); font-weight: 600;
}
body.enhanced .chat-name { font-size: clamp(.62rem, 2vmin, .78rem); font-weight: 500; color: #000; }

body.enhanced .phone-viewport {
  display: block; position: absolute; z-index: 3; overflow: hidden;
  left: 0; right: 0;
  top: clamp(70px, 15%, 104px);
  bottom: clamp(46px, 11%, 72px);
}
body.enhanced .phone-track { display: flex; height: 100%; will-change: transform; transform: translate3d(0,0,0); }
body.enhanced .slide {
  flex: 0 0 100%; height: 100%; min-height: 0;
  display: flex; flex-direction: column;
  padding: clamp(8px, 2.4%, 14px) clamp(10px, 4%, 18px);
  background: none; border: 0; overflow: hidden;
}
body.enhanced .slide::before { content: none; display: none; }
/* the message list scrolls inside the phone (iOS-style, hidden scrollbar) */
body.enhanced .chat {
  flex: 1 1 auto; min-height: 0;
  gap: clamp(3px, .9%, 6px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; overscroll-behavior: contain;
  pointer-events: auto;          /* receive wheel/scroll (phone-stage is none) */
}
body.enhanced .chat::before { content: ''; margin-top: auto; }   /* bottom-anchor short chats */
body.enhanced .chat::-webkit-scrollbar { width: 0; height: 0; }

/* subtle "scroll for more" cue + bounce */
body.enhanced .scroll-cue {
  position: absolute; z-index: 4; left: 50%;
  bottom: clamp(54px, 13%, 84px); transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(8,15,40,.2);
  display: grid; place-items: center; color: #007aff;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
body.enhanced .scroll-cue svg { width: 16px; height: 16px; }
body.enhanced .scroll-cue.is-visible { opacity: 1; animation: cue-bob 1.7s ease-in-out infinite; }
body.enhanced .scroll-cue.is-bouncing { animation: cue-bounce .9s ease-in-out 3; }
@keyframes cue-bob    { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(3px); } }
@keyframes cue-bounce { 0%,100% { transform: translateX(-50%) translateY(0); } 30% { transform: translateX(-50%) translateY(8px); } 60% { transform: translateX(-50%) translateY(2px); } }

body.enhanced .msg {
  max-width: 76%; padding: clamp(6px, 2%, 10px) clamp(9px, 3%, 14px);
  border-radius: 18px; line-height: 1.3;
  font-size: clamp(.78rem, 2.1vmin, .98rem); word-wrap: break-word;
}
body.enhanced .msg.in  { align-self: flex-start; background: #e9e9eb; color: #000; border-bottom-left-radius: 5px; }
body.enhanced .msg.out { align-self: flex-end; background: #007aff; color: #fff; border-bottom-right-radius: 5px; }
body.enhanced .msg.in a  { color: #007aff; }
body.enhanced .msg.out a { color: #fff; text-decoration: underline; }
body.enhanced .msg a { pointer-events: auto; }   /* links stay clickable */

/* a sent image (e.g. a chart screenshot) */
body.enhanced .msg.img { padding: 0; background: none; overflow: hidden; max-width: 60%; border-radius: 16px; }
body.enhanced .msg.img.out { align-self: flex-end; border-bottom-right-radius: 5px; }
body.enhanced .msg.img svg, body.enhanced .msg.img img { display: block; width: 100%; height: auto; }

body.enhanced .chat-input {
  display: flex; position: absolute; z-index: 4; bottom: 0; left: 0; right: 0;
  align-items: center; gap: clamp(5px, 1.8%, 9px);
  height: clamp(46px, 11%, 72px); padding: 0 clamp(8px, 3%, 14px) clamp(8px, 2.4%, 14px);
  background: rgba(248,248,250,.82);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-top: 1px solid rgba(60,60,67,.16);
  pointer-events: auto; cursor: pointer;   /* opens the detail modal */
}
body.enhanced .chat-field {
  flex: 1 1 auto; display: flex; align-items: center;
  height: clamp(24px, 7%, 34px); padding: 0 clamp(10px, 3.4%, 15px);
  border-radius: 999px; border: 1px solid rgba(60,60,67,.26);
  color: rgba(60,60,67,.5); font-size: clamp(.72rem, 2vmin, .9rem);
}
body.enhanced .chat-send {
  display: grid; place-items: center; flex: 0 0 auto;
  width: clamp(24px, 7vmin, 32px); height: clamp(24px, 7vmin, 32px); border-radius: 50%;
  background: #007aff;
}
body.enhanced .chat-send svg { width: 56%; height: 56%; }

/* ---- big UPPERCASE headline at the bottom ---- */
body.enhanced .headline-bar {
  display: flex; justify-content: center; padding: 0 18px;
  position: fixed; left: 0; right: 0; bottom: clamp(40px, 7vh, 72px);
  z-index: 4; pointer-events: none;
}
body.enhanced .headline {
  font-size: clamp(1.5rem, 4.4vw, 3.3rem);
  font-weight: 800; letter-spacing: .045em; text-transform: uppercase;
  text-align: center; color: var(--fg);
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
body.enhanced .headline.is-swapping { opacity: 0; transform: translateY(10px); }

/* ---- enhanced chrome ---- */
body.enhanced .topbar {
  position: fixed; height: 72px; background: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; border: 0;
}
body.enhanced .nav-arrow {
  display: grid; place-items: center;
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(20,22,28,.12);
  background: rgba(255,255,255,.7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--fg); cursor: pointer; z-index: 10;
  transition: background .2s, transform .2s;
}
body.enhanced .nav-arrow svg { width: 22px; height: 22px; }
body.enhanced .nav-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
body.enhanced .nav-arrow--prev { left: clamp(14px, 2.4vw, 34px); }
body.enhanced .nav-arrow--next { right: clamp(14px, 2.4vw, 34px); }
body.enhanced .nav-arrow[disabled] { display: none; }   /* hide when not available */

body.enhanced .pager {
  display: flex; gap: 12px; z-index: 10;
  position: fixed; left: 50%; bottom: clamp(16px, 3vh, 26px); transform: translateX(-50%);
}
body.enhanced .pager button {
  width: 11px; height: 11px; border-radius: 50%; border: 0;
  background: rgba(20,22,28,.22); cursor: pointer; padding: 0;
  transition: background .25s, width .25s;
}
body.enhanced .pager button:hover { background: rgba(20,22,28,.45); }
body.enhanced .pager button.is-active { background: var(--accent); width: 30px; border-radius: 6px; }

/* ---- PORTRAIT: phone stands upright, island top / home bottom ---- */
/* small screens: hide top nav, shrink arrows */
@media (max-width: 760px) {
  body.enhanced .topnav { display: none; }
  body.enhanced .nav-arrow { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .001ms !important; }
}

/* =========================================================
   Detail modal (opens from the message bar) — larger than the phone
   ========================================================= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(10,14,24,.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative;
  width: min(760px, 92vw); max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 24px;
  padding: clamp(28px, 5vw, 56px);
  box-shadow: 0 30px 90px -20px rgba(8,15,40,.6);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: #f0f1f4; color: #14161c; font-size: 1.5rem; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
  transition: background .15s;
}
.modal-close:hover { background: #e4e6ea; }
.modal-title {
  font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 700;
  letter-spacing: -.02em; color: var(--fg); margin-bottom: 16px; padding-right: 40px;
}
.modal-body { font-size: clamp(1rem, 1.4vw, 1.18rem); line-height: 1.6; color: var(--muted); }
.modal-body a { color: var(--accent); }
.modal-cta {
  display: inline-block; margin-top: 28px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 1rem;
  padding: 13px 28px; border-radius: 999px; text-decoration: none;
  transition: background .2s;
}
.modal-cta:hover { background: var(--accent-dk); }
