/*
 * openfields.app. The palette, type and ground are Terra Swap's and Terra NFT's
 * (terraluna-nft styles/globals.css), so the three sites read as one family.
 */

:root {
  color-scheme: dark;
  --void: #05070f;
  --surface: #0b0f1c;
  --card: #111729;
  --divider: rgba(255, 216, 61, 0.13);
  --divider-strong: rgba(255, 216, 61, 0.28);
  --gold: #ffd83d;
  --gold-core: #caa022;
  --gold-pale: #fff8dc;
  --red: #e0485a;
  --success: #3ddc97;
  --text: #f4f1e8;
  --text-2: #d6cfbd;
  --muted: #9a927f;
  --whisper: #6b6555;
  --on-gold: #1a1405;
  --font: 'Montserrat', 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --grad-primary: linear-gradient(135deg, #caa022 0%, #ffd83d 100%);
  --grad-shimmer: linear-gradient(100deg, #caa022 0%, #ffd83d 22%, #fff8dc 40%, #ffd83d 58%, #caa022 78%, #caa022 100%);
}

* { box-sizing: border-box; }
html { font-size: 16px; }
@media (min-width: 1100px) { html { font-size: 17px; } }
@media (min-width: 1600px) { html { font-size: 18px; } }
body { margin: 0; background: var(--void); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ── Ground: the apps' gradient and three slow lanterns ─────────────── */
.ground { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(120% 80% at 50% -10%, #111729 0%, #0a0d18 42%, #05070f 100%); }
.lantern { position: absolute; border-radius: 999px; filter: blur(40px); animation: drift 64s linear infinite alternate; }
.lantern--a { width: 38vw; height: 38vw; left: -12vw; top: 18vh; background: #ffd83d; opacity: 0.08; }
.lantern--b { width: 30vw; height: 30vw; right: -10vw; top: -8vh; background: #e0485a; opacity: 0.09; animation-duration: 78s; }
.lantern--c { width: 34vw; height: 34vw; right: -8vw; bottom: -14vh; background: #ffb347; opacity: 0.07; animation-duration: 56s; }
@keyframes drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(4vw, -3vh, 0); } }

.page { position: relative; z-index: 1; max-width: 72rem; margin: 0 auto; padding: max(1.4rem, env(safe-area-inset-top)) 1.2rem 2.4rem; }

/* ── Top line ──────────────────────────────────────────────────────── */
.top { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.75rem; }
.kicker { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.34em; text-transform: uppercase; color: var(--red); }
.chip { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.42rem 0.8rem; border-radius: 999px; border: 1px solid var(--divider);
  background: rgba(11, 15, 28, 0.72); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.chip b { color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.chip b:empty { display: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 50% { opacity: 0.35; } }

/* ── Intro ─────────────────────────────────────────────────────────── */
.intro { margin: clamp(1.8rem, 5vw, 3rem) 0 clamp(1.6rem, 4vw, 2.4rem); }
.wordmark { margin: 0; display: inline-flex; align-items: center; gap: 0.24em; font-size: clamp(2.7rem, 9vw, 4.8rem); line-height: 1; letter-spacing: -0.035em; font-weight: 700; }
.wordmark img { width: 0.86em; height: auto; flex: none; filter: drop-shadow(0 4px 18px rgba(52, 88, 184, 0.5)); }
.wordmark .word { background: var(--grad-shimmer); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite; padding-bottom: 0.06em; }
.wordmark .light { font-weight: 300; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.lead { margin: 1.1rem 0 0; max-width: 42rem; font-size: clamp(1.1rem, 2.3vw, 1.45rem); line-height: 1.45; font-weight: 500; color: var(--text-2); text-wrap: balance; }
.lead b { color: var(--text); font-weight: 700; }

/* ── App cards ─────────────────────────────────────────────────────── */
.apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
@media (max-width: 1180px) { .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .apps { grid-template-columns: 1fr; } }

.app { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px;
  background: linear-gradient(180deg, rgba(17, 23, 41, 0.94), rgba(11, 15, 28, 0.96)); border: 1px solid var(--divider);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35); transition: transform 0.4s var(--ease), border-color 0.25s, box-shadow 0.4s var(--ease); }
.app::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.4s var(--ease);
  background: radial-gradient(70% 50% at 50% 0%, rgba(255, 216, 61, 0.12), transparent 70%); }
.app:hover { transform: translateY(-4px); border-color: var(--divider-strong); box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5); }
.app:hover::before { opacity: 1; }
.app:focus-within { border-color: var(--gold-core); }

.shot { position: relative; aspect-ratio: 1200 / 630; overflow: hidden; background: #070a14; border-bottom: 1px solid var(--divider); }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 0.9s var(--ease); }
.app:hover .shot img { transform: scale(1.035); }
.shot::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 62%, rgba(11, 15, 28, 0.7)); }

.body { position: relative; display: flex; flex-direction: column; gap: 0.9rem; flex: 1; padding: 1.25rem 1.4rem 1.4rem; }
.head { display: flex; align-items: center; gap: 0.8rem; }
.glyph { flex: none; width: 2.7rem; height: 2.7rem; display: grid; place-items: center; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--divider-strong); color: var(--gold); font-size: 1.25rem; font-weight: 700; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4); }
.name { margin: 0; font-size: 1.6rem; line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; }
.name .light { font-weight: 300; }
.url { margin-top: 0.15rem; font-size: 0.72rem; letter-spacing: 0.02em; color: var(--muted); }
.lede { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--text-2); }

.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.points li { position: relative; padding-left: 1.2rem; font-size: 0.86rem; line-height: 1.45; color: var(--text-2); }
.points li::before { content: ''; position: absolute; left: 0.1rem; top: 0.52em; width: 0.4rem; height: 0.4rem; border-radius: 2px; transform: rotate(45deg); background: var(--gold-core); }

.pulse { list-style: none; margin: 0; padding: 0.8rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.3rem; border-top: 1px solid var(--divider); }
.pulse li { display: inline-flex; align-items: baseline; gap: 0.35rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.pulse b { font-size: 1.1rem; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }

.foot { margin-top: auto; padding-top: 0.2rem; display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.note { flex: 1 1 12rem; font-size: 0.7rem; line-height: 1.4; color: var(--whisper); }
.cta { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.75rem; padding: 0.75rem 1.15rem; border-radius: 11px;
  background: var(--grad-primary); border: 1px solid var(--gold); color: var(--on-gold); font-size: 0.86rem; font-weight: 700; text-decoration: none; white-space: nowrap;
  box-shadow: 0 10px 28px rgba(255, 216, 61, 0.16); transition: filter 0.2s; }
/* The whole card opens the app. */
.cta::after { content: ''; position: absolute; inset: 0; border-radius: 20px; }
.cta span { display: inline-block; transition: transform 0.3s var(--ease); }
.app:hover .cta { filter: brightness(1.06); }
.app:hover .cta span { transform: translate(2px, -2px); }

/* ── Principles ────────────────────────────────────────────────────── */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: clamp(1.8rem, 4vw, 2.6rem); }
@media (max-width: 820px) { .principles { grid-template-columns: 1fr; } }
.principle { padding: 1.1rem 1.2rem 1.2rem; border-radius: 16px; border: 1px solid var(--divider); background: rgba(11, 15, 28, 0.55); }
.eyebrow { display: block; margin-bottom: 0.5rem; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.principle h2 { margin: 0 0 0.35rem; font-size: 0.98rem; font-weight: 700; }
.principle p { margin: 0; font-size: 0.84rem; line-height: 1.5; color: var(--muted); }

/* ── Footer ────────────────────────────────────────────────────────── */
.footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem; margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--divider);
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--gold); }
.push { margin-left: auto; font-size: 0.68rem; letter-spacing: 0.02em; text-transform: none; color: var(--whisper); }
@media (max-width: 700px) { .push { margin-left: 0; flex-basis: 100%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* The address under the wordmark. Small on purpose: it names the place, it is not the brand. */
.domain { margin: 6px 0 0; font-size: 0.86rem; letter-spacing: 0.14em; color: #9a927f; }

/* ── The family, shown rather than hidden ──────────────────────────── */
/* One row, identical on every surface: the hub and the five apps share these
   exact rules. Heavy enough to read at a glance, lighter than the page's own
   tabs, because two navigations shouting equally loudly are two nobody reads. */
.tl-eco { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-bottom: 0.5rem; }
.tl-eco-item { display: inline-flex; align-items: center; gap: 0.36rem; padding: 0.26rem 0.62rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; text-transform: none; text-decoration: none;
  white-space: nowrap; color: var(--tl-muted, #9a927f);
  border: 1px solid var(--tl-divider, rgba(255, 216, 61, 0.13)); background: rgba(11, 15, 28, 0.6); }
.tl-eco-item:hover { color: var(--tl-gold, #ffd83d); border-color: var(--tl-gold, #ffd83d); }
.tl-eco-item.is-here { color: var(--tl-text, #f4f1e8); background: rgba(255, 216, 61, 0.08);
  border-color: var(--tl-gold, #ffd83d); }
.tl-eco-glyph { font-size: 0.9em; opacity: 0.9; }
.tl-eco-home { margin-left: 0.2rem; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: none;
  color: var(--tl-whisper, #6b6555); text-decoration: none; white-space: nowrap; }
.tl-eco-home:hover { color: var(--tl-gold, #ffd83d); }
.tl-kicker { margin-bottom: 0.15rem; }
@media (max-width: 560px) { .tl-eco-item { padding: 0.22rem 0.52rem; font-size: 0.68rem; } }
