/* ==========================================================
   armecera — base stylesheet (prototype)
   Mobile-first. Simple, calm, generous whitespace.
   ========================================================== */

:root {
  /* Typography — change this one line to swap the whole site's font later */
  --font-family: "Covered By Your Grace", system-ui, -apple-system,
    BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Segoe UI", Roboto,
    cursive;

  /* Colors */
  --color-bg: #faf8f5;
  --color-text: #2d2c2a;
  --color-text-muted: #6b6862;
  --color-accent: #b5714f;
  --color-accent-hover: #a05f40;
  --color-card-bg: #ffffff;
  --color-border: #ece7e0;
  --color-placeholder-bg: #f0ece5;
  --color-placeholder-text: #9c968c;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  /* Radius / shadow */
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.06);

  /* Layout */
  --max-width: 1080px;
}

/* -------------------- Reset -------------------- */

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

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

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Fixed full-viewport background image.
   Uses a dedicated fixed element (not background-attachment: fixed)
   for reliable behavior on iOS Safari / Android Chrome. */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul {
  margin: 0;
  padding: 0;
}

/* -------------------- Layout helpers -------------------- */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

/* -------------------- Header -------------------- */

.site-header {
  padding-block: var(--space-lg) var(--space-md);
  text-align: center;
}

.site-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tagline {
  margin-top: var(--space-xs);
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* -------------------- Cards section -------------------- */

.cards-section {
  padding-block: var(--space-sm) var(--space-xl);
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.card {
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.card-image {
  aspect-ratio: 16 / 9;
  background-color: var(--color-placeholder-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-image span {
  color: var(--color-placeholder-text);
  font-size: 0.9rem;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.card-body {
  padding: var(--space-md);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

.card-desc {
  margin-top: var(--space-xs);
  color: var(--color-text-muted);
  font-size: 0.95rem;
  text-align: center;
}

/* -------------------- Buttons -------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-md);
  padding: 0.85rem 1.5rem;
  min-height: 44px;
  background-color: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

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

.btn:active {
  transform: translateY(0);
}

/* Two buttons side by side (e.g. iOS / Android) */
.store-buttons {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.btn-store {
  flex: 1;
  margin-top: 0;
  padding: 0.6rem var(--space-sm);
  min-height: 40px;
  font-size: 0.85rem;
}

.store-buttons + .about-link {
  margin-top: var(--space-sm);
}

/* Single full-width button (e.g. YouTube card) */
.btn-full {
  display: flex;
  width: 100%;
}

/* Quiet text link, less prominent than a store button */
.about-link {
  display: block;
  width: 100%;
  margin-top: var(--space-sm);
  padding: 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
}

.about-link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

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

.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-lg);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

.footer-copy {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.footer-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
}

.footer-row-spacer {
  display: block;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

/* Small, low-key element on the same row as the footer links.
   Intentionally understated rather than hidden outright, so it stays
   reachable by mouse, touch, and keyboard. */
.footer-hidden-link {
  justify-self: end;
  margin: -0.75rem;
  padding: 0.75rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.35;
  cursor: pointer;
}

.footer-hidden-link:hover,
.footer-hidden-link:focus-visible {
  opacity: 0.75;
}

.footer-nav a,
.footer-nav button {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.footer-nav a:hover,
.footer-nav button:hover {
  color: var(--color-accent);
}

/* -------------------- Simple sub-page content -------------------- */

.page-section {
  padding-block: var(--space-lg) var(--space-xl);
}

.page-section .container {
  max-width: 640px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
}

.page-text {
  margin-top: var(--space-sm);
  color: var(--color-text-muted);
}

.back-link {
  display: inline-block;
  margin-top: var(--space-lg);
  color: var(--color-accent);
  font-size: 0.95rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* -------------------- Tablet / desktop -------------------- */

@media (min-width: 700px) {
  body {
    font-size: 18px;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .site-header {
    padding-block: var(--space-xl) var(--space-lg);
  }
}

/* -------------------- About modal -------------------- */

/* Applied to <body> while a modal is open. Fixing the body in place
   (rather than overflow: hidden) keeps the page's visual scroll
   position intact instead of snapping it to the top. */
body.body-lock {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background-color: rgba(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, background-color 0.25s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0.45);
}

.modal-panel {
  position: relative;
  width: min(92vw, 480px);
  height: min(78vh, 560px);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
  touch-action: pan-y;
}

.modal-overlay.is-open .modal-panel {
  transform: translateY(0) scale(1);
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
}

.modal-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-content {
  padding: var(--space-lg) var(--space-md);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.modal-content p {
  margin: var(--space-xs) 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.modal-content .modal-meta {
  margin-top: var(--space-sm);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  text-align: right;
}

.modal-content .modal-invite {
  margin-top: var(--space-sm);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.modal-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-link:hover {
  opacity: 0.8;
}
