/* The compare page: a title and one table. The table is machined hardware like every card on
   the site, a white core in a translucent tray, and inside it the three traditional clouds sit
   in muted columns under one shared label while Uncloud is the only ink column, so the eye
   lands on the difference. Rows rise in turn as the table arrives. Loaded after site.css. */

.compare-open { padding-bottom: clamp(48px, 6vw, 88px); }
.compare-table { padding-bottom: var(--section); }

/* ---------- the double bezel: a tray, then the core ---------- */

.versus { padding: var(--tray); border-radius: var(--r); background: var(--c-tray); box-shadow: 0 0 0 1px var(--c-hair), var(--shadow-soft); }
.versus__core { border-radius: var(--r-core); background: var(--c-surface); box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.9); overflow: hidden; }
.versus__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- the table ---------- */

.versus table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; font-size: var(--step-small); line-height: 1.5; }
.versus th, .versus td { padding: 22px 24px; text-align: left; vertical-align: top; }
.versus thead th { padding-block: 10px 26px; font-size: var(--step-body); font-weight: 650; letter-spacing: -0.02em; color: var(--c-ink); }
.versus .group > * { padding-block: 32px 0; }
.versus .group .eyebrow { margin: 0; }
.versus tbody th { width: 22%; font-weight: 600; color: var(--c-ink); }
.versus tbody td { color: var(--c-muted); }
.versus tbody tr > * { border-top: 1px solid var(--c-hair); transition: background-color var(--t-hover) var(--spring), color var(--t-hover) var(--spring); }

.versus .icon { margin-right: 12px; vertical-align: -0.3em; color: var(--c-deep); }
.versus .logo { display: block; width: auto; height: 1.75rem; max-width: 2.5rem; margin-bottom: 14px; object-fit: contain; }
.versus .logo--app { border-radius: 8px; }

/* a row lifts out of the grey when you point at it */
@media (hover: hover) and (pointer: fine) {
  .versus tbody tr:hover > :not(.ours) { background: var(--c-ground-2); color: var(--c-ink); }
}

/* the only column with a colour of its own: an ink rail from the label row to the last row */
.versus .ours { width: 27%; background: var(--c-ink); color: rgb(250 250 250 / 0.72); }
.versus thead .ours { color: #fff; }
.versus .group .ours { border-radius: var(--r-core) var(--r-core) 0 0; }
.versus tbody tr > .ours { border-top-color: rgb(255 255 255 / 0.08); }
.versus tbody tr:last-child > .ours { border-radius: 0 0 var(--r-core) var(--r-core); }
.versus .ours strong { color: #fff; }

.versus__foot { display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; padding: 28px 24px 24px; border-top: 1px solid var(--c-hair); }
.versus__foot p { max-width: 72ch; color: var(--c-muted); }

/* ---------- arrival: the rows rise in turn once the table is in view ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .versus[data-reveal] tbody tr > * {
    opacity: 0; transform: translateY(24px);
    transition: opacity 900ms var(--spring), transform var(--t-reveal) var(--spring), background-color var(--t-hover) var(--spring), color var(--t-hover) var(--spring);
    transition-delay: calc(var(--r, 0) * 70ms + 200ms), calc(var(--r, 0) * 70ms + 200ms), 0ms, 0ms;
  }
  .js .versus[data-reveal].is-in tbody tr > * { opacity: 1; transform: none; }
}

/* ---------- phone: each row becomes a card. The question, then every answer on its own line,
   named by its logo: Uncloud first, then the three traditional clouds, all alike. ---------- */

@media (max-width: 767px) {
  .versus__scroll { overflow: visible; }
  .versus table, .versus tbody, .versus tbody tr, .versus tbody th, .versus tbody td { display: block; width: auto; min-width: 0; }
  /* the column heads are read out, not shown: each answer carries its own name */
  .versus thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

  .versus tbody tr { display: flex; flex-direction: column; padding: 22px 16px 18px; }
  .versus tbody tr + tr { border-top: 1px solid var(--c-hair); }
  .versus tbody tr > * { padding: 0; border-top: none; }
  .versus tbody th { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: var(--step-body); letter-spacing: -0.02em; }
  .versus .icon { margin: 0; }

  .versus tbody td { order: 2; position: relative; padding: 10px 4px 0 calc(7.75rem + 10px); }
  .versus tbody .ours, .versus tbody tr > .ours, .versus tbody tr:last-child > .ours { order: 1; width: auto; background: none; border-radius: 0; color: var(--c-muted); }
  .versus .ours strong { color: var(--c-ink); }

  /* the name in front of each answer, by its logo */
  .versus tbody td::before { position: absolute; left: 4px; top: 10px; width: 7.75rem; font-weight: 600; color: var(--c-ink); background: no-repeat left center / 1.125rem auto; padding-left: 1.625rem; }
  .versus tbody td:nth-child(2)::before { content: "iCloud"; background-image: url("/static/images/logos/icloud.png"); }
  .versus tbody td:nth-child(3)::before { content: "Dropbox"; background-image: url("/static/images/logos/dropbox.png"); }
  .versus tbody td:nth-child(4)::before { content: "Google Drive"; background-image: url("/static/images/logos/google-drive.png"); }
  .versus tbody .ours::before { content: "Uncloud"; background-image: url("/apple-touch-icon.png"); }

  .versus__foot { flex-direction: column; align-items: stretch; padding: 20px 16px; }
  .versus__foot .btn { justify-content: space-between; }
}

/* ---------- one on one (/compare/icloud): two columns share the width ---------- */

@media (min-width: 768px) {
  .versus--pair table { min-width: 640px; }
  .versus--pair tbody th { width: 28%; }
  .versus--pair .ours { width: 40%; }
}
.compare-open .eyebrow + h1 { margin-top: 24px; }
/* on a phone the Uncloud cell is the third child here, where the four-way table puts Dropbox */
@media (max-width: 767px) {
  .versus--pair tbody td.ours::before { content: "Uncloud"; background-image: url("/apple-touch-icon.png"); }
}

/* ---------- questions: plain disclosure rows on the split's right ---------- */

.faq details { border-top: 1px solid var(--c-hair); }
.faq details:last-child { border-bottom: 1px solid var(--c-hair); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; cursor: pointer; list-style: none; font-weight: 600; letter-spacing: -0.015em; color: var(--c-ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 1.375rem; line-height: 1; color: var(--c-deep); transition: transform var(--t-hover) var(--spring); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 22px; max-width: 60ch; color: var(--c-muted); }
.split .split__body.faq > * + * { margin-top: 0; }
