/* Legal & support pages for my iPhone apps
   Static CSS. No frameworks, no build step.
   Palette is taken from the BookBloom icon: warm paper + terracotta. */

:root {
  --bg:          #ffffff;
  --bg-tint:     #f6f4ef;
  --surface:     #ffffff;
  --text:        #1c1c1e;
  --muted:       #6b6b72;
  --accent:      #c1462a;
  --accent-ink:  #a4381f;
  --accent-soft: #fbeee8;
  --link:        #0a63c9;
  --link-ink:    #06489a;
  --rule:        #e6e2da;
  --rule-soft:   #efece5;
  --shadow:      0 1px 2px rgba(48, 34, 22, .05), 0 8px 24px -12px rgba(48, 34, 22, .18);
  --shadow-lift: 0 2px 4px rgba(48, 34, 22, .06), 0 16px 32px -14px rgba(48, 34, 22, .26);

  /* Apple's New York, with graceful fallbacks off-platform */
  --serif: "New York", "Iowan Old Style", Palatino, "Palatino Linotype",
           Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #111113;
    --bg-tint:     #1a1a1d;
    --surface:     #1a1a1d;
    --text:        #e8e8e6;
    --muted:       #9a9aa0;
    --accent:      #f08a63;
    --accent-ink:  #f7a482;
    --accent-soft: #2a1e19;
    --link:        #6cb2ff;
    --link-ink:    #93c8ff;
    --rule:        #2c2c30;
    --rule-soft:   #262629;
    --shadow:      0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .45), 0 16px 32px -14px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Set on html as well as body so the browser canvas is painted even where
     the body box does not reach — overscroll areas, notches, short pages. */
  background: var(--bg);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.68;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.25rem 20px 4rem;
}

@media (min-width: 480px) {
  .page { padding: 3rem 28px 5rem; }
}

/* ---------- Site header ---------- */

.site-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 2.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  padding: 0.25rem;
  margin: -0.25rem;
  transition: opacity .18s ease;
}

.brand:hover { opacity: .72; }

/* The icon PNG carries its own squircle mask, so the shadow has to follow the
   alpha channel — a box-shadow would draw a square halo around it. */
.brand-icon {
  width: 46px;
  height: 46px;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(48, 34, 22, .12))
          drop-shadow(0 6px 12px rgba(48, 34, 22, .16));
}

@media (prefers-color-scheme: dark) {
  .brand-icon {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5))
            drop-shadow(0 6px 12px rgba(0, 0, 0, .55));
  }
}

/* Sized so the cap height fills the icon square — the two read as one lockup.
   line-height: 1 stops the text box from adding slack above and below. */
.brand-name {
  font-family: var(--serif);
  font-size: 1.95rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* ---------- Typography ---------- */

h1 {
  font-size: 1.7rem;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

h2 {
  font-size: 1.12rem;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.008em;
  margin: 3rem 0 0.85rem;
  scroll-margin-top: 1.5rem;
  text-wrap: balance;
}

h2:target {
  /* Subtle marker when someone deep-links to a section */
  border-left: 3px solid var(--accent);
  padding-left: 0.6rem;
  margin-left: -0.85rem;
}

p { margin: 0 0 1.1rem; }

ul {
  margin: 0 0 1.1rem;
  padding-left: 1.1rem;
  list-style: none;
}

ul li { position: relative; }

ul li::before {
  content: "";
  position: absolute;
  left: -0.95rem;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}

ol { margin: 0 0 1.1rem; padding-left: 1.35rem; }

li { margin-bottom: 0.5rem; }

strong { font-weight: 650; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .15s ease, text-decoration-color .15s ease;
}

a:hover {
  color: var(--link-ink);
  text-decoration-color: currentColor;
}

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

.dates {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: -0.35rem 0 1.85rem;
}

.dates strong { font-weight: 600; color: var(--text); }

.lead {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 2rem;
  text-wrap: pretty;
}

/* ---------- Section 4 table (Privacy Policy) ---------- */

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin: 0 0 1.1rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 0.94rem;
  line-height: 1.55;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--rule-soft);
}

th {
  font-weight: 650;
  background: var(--bg-tint);
  white-space: nowrap;
}

thead th { border-bottom-color: var(--rule); }

tbody tr:last-child th,
tbody tr:last-child td { border-bottom: 0; }

td a { word-break: break-word; }

/* Keep the horizontal scrollbar visible on the table so it reads as scrollable */
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 4px;
}

/* ---------- Support page ---------- */

/* No card here either — the address carries itself on a bare page, so it gets
   a touch more size and room instead of a border */
.contact-box {
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 3.25rem;
}

.contact-box p:last-child { margin-bottom: 0; }

/* The FAQ heading was reading as just another question — give it clear size
   and weight above them. Scoped by id so the numbered headings in the policy
   pages keep the standard h2 size. */
h2#faq {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.4rem;
}

/* A hairline-separated list, so the FAQ reads as one continuous run of
   questions rather than a dozen floating boxes */
details {
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 1.5rem;
}

details:first-of-type { border-top: 1px solid var(--rule); }

summary {
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  padding: 1rem 2rem 1rem 0;
  position: relative;
  transition: color .15s ease;
}

summary::-webkit-details-marker { display: none; }

summary:hover { color: var(--muted); }

/* Chevron, drawn with two borders so there is no icon file to load */
summary::after {
  content: "";
  position: absolute;
  right: 0.4rem;
  top: 1.5rem;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform .2s ease, border-color .2s ease;
}

details[open] summary::after {
  transform: rotate(-135deg);
  border-color: var(--text);
}

details > p {
  margin: 0 0 1.15rem;
  padding-right: 2rem;
  color: var(--muted);
}

details > p:first-of-type { margin-top: -0.2rem; }

/* ---------- Index page ---------- */

/* Icon on its own line, then title, then description */
.app {
  margin-top: 2.75rem;
}

/* A hairline only ever appears between apps, never around a single one */
.app + .app {
  border-top: 1px solid var(--rule);
  padding-top: 2.75rem;
}

.app-icon {
  width: 60px;
  height: 60px;
  display: block;
  margin-bottom: 1rem;
  filter: drop-shadow(0 1px 1px rgba(48, 34, 22, .12))
          drop-shadow(0 8px 16px rgba(48, 34, 22, .18));
}

@media (prefers-color-scheme: dark) {
  .app-icon {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5))
            drop-shadow(0 8px 16px rgba(0, 0, 0, .6));
  }
}

.app h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 0.45rem;
}

.app p {
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 1.15rem;
}

/* Plain text links with a dot between them, rather than buttons — these are
   documents to read, not actions to take. */
.doc-links {
  font-size: 0.96rem;
  line-height: 2;
  margin-bottom: 0;
}

.doc-links a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  white-space: nowrap;
}

.doc-links a:hover {
  color: var(--link-ink);
  text-decoration-color: currentColor;
}

/* inline-block keeps the separator out of the link's underline, and
   pointer-events lets a click on the dot fall through instead of opening it */
.doc-links a:not(:last-child)::after {
  content: "•";
  display: inline-block;
  pointer-events: none;
  margin: 0 0.15rem 0 0.55rem;
  color: var(--muted);
  opacity: .55;
}

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

footer {
  margin-top: 4rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.92rem;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
}

footer nav a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

footer nav a:hover {
  color: var(--link);
  border-bottom-color: color-mix(in srgb, var(--link) 45%, transparent);
}

footer .colophon { margin: 1rem 0 0; opacity: .8; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}
