/* =========================
   Theme (default: DARK)
   ========================= */
:root {
  /* Core */
  --bg: #0f1210;
  --card: #181d19;
  --text: #faf7f2;
  --muted: #c9c3b8;
  --accent: #c66a3f;

  /* Surfaces & controls */
  --btn: #2a2f2b;
  --btn-hover: #333833;
  --chip: #2a2f2b;
  --chip-hover: #333833;

  /* Lines & shadows */
  --border: rgba(250, 247, 242, .10);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f5f1;           /* warm parchment */
    --card: #ffffff;         /* clean card */
    --text: #2b2a28;         /* deep charcoal */
    --muted: #6e6a63;        /* soft taupe */
    --accent: #c66a3f;       /* terracotta */

    --btn: #efeae3;          /* pale clay for buttons */
    --btn-hover: #e8e2da;    /* subtle hover */
    --chip: #efeae3;
    --chip-hover: #e8e2da;

    --border: rgba(43, 42, 40, .12);
    --shadow: 0 6px 20px rgba(0, 0, 0, .08);
  }
}

/* Reduce motion comfort */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =========================
   Base
   ========================= */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Lithos, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  position: relative; /* for ::before fixed background layer */
}

/* Fixed background layer (works on iOS Safari) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url('/images/sandtex.jpg');
  background-position: 0 0;
  /* Force a smaller, tiling repeat size so it doesn't look like one huge image */
  background-size: 512px 512px;
  background-repeat: repeat;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
  transform: translateZ(0);
}


.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px;
}

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

/* =========================
   Brand
   ========================= */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 12px;
}

.brand img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
}

h1 { font-size: 1.4rem; margin: 0; font-weight: 700; letter-spacing: .04em; }
p.muted { color: var(--muted); margin: .25rem 0 1rem; }

/* =========================
   Links (primary stack)
   ========================= */
.links {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 14px 16px;
  border-radius: 14px;
  text-decoration: none;
  background: var(--btn);
  color: var(--text);
  border: 1px solid var(--border);
  transition: transform .2s, background .2s;
  will-change: transform;
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--btn-hover);
}

/* Accessible focus rings */
.btn:focus-visible,
.toc a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn.accent {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--border);
}

/* =========================
   Socials
   ========================= */
.socials {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.socials a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--chip);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 1.2rem;
  text-decoration: none;
  transition: transform .2s, background .2s;
  border: 1px solid var(--border);
}

.socials a:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

/* =========================
   Footer + inline links
   ========================= */
.footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

.footer a,
.policy a:not(.btn) {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover,
.policy a:not(.btn):hover { text-decoration: underline; }

/* =========================
   Privacy page
   ========================= */
.actions { display: grid; gap: 12px; margin-top: 12px; }

.toc {
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0 18px;
}

.toc-title { display:block; margin-bottom:6px; }
.toc a {
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
.toc a:hover { background: var(--chip-hover); }

.policy, .policy p, .policy li { line-height: 1.6; }
.policy h2 { font-size: 1.25rem; margin: 1rem 0 .6rem; color: var(--text); font-family: Optima, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; font-weight: 700; scroll-margin-top: 16px; }
.policy h3 { font-size: 1rem; margin: 1rem 0 .4rem; color: var(--text); }
.policy ul { margin: .4rem 0 .8rem 1.1rem; padding: 0; }
.policy li { margin: .25rem 0; }
.policy p { margin-top: 0; }
/* Space between sections rather than paragraphs */
.policy { margin-bottom: 2.5rem; }

/* Typography: use Optima for all content after each section heading */
.policy h2 ~ * {
  font-family: Optima, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

/* =========================
   Accordion (Contact)
   ========================= */
/* Container acts like a button block */
.btn.btn-accordion {
  display: block;
  padding: 0;
  position: relative;
  overflow: hidden;
}

/* Header uses a 1fr | auto | 1fr grid to center the label */
/* FIX: keep header within the container bounds */
.btn-accordion-header{
  all: unset;
  box-sizing: border-box;        /* ← the key fix */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  width: 100%;
  padding: 14px 16px;
  cursor: pointer;
  text-align: center;
  color: inherit;
}

/* Optional: reserve space for the icon even before FA loads */
.btn-accordion-header .arrow{
  grid-column: 3;
  justify-self: end;
  display: inline-block;
  inline-size: 1.1em;            /* keeps the middle truly centered pre/post icon */
  transition: transform .2s ease;
  color: inherit;
}


.btn-accordion-header .label { grid-column: 2; }
/* arrow styles defined above; keep single source */

.btn-accordion.open .btn-accordion-header .arrow{ transform: rotate(180deg); }

/* Closed state: no vertical padding → same height as other buttons */
.btn-accordion-body{
  display: grid;
  gap: 12px;
  overflow: hidden;
  max-height: 0;
  padding: 0 8px;          /* ← 0 top/bottom so closed height matches */
  opacity: 0;
  transition: max-height .28s ease, opacity .2s ease; /* no padding transition */
  will-change: max-height;
}

/* Open state: add vertical padding instantly (no animation = no snap) */
.btn-accordion.open .btn-accordion-body{
  padding: 12px 8px;       /* ← top/bottom padding only when open */
  opacity: 1;
}

/* Inner buttons stay full width */
.btn-accordion-body .btn{ width: 100%; margin: 0; }

/* Hover match */
.btn-accordion:hover{ transform: translateY(-1px); background: var(--btn-hover); }

/* =========================
   Responsive
   ========================= 
@media (max-width:640px) {
  .wrap { padding: 18px; }
  .card { padding: 18px; border-radius: 16px; }
  .brand img { width: 56px; height: 56px; border-radius: 10px; }
  h1 { font-size: 1.25rem; }
}
*/

/* Mobile tweaks */
@media (max-width: 640px) {
  .footer { font-size: .7rem; }
}

@font-face {
  font-family: 'Optima';
  src: url('/fonts/OPTIMA.TTF') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Optima';
  src: url('/fonts/OPTIMA_B.TTF') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* Lithos (local TTF set) */
@font-face {
  font-family: 'Lithos';
  src: url('/fonts/lithosweb.woff2') format('woff2'), url('/fonts/lithos.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lithos';
  src: url('/fonts/lithoslightweb.woff2') format('woff2'), url('/fonts/lithoslight.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lithos';
  src: url('/fonts/lithosextralightweb.woff2') format('woff2'), url('/fonts/lithosextralight.ttf') format('truetype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lithos';
  src: url('/fonts/lithosboldweb.woff2') format('woff2'), url('/fonts/lithosbold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lithos';
  src: url('/fonts/lithosblackweb.woff2') format('woff2'), url('/fonts/lithosblack.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Removed iOS-specific font metric overrides now that woff2 normalizes metrics */
