/* Driptone: privacy and support pages. One stylesheet, nothing loaded from elsewhere.
   The look is the app's "Native ripple" (docs/DESIGN-DIRECTION.md): system-like grouped surfaces,
   one water-teal accent, light and dark by prefers-color-scheme. The text is the system's face. */

:root {
  color-scheme: light dark;
  --paper: #f2f2f7;     /* page: grouped background */
  --surface: #ffffff;   /* cards */
  --ink: #000000;       /* text */
  --ink-2: #5e6168;     /* secondary text */
  --line: #d8d8dd;      /* hairlines */
  --accent: #066b94;    /* water teal */
  --measure: 42rem;
  --display: ui-rounded, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000000;
    --surface: #1c1c1e;
    --ink: #ffffff;
    --ink-2: #a1a4aa;
    --line: #38383a;
    --accent: #4cc2ea;
  }
}

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

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

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

:lang(ja) body,
body:lang(ja) {
  line-height: 1.8;
}

a {
  color: var(--accent);
  text-decoration-color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
}

a:hover {
  text-decoration-thickness: 2.5px;
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border-radius: 12px;
}

header.site,
nav.langs,
main,
footer.site {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Header */

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

nav.site ul,
nav.langs ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav.site li + li,
nav.langs li + li {
  margin-top: 0;
}

nav.site ul {
  gap: 0.25rem 1.25rem;
  font-size: 0.9375rem;
}

nav.site a,
nav.langs a {
  color: var(--ink);
  display: inline-block;
  padding: 0.375rem 0;
  text-decoration: none;
}

nav.site a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

/* The page you are on is the selected tab: teal, as in the app's tab bar. */
nav.site a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

/* Language switcher: on every page, under the header. */

nav.langs {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

nav.langs ul {
  gap: 0 1rem;
  font-size: 0.875rem;
}

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

nav.langs a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

nav.langs a[aria-current="true"] {
  color: var(--ink);
  font-weight: 600;
}

/* Text */

main {
  padding-top: 1.75rem;
  padding-bottom: 3rem;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  font-size: 2.5rem;
  margin: 0 0 0.375rem;
}

h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 0.5rem;
  scroll-margin-top: 1rem;
}

h3 {
  font-size: 1.125rem;
  margin: 1.5rem 0 0.25rem;
  scroll-margin-top: 1rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.3rem;
}

li > ul {
  margin: 0.3rem 0 0;
}

.meta {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

/* A small tracked label. */
.label {
  margin: 0 0 0.25rem;
  color: var(--ink-2);
  font-family: var(--display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* A control's name in the app. */
.ui {
  font-weight: 600;
}

/* Blocks */

.card {
  margin: 1.5rem 0;
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border-radius: 14px;
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.card h2 {
  font-size: 1.25rem;
}

.notice {
  margin: 1rem 0 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  font-size: 0.9375rem;
}

.toc {
  padding-left: 1.5rem;
  font-size: 0.9375rem;
  columns: 2 15rem;
  column-gap: 2rem;
}

.toc li {
  break-inside: avoid;
}

/* Tables */

.table-wrap {
  margin: 0 0 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  background: var(--surface);
}

th,
td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 600;
}

/* Footer */

footer.site {
  padding-top: 1rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.875rem;
}

footer.site p {
  margin: 0 0 0.375rem;
}

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

/* The home page: one screen. */

body.home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

body.home main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding-top: 1rem;
  padding-bottom: 1.5rem;
  text-align: center;
}

body.home nav.langs {
  width: 100%;
  padding-top: 1rem;
  border-bottom: 0;
}

body.home nav.langs ul {
  justify-content: center;
}

body.home footer.site {
  width: 100%;
  text-align: center;
}

.icon {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto 1rem;
  border-radius: 25px;
  box-shadow: 0 0 0 1px var(--line);
}

body.home h1 {
  font-size: 3.25rem;
  margin-bottom: 0.75rem;
}

.lede {
  max-width: 31rem;
  margin: 0 auto 1.75rem;
  font-size: 1.125rem;
}

.links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
  max-width: 26rem;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.links li + li {
  margin-top: 0;
}

.links a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 3.25rem;
  padding: 0.625rem 0.75rem;
  background: var(--surface);
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
}

.links a:hover {
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* Phones */

@media (max-width: 34rem) {
  body {
    font-size: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.3125rem;
  }

  body.home h1 {
    font-size: 2.625rem;
  }

  .icon {
    width: 96px;
    height: 96px;
    border-radius: 21px;
  }

  .links {
    grid-template-columns: 1fr;
  }

  /* Each table row becomes a small card with labelled cells. */
  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack td {
    display: block;
    width: 100%;
  }

  table.stack {
    background: none;
  }

  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  table.stack tr {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.875rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  table.stack td {
    padding: 0.25rem 0;
    border: 0;
  }

  table.stack td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-2);
  }

  table.stack td:first-child {
    font-weight: 600;
  }

  table.stack td:first-child::before {
    display: none;
  }
}

@media print {
  nav,
  .skip {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  a {
    color: #000;
  }
}
