/* Security (/security/): build/security.py. The hero, the buttons and the
   type scale live in /assets/site.css; the reveal is discover.js's, which
   adds `.is-visible` to [data-reveal] once it enters the viewport. Without
   JavaScript, or with reduced motion, everything is simply shown. Each
   chapter sets --c (its colour) and --c-ink (the shade for text). */

.security-page {
  overflow-x: clip;
}

.js .security-page [data-reveal] {
  opacity: 0;
  translate: 0 28px;
  transition:
    opacity 0.9s var(--ease-apple),
    translate 0.9s var(--ease-apple);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js .security-page [data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
}

/* The line icons trace themselves once, when they come into view. */
.js .security-page [data-reveal] svg .trace {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.js .security-page .is-visible svg .trace {
  animation: sec-trace 1.4s var(--ease-apple) forwards;
  animation-delay: calc(var(--i, 0) * 0.12s + 0.2s);
}

.sec-hero-mark svg .trace {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: sec-trace 1.6s var(--ease-apple) 0.3s forwards;
}

@keyframes sec-trace {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .security-page [data-reveal] {
    opacity: 1;
    translate: 0 0;
    transition: none;
  }

  .js .security-page [data-reveal] svg .trace,
  .sec-hero-mark svg .trace {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
  }
}

.sec-eyebrow {
  margin: 0 0 12px;
  color: var(--c-ink, var(--brand-ink));
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Hero -------------------------------------------------------------------- */

.sec-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sec-hero h1 {
  max-width: 16ch;
}

.sec-hero-mark {
  display: block;
  margin-bottom: 20px;
  color: var(--brand);
}

.sec-hero-mark svg {
  display: block;
  width: 56px;
  height: 56px;
  stroke-width: 1.2;
}

.sec-updated {
  margin: 20px 0 0;
  color: var(--ink-tertiary);
  font-size: var(--text-caption);
}

/* Four promises, side by side, separated by hairlines. -------------------- */

.sec-essentials {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.sec-essentials-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sec-essentials-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px 16px;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: balance;
}

.sec-essentials-list li + li {
  border-top: 1px solid var(--line);
}

.sec-essential-icon {
  color: var(--brand);
}

.sec-essential-icon svg {
  display: block;
  width: 40px;
  height: 40px;
  stroke-width: 1.3;
}

@media (min-width: 640px) {
  .sec-essentials-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .sec-essentials-list li + li {
    border-top: 0;
  }

  .sec-essentials-list li:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .sec-essentials-list li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (min-width: 960px) {
  .sec-essentials-list {
    grid-template-columns: repeat(4, 1fr);
  }

  .sec-essentials-list li:nth-child(n + 3) {
    border-top: 0;
  }

  .sec-essentials-list li + li {
    border-left: 1px solid var(--line);
  }
}

/* Chapters: the title, then its cards. On wide screens the title stays in
   view at the left while the cards scroll by. ----------------------------- */

.sec-chapter {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(88px, 12vw, 140px) 20px 0;
}

.sec-chapter-head h2,
.sec-control-head h2 {
  max-width: 18ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.sec-chapter-body {
  margin-top: 32px;
}

.sec-cards {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sec-card {
  padding: 26px 26px 28px;
  border-radius: 24px;
  background: var(--bg-alt);
}

.sec-icon {
  display: block;
  color: var(--c);
}

.sec-icon svg {
  display: block;
  width: 30px;
  height: 30px;
  stroke-width: 1.4;
}

.sec-card h3 {
  margin: 18px 0 6px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.sec-card p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 16px;
  line-height: 1.45;
  text-wrap: pretty;
}

.sec-card a {
  color: var(--brand-ink);
}

/* On phones the icon sits beside the text, so the cards stay short. */
@media (max-width: 639px) {
  .sec-card {
    display: grid;
    grid-template-columns: 28px 1fr;
    column-gap: 16px;
    padding: 20px;
  }

  .sec-icon svg {
    width: 28px;
    height: 28px;
  }

  .sec-card h3 {
    margin: 0 0 4px;
    font-size: 17px;
  }

  .sec-card p {
    font-size: 15px;
  }
}

@media (min-width: 640px) {
  .sec-chapter {
    padding-inline: 32px;
  }

  .sec-essentials {
    padding-inline: 32px;
  }

  .sec-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  /* An odd last card takes the whole row. */
  .sec-card-wide,
  .sec-cards-large-first > :first-child,
  .sec-cards:not(.sec-cards-large-first) > .sec-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

.sec-cards-large-first > :first-child h3 {
  font-size: clamp(22px, 3vw, 28px);
}

@media (min-width: 960px) {
  .sec-chapter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 48px;
    align-items: start;
  }

  .sec-chapter-head {
    position: sticky;
    top: calc(var(--header-h) + 40px);
  }

  .sec-chapter-body {
    margin-top: 0;
  }
}

/* The Bluetooth key: a dark card, the one thing that never leaves the
   iPhone. */
.sec-feature {
  display: grid;
  gap: 20px;
  margin-top: 16px;
  padding: 32px 28px;
  border-radius: 24px;
  background: var(--bg-alt);
  color: inherit;
}

.sec-feature-icon {
  display: block;
  color: var(--c);
}

.sec-feature-icon svg {
  display: block;
  width: 44px;
  height: 44px;
  stroke-width: 1.3;
}

.sec-feature .sec-eyebrow {
  margin-bottom: 6px;
  color: var(--c-ink);
}

.sec-feature h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.15rem + 0.6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.sec-feature p:last-child {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 16px;
  line-height: 1.5;
  text-wrap: pretty;
}

@media (min-width: 640px) {
  .sec-feature {
    grid-template-columns: auto 1fr;
    gap: 24px;
    padding: 36px;
  }
}

/* What is encrypted, and what is not: two columns, said plainly. */
.sec-split {
  margin-top: 16px;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--bg-card);
}

.sec-split h3 {
  margin: 0 0 20px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.sec-split-cols {
  display: grid;
  gap: 20px;
}

.sec-split-label {
  margin: 0 0 10px;
  color: var(--ink-tertiary);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sec-split-col ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sec-split-col li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.sec-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.sec-mark svg {
  width: 13px;
  height: 13px;
}

.sec-split-yes .sec-mark {
  background: var(--green);
  color: #fff;
}

.sec-split-no .sec-mark {
  background: var(--fill-strong);
  color: var(--ink-secondary);
}

.sec-split-note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}

@media (min-width: 640px) {
  .sec-split {
    padding: 32px 36px;
  }

  .sec-split-cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

/* Keeping control: four steps on a grey band. ----------------------------- */

.sec-control {
  margin-top: clamp(96px, 14vw, 160px);
  padding: clamp(64px, 9vw, 104px) 20px;
  background: var(--bg-alt);
}

.sec-control-head,
.sec-options {
  max-width: var(--container);
  margin-inline: auto;
}

.sec-control-head {
  text-align: center;
}

.sec-control-head h2 {
  max-width: none;
  margin-inline: auto;
}

.sec-control-head p:last-child {
  max-width: 46ch;
  margin: 14px auto 0;
  color: var(--ink-secondary);
  font-size: var(--text-lead);
  line-height: 1.4;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.sec-options {
  display: grid;
  gap: 16px;
  margin-top: 40px;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}

.sec-option {
  padding: 26px;
  border-radius: 24px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.sec-option-icon {
  display: block;
  color: var(--brand);
}

.sec-option-icon svg {
  display: block;
  width: 30px;
  height: 30px;
  stroke-width: 1.4;
}

/* Where it is done: the car, the Tesla account, the app. */
.sec-option-where {
  margin: 18px 0 2px;
  color: var(--brand-ink);
  font-size: 14px;
  font-weight: 600;
}

.sec-option h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.sec-option p:last-child {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}

@media (min-width: 640px) {
  .sec-control {
    padding-inline: 32px;
  }
}

@media (min-width: 760px) {
  .sec-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Closing: what we do not claim, then how to report a flaw. -------------- */

/* As wide as the chapters above: the texts keep their own measure. */
.sec-closing {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(88px, 12vw, 128px) 20px clamp(72px, 10vw, 112px);
  text-align: center;
}

@media (min-width: 640px) {
  .sec-closing {
    padding-inline: 32px;
  }
}

.sec-honest h2,
.sec-report h2 {
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.sec-honest p,
.sec-report p {
  max-width: 54ch;
  margin: 16px auto 0;
  color: var(--ink-secondary);
  font-size: var(--text-body);
  line-height: 1.55;
  text-wrap: pretty;
}

/* How we look for our own flaws: two cards, read like the chapters'. */
.sec-honest p {
  text-wrap: balance;
}

.sec-audits {
  --c: var(--brand);
  margin-top: 40px;
  text-align: start;
}

.sec-audits-last {
  margin: 20px 0 0;
  color: var(--ink-tertiary);
  font-size: var(--text-caption);
}

.sec-report {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(64px, 9vw, 96px);
  padding: 48px 24px 40px;
  overflow: hidden;
  border-radius: 28px;
  background: var(--bg-grouped);
}

.sec-report::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--wash);
  opacity: 0.7;
}

.sec-report-icon {
  display: block;
  margin-bottom: 16px;
  color: var(--brand);
}

.sec-report-icon svg {
  display: block;
  width: 40px;
  height: 40px;
  stroke-width: 1.3;
}

.sec-report .button {
  gap: 8px;
  margin-top: 28px;
}

.sec-report .sec-report-email {
  margin-top: 12px;
  color: var(--ink-tertiary);
  font-size: var(--text-caption);
}

