/* Arete website. Colors mirror Theme.swift in the app. */
:root {
  --bg: #0B111D;
  --card: #162136;
  --card-2: #111A2B;
  --border: #24334D;
  --muted: #8E9EB5;
  --text: #F1F5F9;
  --tint: #2D70F7;
  --tint-soft: #3B82F6;
  --positive: #22C55E;
  --warning: #F59E0B;
  --bronze: #C47A3A;
  --mythic: #38BDF8;
  --radius: 22px;
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

a { color: var(--tint-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

/* ---------- Animated background (like AnimatedBackgroundView) ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.aurora span {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: #1D4ED8; top: -25vmax; left: -15vmax; }
.aurora span:nth-child(2) { background: #0EA5E9; bottom: -30vmax; right: -20vmax; animation-duration: 32s; opacity: 0.22; }
.aurora span:nth-child(3) { background: #312E81; top: 30%; left: 40%; width: 40vmax; height: 40vmax; animation-duration: 38s; opacity: 0.3; }
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg) 85%);
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(8vmax, 6vmax) scale(1.1); }
  100% { transform: translate(-6vmax, 10vmax) scale(0.95); }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  background: rgba(11, 17, 29, 0.6);
  border-bottom: 1px solid rgba(36, 51, 77, 0.6);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.02em;
}
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { display: flex; gap: 22px; font-size: 15px; font-weight: 600; }
.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }

/* ---------- Splash ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash-inner { display: grid; place-items: center; gap: 18px; }
.splash-sword {
  width: min(520px, 80vw);
  clip-path: inset(0 100% 0 0);
  animation: forge 1.1s cubic-bezier(.7, 0, .2, 1) 0.15s forwards;
  filter: drop-shadow(0 0 30px rgba(196, 122, 58, 0.45));
}
.splash-word {
  font-size: clamp(34px, 7vw, 64px);
  font-weight: 900;
  letter-spacing: 0.42em;
  margin-right: -0.42em;
  opacity: 0;
  animation: rise 0.8s ease 0.9s forwards;
}
@keyframes forge { to { clip-path: inset(0 0 0 0); } }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); letter-spacing: 0.6em; }
  to   { opacity: 1; transform: none; }
}

/* ---------- Hero ---------- */
.hero { padding: 90px 0 40px; text-align: center; }
.hero h1 {
  font-size: clamp(42px, 7.5vw, 86px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 22px 0 18px;
}
.hero h1 .grad {
  background: linear-gradient(100deg, #93C5FD, var(--tint) 45%, var(--mythic));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); max-width: 640px; margin: 0 auto; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  background: var(--tint);
  box-shadow: 0 10px 30px rgba(45, 112, 247, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 16px 40px rgba(45, 112, 247, 0.45); }
.btn.ghost { background: rgba(22, 33, 54, 0.7); border: 1px solid var(--border); box-shadow: none; }
.btn svg { width: 20px; height: 20px; }

/* Hero sword */
.hero-sword { position: relative; margin: 64px auto 0; width: min(760px, 92%); }
.hero-sword img {
  width: 100%;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 40px rgba(196, 122, 58, 0.25));
}
.hero-sword::before {
  content: "";
  position: absolute;
  inset: -20% 10%;
  background: radial-gradient(ellipse at center, rgba(196, 122, 58, 0.28), transparent 65%);
  z-index: -1;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50%      { transform: translateY(-12px) rotate(0.6deg); }
}

/* ---------- Sections ---------- */
section { padding: 90px 0; }
.kicker { font-size: 13px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--tint-soft); }

/* ---------- Screenshot coverflow ---------- */
/* main.js sets each phone's transform every frame from one eased focus value,
   so there are no CSS hover states or transitions to fight with. */
.screens { padding: 30px 0 110px; }
.gallery {
  position: relative; /* the phones' offsetLeft is measured from here */
  display: flex;
  gap: 26px;
  justify-content: center;
  align-items: center;
  padding: 40px 20px 30px;
  perspective: 1400px;
  touch-action: pan-y;
}
.phone {
  --focus: 0;
  position: relative;
  flex: 0 0 auto;
  width: clamp(170px, 16vw, 230px);
  border-radius: 38px;
  padding: 9px;
  background: linear-gradient(145deg, #2A3A57, #0F1726);
  border: 1px solid #33466A;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
  transform-origin: 50% 60%;
  will-change: transform;
  backface-visibility: hidden;
  cursor: pointer;
}
/* The glow fades with focus via opacity, which is cheap to animate, unlike box-shadow. */
.phone::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 40px 90px rgba(45, 112, 247, 0.35);
  opacity: var(--focus);
  pointer-events: none;
}
.phone img {
  border-radius: 30px;
  aspect-ratio: 1320 / 2868;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

@media (max-width: 960px) {
  .gallery {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 30px calc(50% - 110px) 40px;
    touch-action: auto;
  }
  .gallery::-webkit-scrollbar { display: none; }
  .phone { width: 220px; scroll-snap-align: center; }
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 34px 0 50px;
  color: var(--muted);
  font-size: 14px;
}
footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }

/* ---------- Legal / text pages ---------- */
.doc { padding: 70px 0 90px; }
.doc .wrap { max-width: 780px; }
.doc h1 { font-size: clamp(36px, 5vw, 54px); letter-spacing: -0.02em; margin: 10px 0 6px; font-weight: 900; }
.doc .updated { color: var(--muted); font-size: 15px; margin-bottom: 34px; }
.doc h2 { font-size: 23px; margin: 42px 0 10px; letter-spacing: -0.01em; }
.doc h3 { font-size: 18px; margin: 26px 0 6px; }
.doc p, .doc li { color: #CBD5E1; }
.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc strong { color: var(--text); }
.summary {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 10px 0 20px;
}
.summary p { margin: 6px 0; }
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
td { color: #CBD5E1; }

details.faq {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 22px;
  margin: 12px 0;
}
details.faq summary { cursor: pointer; font-weight: 700; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--tint-soft); font-weight: 800; font-size: 20px; line-height: 1; transition: transform 0.2s ease; }
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq p { margin: 12px 0 2px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-links { gap: 14px; font-size: 14px; }
  section { padding: 64px 0; }
  .hero { padding-top: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .splash-sword { clip-path: none; }
  .splash-word { opacity: 1; }
  .reveal { opacity: 1; transform: none; }
}
