/* Capit marketing site */

@font-face {
  font-family: "Fustat";
  src: url("assets/fonts/Fustat.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Brand colours, taken from the app's asset catalog */
  --ink: #1a3745;          /* LogoBlue */
  --ink-deep: #11262f;
  --ink-soft: #2a4d5e;
  --accent: #f88f58;       /* AccentColor */
  --accent-text: #a8481a;  /* accent, darkened for text on light surfaces */

  --paper: #f2f5f5;
  --surface: #ffffff;
  --text: #1a3745;
  --muted: #536d78;
  --line: rgba(26, 55, 69, 0.14);

  --on-ink: #ffffff;
  --on-ink-muted: #b4c6ce;
  --on-ink-line: rgba(255, 255, 255, 0.16);

  --font-sans: "Fustat", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --measure: 1120px;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

.site-header {
  background: var(--ink);
  color: var(--on-ink);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #fff;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
  margin-left: auto;
  font-size: 0.975rem;
  font-weight: 500;
}

.site-nav a {
  text-decoration: none;
  color: var(--on-ink-muted);
}

.site-nav a:hover {
  color: var(--on-ink);
}

.site-nav .nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink-deep);
  font-weight: 700;
}

.site-nav .nav-cta:hover {
  background: #ffa474;
  color: var(--ink-deep);
}

@media (max-width: 560px) {
  .site-nav a:not(.nav-cta) {
    display: none;
  }
}

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

.hero {
  background: var(--ink);
  color: var(--on-ink);
  padding-block: clamp(32px, 6vw, 72px) clamp(56px, 8vw, 104px);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 4rem);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.035em;
}

.hero h1 span {
  display: block;
}

.hero h1 .out {
  color: var(--accent);
}

.hero .lede {
  margin-top: 24px;
  max-width: 34ch;
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  line-height: 1.45;
  color: var(--on-ink-muted);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 32px;
}

.store-badge {
  display: inline-block;
  border-radius: 10px;
}

.store-badge img {
  height: 54px;
  width: auto;
}

.hero-note {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--on-ink-muted);
}

.hero-note strong {
  display: block;
  color: var(--on-ink);
  font-weight: 600;
}

/* Tone demo */

.demo {
  width: 100%;
  max-width: 440px;
  justify-self: end;
}

.demo-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-ink-muted);
}

.tones {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tones button {
  appearance: none;
  border: 1px solid var(--on-ink-line);
  background: transparent;
  color: var(--on-ink-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  padding: 9px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.tones button:hover {
  color: var(--on-ink);
  border-color: rgba(255, 255, 255, 0.4);
}

.tones button[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink-deep);
}

.post {
  margin-top: 16px;
  background: var(--surface);
  color: var(--text);
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.55);
}

.post-photo {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: #dfe6e8;
}

.post-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.post-photo img.is-current {
  opacity: 1;
}

.post-caption {
  position: relative;
  min-height: 7.6em;
  padding: 16px 10px 12px;
  font-size: 1.02rem;
  line-height: 1.45;
}

.post-caption .tag {
  color: var(--accent-text);
  font-weight: 600;
}

/* The three caption lines from the app icon, shown while a caption is "written" */
.post-lines {
  position: absolute;
  inset: 20px 10px auto;
  display: grid;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.post-lines i {
  display: block;
  height: 11px;
  border-radius: 999px;
  background: var(--accent);
}

.post-lines i:nth-child(2) {
  width: 92%;
}

.post-lines i:nth-child(3) {
  width: 58%;
}

.post.is-writing .post-lines {
  opacity: 1;
}

.post.is-writing .post-text {
  visibility: hidden;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 6px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo {
    justify-self: start;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(64px, 9vw, 120px);
}

.section-head {
  max-width: 40rem;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.section-head h2 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 800;
}

.section-head p {
  margin-top: 16px;
  font-size: 1.15rem;
  color: var(--muted);
}

/* Phone frame around real app screenshots */

.phone {
  width: 100%;
  max-width: 290px;
  padding: 7px;
  border-radius: 44px;
  background: var(--ink-deep);
  box-shadow: 0 30px 50px -30px rgba(17, 38, 47, 0.55);
}

.phone img {
  width: 100%;
  border-radius: 37px;
}

/* How it works */

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
}

.steps li {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 28px;
  justify-items: start;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-text);
}

.steps h3 {
  margin-top: 6px;
  font-size: 1.45rem;
  font-weight: 700;
}

.steps p {
  margin-top: 10px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
  }

  .steps li {
    grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 20px;
    align-items: center;
  }

  .steps .phone {
    padding: 4px;
    border-radius: 24px;
  }

  .steps .phone img {
    border-radius: 20px;
  }
}

/* Features */

.features {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 96px);
  align-items: center;
}

.feature + .feature {
  margin-top: clamp(64px, 9vw, 120px);
}

.feature .phone {
  justify-self: center;
}

.feature:nth-of-type(even) .phone {
  order: 2;
}

.feature-kicker {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-text);
}

.feature h3 {
  margin-top: 10px;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 800;
}

.feature p {
  margin-top: 16px;
  max-width: 44ch;
  font-size: 1.1rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .feature {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature .phone,
  .feature:nth-of-type(even) .phone {
    order: 0;
    justify-self: start;
    max-width: 240px;
  }
}

.more {
  margin-top: clamp(64px, 9vw, 112px);
  padding-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--line);
}

.more h3 {
  font-size: 1.45rem;
  font-weight: 700;
}

.more dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px clamp(24px, 4vw, 56px);
  margin-top: 28px;
}

.more dt {
  font-weight: 700;
}

.more dd {
  margin-top: 4px;
  color: var(--muted);
  font-size: 1rem;
}

@media (max-width: 820px) {
  .more dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .more dl {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* FAQ */

.faq-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 6vw, 88px);
  align-items: start;
}

.faq-layout .section-head {
  margin-bottom: 0;
}

.faq-list details {
  border-top: 1px solid var(--line);
}

.faq-list details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 2px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

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

.faq-list summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--accent-text);
  transition: transform 0.2s;
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
}

.faq-list .answer {
  padding: 0 2px 22px;
  max-width: 60ch;
  color: var(--muted);
}

.faq-list .answer a,
.support a.mail,
.legal a {
  color: var(--accent-text);
  font-weight: 600;
  text-underline-offset: 3px;
}

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

/* Support */

.support {
  padding-top: 0;
}

.support-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 48px;
  align-items: center;
  padding: clamp(28px, 4vw, 48px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.support-card h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
}

.support-card p {
  margin-top: 10px;
  max-width: 52ch;
  color: var(--muted);
}

.support a.mail {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .support-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Closing call to action */

.closing {
  background: var(--ink);
  color: var(--on-ink);
  padding-block: clamp(56px, 8vw, 96px);
}

.closing .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 28px 48px;
}

.closing h2 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 800;
  max-width: 16ch;
}

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

.site-footer {
  background: var(--ink-deep);
  color: var(--on-ink-muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding-block: 28px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--on-ink);
  text-decoration: underline;
}

/* ---------- Privacy and terms ---------- */

/* #privacy and #terms each read as their own page: when one is the link
   target it is shown and the marketing content is hidden. */

.legal {
  display: none;
  padding-block: clamp(40px, 6vw, 80px) clamp(56px, 8vw, 104px);
}

.legal:target,
html[data-view="privacy"] #privacy,
html[data-view="terms"] #terms {
  display: block;
}

body:has(.legal:target) .marketing,
html[data-view="privacy"] .marketing,
html[data-view="terms"] .marketing {
  display: none;
}

.legal .wrap {
  max-width: calc(44rem + var(--gutter) * 2);
}

.legal .back {
  display: inline-block;
  margin-bottom: 28px;
  font-size: 0.95rem;
  text-decoration: none;
}

.legal h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 28px;
}

.legal h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 12px;
}

.legal p,
.legal ul {
  margin-bottom: 16px;
  text-wrap: wrap;
}

.legal ul {
  padding-left: 1.25em;
}

.legal li + li {
  margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
