/* MacDiskCleanUp — marketing and legal site.

   The palette is the app's own tokens (MacDiskCleanUpMac/DesignSystem/Theme.swift).
   A site that looks nothing like the product it sells makes the product look
   like someone else's. */

:root {
  --bg: #0f141b;
  --bg-alt: #12171e;
  --surface: #171c23;
  --surface-2: #1e242c;
  --raised: #272d36;
  --border: rgba(255, 255, 255, 0.07);
  --separator: rgba(255, 255, 255, 0.05);

  --text: #f3f5f8;
  --text-2: #9ba4b0;
  --muted: #6b7480;

  --accent: #1c64d2;
  --accent-hover: #2d74e0;
  --safe: #4ed16a;
  --review: #efab05;
  --danger: #e45c4f;
  --recoverable: #8ae57d;

  --radius: 12px;
  --radius-sm: 8px;
  --measure: 68ch;
  --page: 1080px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-num: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-hover);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Keyboard users land here first; everyone else never sees it. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  z-index: 100;
}

.skip:focus {
  left: 16px;
  top: 16px;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 20, 27, 0.85);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--separator);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(150deg, var(--accent-hover), #123f8c);
  display: grid;
  place-items: center;
  flex: none;
}

.brand-mark svg {
  width: 15px;
  height: 15px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
}

.nav a {
  color: var(--text-2);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

/* The nav is the only thing on the page that cannot wrap, so it is the only
   thing that has to be trimmed. Five links overflow a 375px viewport and take
   the whole page sideways with them; the anchors they point at are all still
   reachable by scrolling. Support is the one that must survive, because it is
   the link App Store review follows. */
@media (max-width: 900px) {
  .nav .nav-hide-md {
    display: none;
  }
}

@media (max-width: 720px) {
  .nav .nav-hide-sm {
    display: none;
  }
}

@media (max-width: 560px) {
  .nav .nav-hide-xs {
    display: none;
  }
  /* The legal pages keep all three of their links, so the header still has to
     shrink to fit a 375px phone alongside a fourteen-character product name. */
  .nav {
    gap: 14px;
    font-size: 14px;
  }
  .brand {
    font-size: 15px;
  }
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--raised);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #2f3642;
}

/* A button that does not go anywhere yet must not look like one that does. */
.btn[aria-disabled="true"] {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
}

.btn[aria-disabled="true"]:hover {
  background: var(--surface-2);
}

/* ---------------------------------------------------------------- layout */

section {
  padding: 78px 0;
  border-top: 1px solid var(--separator);
}

section:first-of-type {
  border-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(34px, 5.4vw, 52px);
}

h2 {
  font-size: clamp(25px, 3.4vw, 32px);
}

h3 {
  font-size: 19px;
}

.lede {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text-2);
  max-width: var(--measure);
  margin: 0 0 28px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

/* ---------------------------------------------------------------- hero */

.hero {
  padding: 84px 0 64px;
  background:
    radial-gradient(1100px 460px at 50% -180px, rgba(28, 100, 210, 0.22), transparent 70%),
    var(--bg);
  text-align: center;
}

.hero .lede {
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 14px;
}

.hero-note {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.shot {
  margin: 44px auto 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

/* ---------------------------------------------------------------- grids */

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card h3 {
  margin-bottom: 8px;
}

.card p {
  color: var(--text-2);
  margin: 0;
  font-size: 15.5px;
}

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: var(--accent-hover);
}

.card-icon svg {
  width: 18px;
  height: 18px;
}

/* ---------------------------------------------------------------- carousel

   No JavaScript anywhere on this site, so the current slide is held by a
   hidden radio group and the dots are its labels. Everything below is sibling
   combinators, which have worked since CSS2.

   Two earlier attempts are worth recording, because both looked right:

   1. A scroll-snap track with the dots as plain anchors, on the theory that
      the browser scrolls the nearest scrollable ancestor to reach a fragment.
      Measured: clicking a dot left scrollLeft at 0, every time.
   2. `:target` on the slide plus `.carousel:has(#slide-0N:target)` to move the
      track. That works on a page *loaded* at #slide-04 -- measured, the track
      really is translated -- and does nothing when the hash changes, because
      Chrome does not re-evaluate `:has()` when `:target` moves. A control that
      works only if you arrive by deep link is not a control.

   Radios also come with keyboard support for free: tab to the group, arrow
   between slides. */

.carousel {
  margin: 44px auto 0;
  max-width: 980px;
}

/* Off-screen rather than display:none, so the radios stay focusable. */
.carousel-state {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius);
}

.carousel-track {
  display: flex;
  transition: transform 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    transition: none;
  }
}

.carousel-slide {
  flex: 0 0 100%;
  margin: 0;
  min-width: 0;
}

#slide-radio-02:checked ~ .carousel-viewport .carousel-track { transform: translateX(-100%); }
#slide-radio-03:checked ~ .carousel-viewport .carousel-track { transform: translateX(-200%); }
#slide-radio-04:checked ~ .carousel-viewport .carousel-track { transform: translateX(-300%); }
#slide-radio-05:checked ~ .carousel-viewport .carousel-track { transform: translateX(-400%); }

/* The whole slide is the click target, so the affordance is the screenshot
   rather than a small expand icon nobody finds. */
.carousel-slide > a {
  display: block;
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
}

.carousel-slide > a::after {
  content: "View full size";
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: rgba(15, 20, 27, 0.82);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.carousel-slide > a:hover::after,
.carousel-slide > a:focus-visible::after {
  opacity: 1;
}

/* Touch has no hover, so the affordance is always visible there instead of
   never. */
@media (hover: none) {
  .carousel-slide > a::after {
    opacity: 1;
  }
}

.carousel-caption {
  color: var(--text-2);
  font-size: 15px;
  margin: 14px 8px 0;
  text-align: center;
}

.carousel-caption b {
  color: var(--text);
  font-weight: 600;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.carousel-dots label {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  user-select: none;
}

.carousel-dots label:hover {
  color: var(--text);
  background: var(--raised);
}

#slide-radio-01:checked ~ .carousel-dots label:nth-of-type(1),
#slide-radio-02:checked ~ .carousel-dots label:nth-of-type(2),
#slide-radio-03:checked ~ .carousel-dots label:nth-of-type(3),
#slide-radio-04:checked ~ .carousel-dots label:nth-of-type(4),
#slide-radio-05:checked ~ .carousel-dots label:nth-of-type(5) {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* Keyboard focus lands on the radio, which is invisible, so the label it
   belongs to shows the ring instead. */
.carousel-state:focus-visible ~ .carousel-dots label {
  outline: none;
}

#slide-radio-01:focus-visible ~ .carousel-dots label:nth-of-type(1),
#slide-radio-02:focus-visible ~ .carousel-dots label:nth-of-type(2),
#slide-radio-03:focus-visible ~ .carousel-dots label:nth-of-type(3),
#slide-radio-04:focus-visible ~ .carousel-dots label:nth-of-type(4),
#slide-radio-05:focus-visible ~ .carousel-dots label:nth-of-type(5) {
  outline: 2px solid var(--accent-hover);
  outline-offset: 3px;
}

.carousel-hint {
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  margin: 14px 0 0;
}

/* ---------------------------------------------------------------- lightbox

   `:target` again rather than a script. Hidden until its id is in the URL,
   which also means the browser's back button closes it. */

.lightbox {
  display: none;
}

.lightbox:target {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 44px 20px 20px;
  background: rgba(6, 9, 13, 0.95);
  overflow: auto;
}

/* Covers the whole overlay so clicking anywhere outside the image closes it,
   which is what everyone tries first. The figure sits above it. */
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}

.lightbox figure {
  position: relative;
  margin: 0;
  max-width: 1500px;
  width: 100%;
}

.lightbox img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.lightbox figcaption {
  color: var(--text-2);
  font-size: 15px;
  margin-top: 14px;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -32px;
  right: 0;
  z-index: 2;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.lightbox-close:hover {
  color: var(--text);
  text-decoration: none;
}

/* ------------------------------------------------------------ screenshots */

.shots {
  display: grid;
  gap: 26px;
  /* Two columns, not three: there are four figures, and `auto-fit` at 320px
     puts three on the first row and orphans the fourth. */
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
  max-width: 900px;
}

.shots figure {
  margin: 0;
}

.shots a {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.shots img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.shots a::after {
  content: "View full size";
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: rgba(15, 20, 27, 0.82);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.shots a:hover::after,
.shots a:focus-visible::after {
  opacity: 1;
}

@media (hover: none) {
  .shots a::after {
    opacity: 1;
  }
}

.shots figcaption {
  color: var(--text-2);
  font-size: 15px;
  margin-top: 12px;
}

.shots figcaption b {
  color: var(--text);
  font-weight: 600;
}

/* ---------------------------------------------------------------- editions */

.editions {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.edition {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.edition ul {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  color: var(--text-2);
  font-size: 15.5px;
}

.edition li {
  padding: 7px 0 7px 26px;
  position: relative;
}

.edition li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 15px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--surface-2);
}

.edition li[data-yes]::before {
  background: var(--safe);
}

.edition li[data-no]::before {
  background: var(--danger);
}

.edition .badge {
  align-self: flex-start;
}

.edition .spacer {
  flex: 1;
}

/* The buttons are the last thing in a stretch-aligned column too. */
.edition .btn {
  align-self: flex-start;
}

/* ---------------------------------------------------------------- pricing */

.tiers {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  align-items: start;
}

.tier {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}

.tier.featured {
  border-color: rgba(45, 116, 224, 0.55);
  background: linear-gradient(180deg, rgba(28, 100, 210, 0.1), var(--surface) 120px);
}

.price {
  font-family: var(--font-num);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 6px 0 2px;
}

.price small {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
  font-family: var(--font);
}

.tier ul {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  color: var(--text-2);
  font-size: 15.5px;
}

.tier li {
  padding: 6px 0 6px 24px;
  position: relative;
}

.tier li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--safe);
  font-weight: 700;
}

.tier li[data-no]::before {
  content: "—";
  color: var(--muted);
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
}

.badge-review {
  color: var(--review);
  border-color: rgba(239, 171, 5, 0.35);
  background: rgba(239, 171, 5, 0.1);
}

.badge-safe {
  color: var(--safe);
  border-color: rgba(78, 209, 106, 0.35);
  background: rgba(78, 209, 106, 0.1);
}

/* ---------------------------------------------------------------- notice */

.notice {
  border: 1px solid rgba(239, 171, 5, 0.32);
  background: rgba(239, 171, 5, 0.07);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text-2);
  font-size: 15.5px;
  margin: 26px 0 0;
}

.notice strong {
  color: var(--text);
}

/* ---------------------------------------------------------------- faq */

.faq {
  max-width: var(--measure);
}

.faq details {
  border-bottom: 1px solid var(--separator);
  padding: 16px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 400;
}

.faq details[open] summary::after {
  content: "–";
}

.faq p {
  color: var(--text-2);
  margin: 12px 0 0;
  font-size: 15.5px;
}

/* ---------------------------------------------------------------- legal */

.legal {
  padding: 56px 0 78px;
}

.legal .wrap {
  max-width: 780px;
}

.legal h1 {
  font-size: clamp(30px, 4vw, 40px);
}

.legal h2 {
  font-size: 22px;
  margin-top: 40px;
}

.legal h3 {
  font-size: 17px;
  margin-top: 26px;
}

.legal p,
.legal li {
  color: var(--text-2);
  font-size: 16.5px;
}

.legal strong {
  color: var(--text);
}

.legal code,
code {
  font-family: var(--font-num);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.legal ul,
.legal ol {
  padding-left: 22px;
}

.legal li {
  margin: 8px 0;
}

.table-scroll {
  overflow-x: auto;
  margin: 22px 0;
  -webkit-overflow-scrolling: touch;
}

.legal table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 15.5px;
}

.legal th,
.legal td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--separator);
  color: var(--text-2);
  vertical-align: top;
}

.legal th {
  color: var(--text);
  font-weight: 600;
}

.updated {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 6px;
}

.legal-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 26px 0 34px;
}

.legal-summary p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--separator);
  padding: 40px 0 56px;
  color: var(--muted);
  font-size: 15px;
}

.footer-cols {
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  margin-bottom: 32px;
}

.footer-cols h4 {
  color: var(--text);
  font-size: 14px;
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}

.footer-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-cols li {
  margin: 8px 0;
}

.footer-cols a {
  color: var(--text-2);
}

.footer-bottom {
  border-top: 1px solid var(--separator);
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
}
