@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light dark;
  --page: #f0ede6;
  --paper: #fdfbf7;
  --paper-soft: #f5f2eb;
  --ink: #181714;
  --muted: #6b6560;
  --line: #ddd8ce;
  --accent: #0c6b63;
  --accent-strong: #09534c;
  --accent-soft: #d6ebe7;
  --rose: #9f3a4a;
  --shadow-sm: 0 1px 4px rgba(46, 39, 29, 0.06), 0 2px 8px rgba(46, 39, 29, 0.05);
  --shadow-md: 0 4px 16px rgba(46, 39, 29, 0.08), 0 8px 32px rgba(46, 39, 29, 0.06);
  --shadow-lg: 0 12px 40px rgba(46, 39, 29, 0.1), 0 24px 72px rgba(46, 39, 29, 0.08);
  --radius: 14px;
  --font-body: Charter, "Bitstream Charter", "Sitka Text", Cambria, serif;
  --font-ui: 'Inter', 'Avenir Next', 'Avenir', 'Segoe UI', sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #141210;
  --paper: #1e1c18;
  --paper-soft: #191714;
  --ink: #f0ead8;
  --muted: #b0a89a;
  --line: #363028;
  --accent: #6dc4b2;
  --accent-strong: #90d4c6;
  --accent-soft: #112e29;
  --rose: #de8d9b;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.38), 0 24px 72px rgba(0, 0, 0, 0.32);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #141210;
    --paper: #1e1c18;
    --paper-soft: #191714;
    --ink: #f0ead8;
    --muted: #b0a89a;
    --line: #363028;
    --accent: #6dc4b2;
    --accent-strong: #90d4c6;
    --accent-soft: #112e29;
    --rose: #de8d9b;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.38), 0 24px 72px rgba(0, 0, 0, 0.32);
  }
}

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

html {
  min-height: 100%;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--page);
  background-image:
    radial-gradient(ellipse 80% 55% at 0% 0%, rgba(12, 107, 99, 0.13) 0%, transparent 58%),
    radial-gradient(ellipse 60% 45% at 100% 100%, rgba(159, 58, 74, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse 45% 65% at 88% 12%, rgba(12, 107, 99, 0.07) 0%, transparent 52%);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
}

:root[data-theme="dark"] body,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    background-image:
      radial-gradient(ellipse 80% 55% at 0% 0%, rgba(109, 196, 178, 0.07) 0%, transparent 58%),
      radial-gradient(ellipse 60% 45% at 100% 100%, rgba(222, 141, 155, 0.06) 0%, transparent 55%),
      radial-gradient(ellipse 45% 65% at 88% 12%, rgba(109, 196, 178, 0.04) 0%, transparent 52%);
  }
}

:root[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse 80% 55% at 0% 0%, rgba(109, 196, 178, 0.07) 0%, transparent 58%),
    radial-gradient(ellipse 60% 45% at 100% 100%, rgba(222, 141, 155, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 45% 65% at 88% 12%, rgba(109, 196, 178, 0.04) 0%, transparent 52%);
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--rose);
}

code {
  font-family: ui-monospace, "SF Mono", "Fira Code", Menlo, monospace;
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  color: var(--ink);
}

/* ── Layout ─────────────────────────────────────────────── */

.page {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 52px 24px 64px;
}

/* ── Site header ─────────────────────────────────────────── */

.site-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  padding-bottom: 36px;
}

/* ── Typography ──────────────────────────────────────────── */

.back-link,
.eyebrow,
.meta-label,
.summary-label,
.theme-control button,
.app-card-link,
.app-store-link,
.contact-row {
  font-family: var(--font-ui);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.15s ease;
}

.back-link::before {
  content: "←";
  font-size: 1em;
  line-height: 1;
}

.back-link:hover {
  color: var(--accent-strong);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 16px;
  font-family: var(--font-ui);
  font-size: clamp(2.2rem, 5.5vw, 4.4rem);
  font-weight: 700;
  line-height: 0.97;
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 10px;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h3 {
  margin-bottom: 6px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

/* ── Theme switcher ──────────────────────────────────────── */

.theme-control {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  border: 1.5px solid var(--line);
  border-radius: 100px;
  background: color-mix(in srgb, var(--paper-soft) 85%, transparent);
  backdrop-filter: blur(8px);
}

.theme-control button {
  min-width: 64px;
  border: 0;
  border-radius: 100px;
  padding: 6px 14px;
  color: var(--muted);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.theme-control button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.theme-control button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Surface / card shell ────────────────────────────────── */

.surface {
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 97%, transparent);
  box-shadow: var(--shadow-lg);
}

/* ── Home — directory grid ───────────────────────────────── */

.directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.app-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
  padding: 28px 28px 24px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
  box-shadow: var(--shadow-md);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: inherit;
}

.app-card img,
.app-card-icon-link img,
.policy-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(32, 32, 29, 0.15), 0 2px 6px rgba(32, 32, 29, 0.1);
  flex-shrink: 0;
}

.app-card-icon-link {
  display: block;
  line-height: 0;
  border-radius: 20px;
  flex-shrink: 0;
}

.app-card-icon-link:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.app-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
}

.app-card-actions .app-store-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 100px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.app-card-actions .app-store-link:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.app-card h2 {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.app-card p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.app-card-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 100px;
  color: var(--accent-strong);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  background: transparent;
  transition: gap 0.15s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.app-card-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.app-card-link .arrow {
  transition: transform 0.15s ease;
}

.app-card-link:hover .arrow {
  transform: translateX(3px);
}

.app-card:hover .app-card-link {
  color: var(--accent-strong);
}

/* ── Home — contact row ──────────────────────────────────── */

.contact-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.88rem;
}

.contact-row a {
  color: var(--muted);
  font-weight: 500;
}

.contact-row a:hover {
  color: var(--accent-strong);
}

/* ── Policy page — hero ──────────────────────────────────── */

.policy-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  padding-bottom: 32px;
}

.policy-hero > a {
  display: block;
  line-height: 0;
  border-radius: 20px;
  flex-shrink: 0;
}

.policy-hero > a:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.policy-card {
  margin-top: 4px;
}

/* ── Policy page — summary strip ────────────────────────── */

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1.5px solid var(--line);
  background: color-mix(in srgb, var(--paper-soft) 90%, transparent);
}

.summary-item {
  padding: 18px 24px;
  border-right: 1.5px solid var(--line);
}

.summary-item:last-child {
  border-right: 0;
}

.summary-label {
  display: block;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.summary-value {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.summary-value::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.75;
}

/* ── Policy page — body ──────────────────────────────────── */

.policy-content {
  padding: 36px 40px 40px;
}

.notice {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 28px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.005em;
}

section {
  margin-top: 0;
  padding-top: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

section:first-of-type {
  padding-top: 12px;
}

section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

ul {
  margin: 10px 0 0;
  padding-left: 1.2rem;
}

li {
  margin-bottom: 8px;
  padding-left: 4px;
}

/* ── Footer ──────────────────────────────────────────────── */

.footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-align: center;
}

.site-footer {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 400;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .page {
    padding: 28px 16px 48px;
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .policy-hero {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
  }

  .theme-control {
    width: 100%;
  }

  .theme-control button {
    min-width: 0;
  }

  .directory-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 24px;
  }

  .app-card {
    padding: 20px;
  }

  .app-card img,
  .app-card-icon-link img {
    width: 76px;
    height: 76px;
  }

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

  .summary-item {
    border-right: 0;
    border-bottom: 1.5px solid var(--line);
  }

  .summary-item:last-child {
    border-bottom: 0;
  }

  .policy-content {
    padding: 24px 20px 28px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
