/* MyPets website. One stylesheet for every page. Colours match the app (docs/design/REFRESH.md). */

@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito_400Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito_700Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito_900Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f2f4f8;
  --card: #ffffff;
  --text: #0b1220;
  --text-2: #4a5466;
  --primary: #0b63ce;
  --on-primary: #ffffff;
  --primary-soft: #e3eefc;
  --line: #e2e6ee;
  --focus: #0b63ce;
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.06), 0 6px 20px rgba(11, 18, 32, 0.05);
  --radius-md: 14px;
  --radius-lg: 16px;
  --radius-xl: 18px;
  --gutter: 20px;
  --max: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0c10;
    --card: #14171e;
    --text: #eef1f6;
    --text-2: #a9b2c1;
    --primary: #6cb0ff;
    --on-primary: #0b1220;
    --primary-soft: #1a2638;
    --line: #262b35;
    --focus: #6cb0ff;
    --shadow: none;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem; /* 17px */
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--card);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  z-index: 10;
  font-weight: 700;
}
.skip-link:focus {
  top: 12px;
}

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

/* Header */
.site-header {
  padding: 18px 0;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  font-size: 1.25rem;
  min-height: 44px;
}
.brand img {
  width: 36px;
  height: 36px;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.site-nav li + li {
  margin-top: 0;
}
@media (max-width: 479px) {
  .site-nav ul {
    margin-left: -12px;
  }
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.site-nav a:hover {
  background: var(--card);
}
.site-nav a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--text);
}

/* Main */
main {
  padding: 8px 0 48px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}
h1 {
  font-weight: 900;
  font-size: clamp(1.875rem, 1.4rem + 2.2vw, 2.5rem);
  letter-spacing: -0.01em;
}
h2 {
  font-weight: 900;
  font-size: 1.375rem;
  margin-top: 2.2rem;
  margin-bottom: 0.6rem;
}
h3 {
  font-weight: 700;
  font-size: 1.125rem;
  margin-top: 1.4rem;
  margin-bottom: 0.4rem;
}
p,
ul,
ol {
  margin: 0 0 1rem;
}
li + li {
  margin-top: 0.35rem;
}
.lede {
  font-size: 1.1875rem;
  color: var(--text-2);
}
.meta {
  color: var(--text-2);
  font-size: 1rem;
  margin-top: 0.5rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* Long documents (privacy, terms, support) */
.doc {
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 28px var(--gutter) 32px;
}
@media (min-width: 640px) {
  .doc {
    padding: 40px 44px 44px;
  }
}
.doc > h1 {
  margin-bottom: 0.4rem;
}
.doc h2:first-of-type {
  margin-top: 1.8rem;
}
.toc {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 1.6rem 0 0.4rem;
}
.toc h2 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}
.toc ol {
  margin: 0;
  padding-left: 1.3rem;
}
.toc li + li {
  margin-top: 0.15rem;
}

/* Tables become stacked cards on narrow screens */
.table-wrap {
  margin: 0 0 1.2rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
}
th {
  font-weight: 700;
}
thead th {
  border-bottom: 2px solid var(--line);
}
@media (max-width: 639px) {
  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  tr {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 6px 14px;
    margin-bottom: 12px;
  }
  th,
  td {
    border: 0;
    padding: 6px 0;
  }
  td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-2);
  }
}

/* Landing page */
.hero {
  text-align: center;
  padding: 24px 0 8px;
}
.hero .app-icon {
  width: 96px;
  height: 96px;
  display: block;
  margin: 0 auto 18px;
}
.hero h1 {
  margin-bottom: 0.6rem;
}
.hero .lede {
  max-width: 36rem;
  margin: 0 auto 1.4rem;
}
.badge-slot {
  display: inline-block;
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-weight: 700;
}
.features {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .features {
    grid-template-columns: 1fr 1fr;
  }
}
.features li {
  margin: 0;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.features h2 {
  font-size: 1.0625rem;
  font-weight: 900;
  margin: 0 0 0.2rem;
}
.features p {
  margin: 0;
  color: var(--text-2);
  font-size: 1rem;
}
.note {
  color: var(--text-2);
  font-size: 1rem;
  text-align: center;
  margin-top: 28px;
}

/* Support FAQ */
details {
  border-bottom: 1px solid var(--line);
}
details:first-of-type {
  border-top: 1px solid var(--line);
}
summary {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 0;
  min-height: 44px;
  list-style-position: outside;
}
details[open] summary {
  padding-bottom: 6px;
}
details > :not(summary) {
  margin-top: 0;
}
details > :last-child {
  padding-bottom: 14px;
  margin-bottom: 0;
}
.contact-card {
  background: var(--primary-soft);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin: 1.6rem 0 0.4rem;
}
.doc .contact-card h2 {
  margin: 0 0 0.4rem;
}
.contact-card p:last-child {
  margin-bottom: 0;
}
.contact-card .email {
  font-weight: 900;
  font-size: 1.1875rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--text-2);
  font-size: 0.9375rem;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.site-footer li + li {
  margin-top: 0;
}
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
}
.site-footer p {
  margin: 0 0 6px;
}
address {
  font-style: normal;
}

@media print {
  .site-header nav,
  .skip-link,
  .site-footer ul {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
  .doc {
    box-shadow: none;
    padding: 0;
  }
}
