/* Compare the Cloud — ebook landing page kit
   Shared tokens, type, form, device mockups and the imagery switcher. */

@import url("tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--paper); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.02; letter-spacing: -0.02em; margin: 0; font-weight: 800; }
p { margin: 0; }
a { color: inherit; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.logo { height: 54px; width: auto; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* ---------- Form ---------- */
.form { display: grid; gap: 12px; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 5px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select {
  font: inherit; font-size: 15px; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px rgb(43 124 192 / .15); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.consent input { margin-top: 2px; accent-color: var(--blue-600); }
.btn {
  font: inherit; font-weight: 700; font-size: 16px; border: 0; cursor: pointer;
  padding: 15px 22px; border-radius: 10px; background: var(--red); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .15s, background .15s, box-shadow .15s;
  box-shadow: 0 8px 24px -8px rgb(229 48 42 / .6);
  text-decoration: none;
}
.btn:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }
.btn.blue { background: var(--blue-600); box-shadow: 0 8px 24px -8px rgb(29 95 153 / .6); }
.btn.blue:hover { background: var(--navy-700); }
.form-note { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.form-done { display: none; text-align: center; padding: 20px 8px; }
.form-done h3 { font-size: 26px; margin-bottom: 8px; }
form.sent > *:not(.form-done) { display: none; }
form.sent .form-done { display: block; }

/* On dark */
.on-dark .field label { color: #c9d6e4; }
.on-dark .field input, .on-dark .field select { background: rgb(255 255 255 / .06); border-color: rgb(255 255 255 / .16); color: #fff; }
.on-dark .field input::placeholder { color: #8ea3b9; }
.on-dark .consent, .on-dark .form-note { color: #9fb2c6; }

/* ---------- Ebook cover (rendered by kit.js into .cover) ---------- */
.cover {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background:
    radial-gradient(120% 70% at 100% 0%, rgb(61 154 212 / .55), transparent 60%),
    linear-gradient(160deg, var(--navy-700), var(--navy-900) 70%);
  color: #fff; container-type: inline-size;
}
.cover > .c-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover > .c-in { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 9cqw 8cqw; }
.cover .c-logo { width: 34cqw; }
.cover .c-kicker { margin-top: auto; font-size: 3.6cqw; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #9fcdf0; }
.cover .c-title { font-family: var(--font-display); font-weight: 800; font-size: 11.5cqw; line-height: .95; letter-spacing: -0.02em; margin-top: 3cqw; }
.cover .c-sub { font-size: 3.9cqw; line-height: 1.35; margin-top: 4cqw; color: #cfe0f0; }
.cover .c-bar { height: 1.6cqw; width: 22cqw; background: var(--red); margin-top: 6cqw; border-radius: 2px; }
.cover .c-year { position: absolute; right: 8cqw; top: 8cqw; font-family: var(--font-display); font-weight: 800; font-size: 5cqw; color: rgb(255 255 255 / .9); }
.cover .c-rings { position: absolute; right: -30cqw; top: 22cqw; width: 90cqw; aspect-ratio: 1; border-radius: 50%; border: 0.8cqw solid rgb(255 255 255 / .09); box-shadow: 0 0 0 7cqw rgb(255 255 255 / .03), 0 0 0 14cqw rgb(255 255 255 / .025); }
.cover.landscape > .c-in { padding: 6cqw; }
.cover.landscape .c-title { font-size: 7cqw; }
.cover.landscape .c-sub { font-size: 2.2cqw; }
.cover.landscape .c-kicker { font-size: 2cqw; }
.cover.landscape .c-logo { width: 20cqw; }
.cover.landscape .c-bar { width: 12cqw; height: 1cqw; }
.cover.landscape .c-year { font-size: 3cqw; }

/* ---------- Interior page (rendered by kit.js into .page) ---------- */
.page { position: relative; width: 100%; height: 100%; background: #fff; color: var(--ink); container-type: inline-size; overflow: hidden; }
.page > .p-in { position: absolute; inset: 0; padding: 8cqw; display: flex; flex-direction: column; gap: 3cqw; }
.page .p-chap { font-size: 3cqw; font-weight: 700; color: var(--red); letter-spacing: .1em; text-transform: uppercase; }
.page .p-h { font-family: var(--font-display); font-weight: 800; font-size: 7.4cqw; line-height: 1; }
.page .p-t { font-size: 3.1cqw; line-height: 1.45; color: var(--ink-2); }
.page .p-chart { display: flex; align-items: flex-end; gap: 2.4cqw; height: 32cqw; padding: 3cqw; background: var(--paper-2); border-radius: 2cqw; margin-top: 1cqw; }
.page .p-chart i { flex: 1; background: var(--blue-500); border-radius: 1cqw 1cqw 0 0; }
.page .p-chart i:nth-child(3) { background: var(--red); }
.page .p-quote { border-left: 1.2cqw solid var(--blue-400); padding-left: 3cqw; font-family: var(--font-display); font-weight: 700; font-size: 4.4cqw; line-height: 1.15; }
.page .p-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 2.6cqw; color: var(--ink-3); }

/* ---------- Devices ---------- */
.ipad {
  position: relative; aspect-ratio: 3 / 4; border-radius: 6.5% / 4.9%;
  background: linear-gradient(145deg, #3a3d42, #16171a 40%, #0c0c0e);
  box-shadow: 0 0 0 1.5px #9aa0a8 inset, 0 0 0 2.5px #2a2c30, 0 50px 90px -30px rgb(3 12 24 / .55), 0 20px 40px -20px rgb(3 12 24 / .5);
}
.ipad.landscape { aspect-ratio: 4 / 3; border-radius: 4.9% / 6.5%; }
.ipad > .screen { position: absolute; inset: 3.15% 4.2%; border-radius: 3.2% / 2.4%; overflow: hidden; background: #000; }
.ipad.landscape > .screen { inset: 4.2% 3.15%; }
.ipad.landscape > .screen { border-radius: 2.4% / 3.2%; }
.ipad::before { content: ""; position: absolute; top: 1.9%; left: 50%; width: 1.4%; aspect-ratio: 1; border-radius: 50%; background: #2c3440; transform: translateX(-50%); }
.ipad.landscape::before { top: 50%; left: 1.9%; width: auto; height: 1.4%; transform: translateY(-50%); }
.screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgb(255 255 255 / .14), transparent 38%); pointer-events: none; }

.macbook { position: relative; width: 100%; }
.macbook .lid {
  position: relative; aspect-ratio: 16 / 10.4; border-radius: 3% 3% 0 0 / 4.6% 4.6% 0 0;
  background: #0d0e10; padding: 2.2% 2.2% 3.4%;
  box-shadow: 0 0 0 1.5px #b8bec6, 0 40px 80px -30px rgb(3 12 24 / .5);
}
.macbook .lid::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 12%; height: 2.6%; background: #0d0e10; border-radius: 0 0 8px 8px; z-index: 2; }
.macbook .screen { width: 100%; height: 100%; overflow: hidden; position: relative; border-radius: 0.6%; background: #111; }
.macbook .base {
  position: relative; height: 0; padding-bottom: 3.6%; width: 116%; margin-left: -8%;
  background: linear-gradient(#e6e9ed, #b9bfc7 55%, #8d949d);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  box-shadow: 0 30px 50px -18px rgb(3 12 24 / .55);
}
.macbook .base::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 15%; height: 42%; background: linear-gradient(#a9b0b8, #cfd4da); border-radius: 0 0 12px 12px; }

.iphone {
  position: relative; aspect-ratio: 9 / 19.5; border-radius: 17% / 7.8%;
  background: #121316;
  box-shadow: 0 0 0 1.5px #8e949c inset, 0 0 0 2.5px #2a2c30, 0 40px 70px -24px rgb(3 12 24 / .6);
}
.iphone > .screen { position: absolute; inset: 2.03% 4.4%; border-radius: 13% / 6%; overflow: hidden; background: #000; }
.iphone > .screen::before { content: ""; position: absolute; top: 2.2%; left: 50%; transform: translateX(-50%); width: 32%; height: 3.4%; background: #000; border-radius: 99px; z-index: 3; }

/* PDF viewer chrome (for laptop screens) */
.viewer { width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr; background: #2b2f36; container-type: inline-size; }
.viewer .v-bar { display: flex; align-items: center; gap: 1cqw; padding: 1.1cqw 1.6cqw; background: #1c1f24; color: #c7cdd6; font-size: 1.35cqw; }
.viewer .v-dots { display: flex; gap: .7cqw; }
.viewer .v-dots i { width: 1.1cqw; height: 1.1cqw; border-radius: 50%; background: #ff5f57; }
.viewer .v-dots i:nth-child(2) { background: #febc2e; }
.viewer .v-dots i:nth-child(3) { background: #28c840; }
.viewer .v-name { margin-left: 1.5cqw; font-weight: 600; }
.viewer .v-zoom { margin-left: auto; opacity: .7; }
.viewer .v-body { display: flex; gap: 2.4cqw; justify-content: center; align-items: center; padding: 2.4cqw; overflow: hidden; }
.viewer .v-body > * { height: 100%; aspect-ratio: 1 / 1.414; width: auto; flex: none; box-shadow: 0 1cqw 3cqw rgb(0 0 0 / .45); }

/* Print book (3D) */
.book3d { position: relative; aspect-ratio: 1 / 1.414; transform-style: preserve-3d; transform: perspective(1400px) rotateY(-28deg) rotateX(4deg); }
.book3d .b-front { position: absolute; inset: 0; border-radius: 2px 6px 6px 2px; overflow: hidden; box-shadow: 30px 40px 60px -20px rgb(3 12 24 / .6); }
.book3d .b-front::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4%; background: linear-gradient(90deg, rgb(0 0 0 / .35), rgb(255 255 255 / .15), transparent); z-index: 2; }
.book3d .b-pages { position: absolute; top: 1.2%; bottom: 1.2%; right: 0; width: 9%; transform-origin: right; transform: rotateY(90deg) translateX(50%); background: repeating-linear-gradient(90deg, #f3f3f0 0 2px, #d9d9d4 2px 3px); }

/* ---------- Imagery switcher (design review tool, not part of the live page) ---------- */
.switcher {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 100;
  display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px;
  background: rgb(8 14 22 / .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px -10px rgb(0 0 0 / .5); color: #fff; font-size: 13px; max-width: calc(100vw - 24px); overflow-x: auto;
}
.switcher .s-label { padding: 0 10px 0 12px; font-weight: 700; color: #9fb2c6; white-space: nowrap; }
.switcher button { font: inherit; font-weight: 600; border: 0; background: transparent; color: #cfd9e4; padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.switcher button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.switcher .s-sep { width: 1px; align-self: stretch; background: rgb(255 255 255 / .15); margin: 4px 4px; }
.switcher a { color: #cfd9e4; text-decoration: none; padding: 8px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.switcher a[aria-current="page"] { color: #fff; background: rgb(255 255 255 / .12); }

.reveal { opacity: 0; transform: translateY(18px); animation: rise .8s cubic-bezier(.2,.7,.2,1) forwards; }
.d1 { animation-delay: .08s } .d2 { animation-delay: .16s } .d3 { animation-delay: .24s } .d4 { animation-delay: .32s }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes floaty { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .form .row2 { grid-template-columns: 1fr; }
  .logo { height: 36px; }
}

/* Form error line (library pages) */
.form-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fdeceb; color: var(--red-dark); font-size: 14px; font-weight: 600; }
.notice { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; margin: 0; }
.on-dark .notice { color: #9fb2c6; }
.draft-flag { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 101; background: var(--amber); color: var(--ink); font-weight: 700; font-size: 13px; padding: 6px 14px; border-radius: 999px; box-shadow: 0 6px 18px rgb(0 0 0 / .25); }
