/* Tide VPN website */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --tide: #3b84f7;      /* brand blue, from the app */
  --water: #2160d0;     /* deep enough for white text */
  --deep: #0f2b55;      /* ink */
  --link: #1f5fcf;
  --shallow: #e3edfc;
  --foam: #f5f8fc;
  --mist: #55667f;      /* secondary text */
  --line: #d6e1f1;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--deep);
  background: var(--foam);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--deep); }

:focus-visible { outline: 3px solid var(--tide); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 0.75rem; z-index: 20;
  background: var(--deep); color: #fff; padding: 0.5rem 1rem; border-radius: 8px;
}
.skip:focus { left: 0.75rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */

.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand { display: inline-flex; }
.brand img { height: 30px; width: auto; }

.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a { color: var(--deep); text-decoration: none; font-weight: 500; font-size: 0.975rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--link); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.4em; text-decoration-thickness: 2px; }

@media (max-width: 640px) {
  .nav { gap: 1.1rem; }
  .nav .nav-home { display: none; }
}

/* ---------- Store badge ---------- */

.store {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 0.6rem 1.35rem 0.65rem;
  border-radius: 14px;
  background: var(--deep); color: #fff;
  text-decoration: none; line-height: 1.15;
}
.store small { font-size: 0.75rem; font-weight: 500; opacity: 0.8; }
.store span { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.01em; }
a.store:hover { background: var(--water); color: #fff; }

/* ---------- Home: sky + hero ---------- */

body.home {
  background: linear-gradient(180deg, #d4e3fa 0, #e6eef9 480px, var(--foam) 880px) no-repeat, var(--foam);
}

.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 calc(116px + clamp(2.5rem, 5vw, 4rem));
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.9rem, 8vw, 6rem);
  font-weight: 720;
  line-height: 0.96;
  letter-spacing: -0.04em;
  font-variation-settings: "opsz" 96;
}
.hero h1 span { display: block; }
.hero .lede {
  max-width: 33rem; margin: 1.6rem auto 0;
  font-size: clamp(1.1rem, 1.8vw, 1.25rem); line-height: 1.5;
  color: var(--mist);
}
.cta-row {
  margin-top: 2.25rem;
  display: flex; flex-wrap: wrap; gap: 1rem 1.75rem;
  align-items: center; justify-content: center;
}
.cta-row .text-link { font-weight: 550; }

/* the tide line between sky and water */
.tideline { display: block; width: 100%; height: 80px; margin-top: -80px; position: relative; }

/* ---------- Home: tour of the home screen ---------- */

.tour {
  display: flow-root; /* keeps the phone's negative margin from collapsing into the section */
  background: var(--water);
  color: #fff;
  padding-bottom: clamp(4rem, 9vw, 7rem);
}
.tour-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  margin-top: -116px;
}

.phone {
  margin: 0;
  grid-column: 2;
  width: clamp(270px, 25vw, 300px);
  border: 10px solid var(--deep);
  border-radius: 46px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 40px 70px -30px rgba(9, 27, 56, 0.65);
}
.phone img { width: 100%; height: auto; }

.notes { list-style: none; margin: 0; padding: 0; position: relative; }
.notes-left { grid-column: 1; grid-row: 1; }
.notes-right { grid-column: 3; grid-row: 1; }

/* --y is the feature's vertical position on the screenshot (0–1); 10px is the frame */
.note {
  position: absolute; left: 0; right: 0;
  top: calc(var(--y) * (100% - 20px) + 10px);
  transform: translateY(-50%);
  display: flex; align-items: center;
}
.notes-left .note { justify-content: flex-end; text-align: right; }

.note-text { max-width: 16.5rem; }
.note h3 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; }
.note p { margin-top: 0.3rem; font-size: 0.975rem; line-height: 1.5; color: rgba(255, 255, 255, 0.88); }

.leader {
  flex: 0 0 clamp(2rem, 6vw, 5.5rem);
  height: 1px;
  background: rgba(255, 255, 255, 0.6);
  position: relative;
}
.notes-left .leader { margin-left: 1.25rem; transform-origin: right; }
.notes-right .leader { margin-right: 1.25rem; transform-origin: left; }
.leader::after {
  content: ""; position: absolute; top: -4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff;
}
.notes-left .leader::after { right: -4px; }
.notes-right .leader::after { left: -4px; }


@media (max-width: 900px) {
  .tour-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    margin-top: -80px;
  }
  .phone { grid-column: 1; grid-row: 1; }
  /* on small screens the four notes become one list, in the order of the screen (top to bottom) */
  .notes-left, .notes-right { display: contents; }
  .note {
    position: static; transform: none; display: block;
    grid-column: 1; grid-row: auto; order: var(--order);
    width: min(100%, 34rem); margin-top: 1.75rem;
  }
  .notes-left .note { text-align: left; }
  .note[style*="--order: 1"] { margin-top: 3rem; }
  .note-text { max-width: none; }
  .leader { display: none; }
}

/* one orchestrated moment: the phone rises with the tide, then the notes appear */
@media (prefers-reduced-motion: no-preference) {
  .phone { animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .leader { animation: draw 0.55s 0.75s cubic-bezier(0.3, 0.7, 0.3, 1) both; }
  .note-text { animation: appear 0.6s 0.95s ease-out both; }
}
@keyframes rise { from { transform: translateY(56px); } to { transform: none; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Home: steps ---------- */

.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0; }
.section h2 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 700; line-height: 1.05; letter-spacing: -0.03em;
  font-variation-settings: "opsz" 72;
}
.section-intro { margin-top: 1rem; max-width: 34rem; color: var(--mist); font-size: 1.125rem; }

.steps {
  list-style: none; margin: 3.25rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem;
  counter-reset: step;
}
.steps li { counter-increment: step; border-top: 2px solid var(--deep); padding-top: 1.25rem; }
.steps li::before {
  content: counter(step);
  display: block;
  font-size: 3.5rem; font-weight: 300; line-height: 1;
  font-variation-settings: "opsz" 96;
  color: var(--tide);
  margin-bottom: 1rem;
}
.steps h3 { font-size: 1.3rem; font-weight: 650; letter-spacing: -0.01em; }
.steps p { margin-top: 0.5rem; color: var(--mist); }
.steps-note { margin-top: 2.5rem; max-width: 40rem; color: var(--mist); font-size: 0.975rem; }

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---------- Home: FAQ ---------- */

.faq-section { background: #fff; }
.faq-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(2rem, 6vw, 6rem); }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  padding: 1.35rem 0;
  font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background:
    linear-gradient(var(--tide), var(--tide)) center / 14px 2px no-repeat,
    linear-gradient(var(--tide), var(--tide)) center / 2px 14px no-repeat;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--link); }
.faq .answer { padding: 0 2.5rem 1.5rem 0; color: var(--mist); max-width: 40rem; }
.faq .answer p + p { margin-top: 0.75rem; }

@media (max-width: 820px) {
  .faq-layout { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */

.site-footer { background: var(--deep); color: rgba(255, 255, 255, 0.78); padding: 3.5rem 0 2.5rem; font-size: 0.95rem; }
.site-footer a { color: #fff; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; align-items: flex-start; }
.footer-brand img { height: 28px; width: auto; }
.footer-brand p { margin-top: 0.9rem; max-width: 22rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-bottom {
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem;
  font-size: 0.85rem; color: rgba(255, 255, 255, 0.6);
}

/* ---------- Legal pages ---------- */

.legal-top { background: var(--shallow); }
.legal-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 0; }
.legal-head h1 {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 720; line-height: 1; letter-spacing: -0.035em;
  font-variation-settings: "opsz" 96;
}
.legal-head .updated { margin-top: 1rem; color: var(--mist); }
.legal-top .tideline { margin-top: 2.5rem; height: 48px; }

.legal { padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(4rem, 8vw, 6rem); }
.legal-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); }

.toc { position: sticky; top: 1.5rem; align-self: start; font-size: 0.925rem; }
.toc h2 { font-size: 0.925rem; font-weight: 650; margin-bottom: 0.75rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a {
  display: block; padding: 0.3rem 0 0.3rem 1rem; margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--mist); text-decoration: none; line-height: 1.35;
}
.toc li a:hover { color: var(--deep); border-left-color: var(--tide); }

.prose { max-width: 42rem; }
.prose section { scroll-margin-top: 1.5rem; }
.prose section + section { margin-top: 2.75rem; }
.prose h2 {
  font-size: 1.5rem; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25;
  margin-bottom: 0.9rem;
}
.prose h2 .num { color: var(--tide); font-weight: 500; margin-right: 0.35rem; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 0.9rem; }
.prose ul { margin: 0.9rem 0 0; padding-left: 1.25rem; }
.prose li + li { margin-top: 0.4rem; }
.prose li::marker { color: var(--tide); }

.legal-related {
  margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  color: var(--mist);
}

@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
}
