/* ==========================================================================
   Alchemy Atlas — marketing site styles
   Palette grounded in the app's AlchemyTheme.
   ========================================================================== */

:root {
  --navy: #12171f;
  --navy-2: #161d28;
  --vessel: #1c2e47;
  --gold: #d9ad4f;
  --copper: #bd6638;
  --cyan: #38bfd1;
  --parchment: #f5edd9;
  --muted: #e0d4b8;
  --muted-dim: #a99f88;

  --fire: #e34f33;
  --water: #3387e3;
  --earth: #4a9e5c;
  --air: #bfd1d9;

  --edge: rgba(217, 173, 79, 0.18);
  --edge-soft: rgba(245, 237, 217, 0.09);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --maxw: 1080px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.65;
  color: var(--parchment);
  background-color: var(--navy);
  background-image:
    radial-gradient(1100px 620px at 78% -8%, rgba(56, 191, 209, 0.09), transparent 60%),
    radial-gradient(900px 560px at 12% 4%, rgba(217, 173, 79, 0.08), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- typography helpers ----------------------------------------------- */
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--parchment);
  margin: 0 0 0.5em;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}

.section__label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 0.6rem;
}

/* --- layout ------------------------------------------------------------ */
.container {
  width: min(100% - 2.5rem, var(--maxw));
  margin-inline: auto;
}

.section {
  padding-block: clamp(3rem, 8vw, 6rem);
  border-top: 1px solid var(--edge-soft);
}

.section__head {
  max-width: 42ch;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.section__head h2 {
  font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.6rem);
}

.section__head p {
  color: var(--muted);
  margin: 0.5rem 0 0;
}

/* --- site header ------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 2rem);
  background: rgba(18, 23, 31, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--parchment);
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--edge);
}

.topbar__links {
  display: flex;
  gap: clamp(0.75rem, 3vw, 1.6rem);
  font-family: var(--sans);
  font-size: 0.9rem;
}

.topbar__links a {
  color: var(--muted);
  text-decoration: none;
}

.topbar__links a:hover {
  color: var(--parchment);
}

@media (max-width: 520px) {
  .topbar {
    flex-wrap: wrap;
    row-gap: 0.35rem;
    padding-block: 0.6rem;
  }

  .topbar__links {
    width: 100%;
    justify-content: space-between;
    font-size: 0.85rem;
  }
}

/* --- hero -------------------------------------------------------------- */
.hero {
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}

@media (min-width: 860px) {
  .hero__grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.hero h1 {
  font-size: clamp(2.4rem, 1.4rem + 4.5vw, 4rem);
  font-weight: 600;
}

.hero__lede {
  color: var(--muted);
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
  max-width: 40ch;
  margin: 0 0 1.75rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.hero__note {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted-dim);
  margin: 1.25rem 0 0;
}

/* --- App Store badge (custom, faithful layout) ------------------------- */
.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  background: #000;
  border: 1px solid rgba(245, 237, 217, 0.25);
  color: #fff;
  text-decoration: none;
  font-family: var(--sans);
  line-height: 1.1;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.appstore-badge:hover {
  color: #fff;
  border-color: var(--gold);
  transform: translateY(-1px);
}

.appstore-badge svg {
  width: 26px;
  height: 26px;
  flex: none;
  fill: #fff;
}

.appstore-badge__small {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}

.appstore-badge__big {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@media (prefers-reduced-motion: reduce) {
  .appstore-badge,
  .appstore-badge:hover {
    transform: none;
  }
}

/* --- device / screenshot frames --------------------------------------- */
.shot-frame {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  background: var(--navy-2);
}

.hero__device {
  max-width: 340px;
  margin-inline: auto;
}

/* --- combine demo ------------------------------------------------------ */
.combine {
  margin: 1.75rem 0 2rem;
  padding: 1.25rem;
  border: 1px solid var(--edge);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(28, 46, 71, 0.55), rgba(22, 29, 40, 0.55));
}

.combine__caption {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin: 0 0 0.9rem;
}

.combine__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: rgba(18, 23, 31, 0.75);
  color: var(--parchment);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  cursor: default;
}

.chip__glyph {
  font-size: 1.25rem;
  line-height: 1;
}

/* element accent tints for chips */
.chip[data-el="fire"] {
  border-color: color-mix(in srgb, var(--fire) 55%, transparent);
}
.chip[data-el="water"] {
  border-color: color-mix(in srgb, var(--water) 55%, transparent);
}
.chip[data-el="earth"] {
  border-color: color-mix(in srgb, var(--earth) 55%, transparent);
}
.chip[data-el="air"] {
  border-color: color-mix(in srgb, var(--air) 55%, transparent);
}

.chip--result {
  background: rgba(56, 191, 209, 0.12);
  border-color: color-mix(in srgb, var(--cyan) 60%, transparent);
  color: var(--parchment);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.45s ease, transform 0.45s ease, box-shadow 0.45s ease;
}

.chip--result.is-visible {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 0 0 1px rgba(56, 191, 209, 0.3),
    0 0 26px rgba(56, 191, 209, 0.4);
}

.combine__op {
  font-family: var(--display);
  font-size: 1.4rem;
  color: var(--gold);
  min-width: 1ch;
  text-align: center;
}

.combine__button {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: linear-gradient(180deg, var(--gold), var(--copper));
  color: #1a1206;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.combine__button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.combine__button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.combine__hint {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted-dim);
  margin: 0.75rem 0 0;
}

/* soft puff when a discovery lands */
.puff {
  position: relative;
}

.puff.is-puffing::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  box-shadow: 0 0 30px 8px rgba(56, 191, 209, 0.55);
  animation: puff 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes puff {
  from {
    opacity: 0.9;
    transform: scale(0.9);
  }
  to {
    opacity: 0;
    transform: scale(1.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chip--result {
    transition: opacity 0.001s;
    transform: none;
  }
  .chip--result.is-visible {
    transform: none;
  }
  .combine__button:hover {
    transform: none;
  }
  .puff.is-puffing::after {
    animation: none;
  }
}

/* --- screenshot strip (scroll-snap) ------------------------------------ */
.strip {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--edge) transparent;
}

.strip::-webkit-scrollbar {
  height: 8px;
}
.strip::-webkit-scrollbar-thumb {
  background: var(--edge);
  border-radius: 8px;
}

.strip figure {
  margin: 0;
  flex: 0 0 auto;
  width: min(66vw, 260px);
  scroll-snap-align: center;
}

.strip figure img {
  border-radius: 20px;
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
}

.strip figcaption {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted-dim);
  text-align: center;
  margin-top: 0.7rem;
}

/* --- features grid ----------------------------------------------------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.feature {
  padding: 1.4rem;
  border: 1px solid var(--edge-soft);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(28, 46, 71, 0.35), rgba(22, 29, 40, 0.35));
}

.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-size: 1.25rem;
  margin-bottom: 0.9rem;
  background: rgba(18, 23, 31, 0.6);
  border: 1px solid var(--accent, var(--edge));
  color: var(--accent, var(--gold));
}

.feature h3 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

/* --- atlas ribbon ------------------------------------------------------ */
.atlas__ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.region {
  font-family: var(--sans);
  font-size: 0.92rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: rgba(28, 46, 71, 0.4);
  color: var(--muted);
}

.region--more {
  border-style: dashed;
  color: var(--muted-dim);
}

/* --- iPad section ------------------------------------------------------ */
.ipad-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

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

.ipad-grid figure {
  margin: 0;
}

.ipad-grid img {
  border-radius: 16px;
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
}

.ipad-grid figcaption {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted-dim);
  text-align: center;
  margin-top: 0.7rem;
}

/* --- final CTA --------------------------------------------------------- */
.cta-band {
  text-align: center;
}

.cta-band h2 {
  font-size: clamp(1.8rem, 1.2rem + 3vw, 3rem);
}

.cta-band p {
  color: var(--muted);
  max-width: 46ch;
  margin: 0.5rem auto 2rem;
}

/* --- footer ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--edge-soft);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.site-footer__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  align-items: flex-start;
  justify-content: space-between;
}

.site-footer .brand {
  margin-bottom: 0.75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--parchment);
}

.footer-legal {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted-dim);
  margin: 1.5rem 0 0;
}

/* ======================================================================
   Legal / support subpages
   ====================================================================== */
.doc {
  width: min(100% - 2.5rem, 760px);
  margin: 0 auto;
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.doc .back {
  font-family: var(--sans);
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--muted);
  display: inline-block;
  margin-bottom: 1.5rem;
}

.doc .back:hover {
  color: var(--parchment);
}

.doc h1 {
  font-size: clamp(2rem, 1.4rem + 2.5vw, 2.8rem);
}

.doc h2 {
  font-size: 1.3rem;
  margin-top: 2.2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--edge-soft);
}

.doc .meta {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted-dim);
  margin-top: -0.4rem;
}

.doc p,
.doc li {
  color: var(--muted);
}

.doc ul {
  padding-left: 1.2rem;
}

.doc li {
  margin-bottom: 0.5rem;
}

.doc strong {
  color: var(--parchment);
}

.doc .card {
  padding: 1.4rem;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(28, 46, 71, 0.35), rgba(22, 29, 40, 0.35));
  margin-bottom: 1.5rem;
}

.doc .card p {
  margin: 0;
}

.faq-q {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--parchment);
  margin: 1.8rem 0 0.3rem;
}

.doc-footer {
  width: min(100% - 2.5rem, 760px);
  margin: 0 auto;
  padding-bottom: 3rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted-dim);
  border-top: 1px solid var(--edge-soft);
  padding-top: 1.5rem;
}

.doc-footer a {
  color: var(--muted);
  text-decoration: none;
}

.doc-footer a:hover {
  color: var(--parchment);
}

/* visually-hidden but screen-reader available */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
