:root {
  --bg: #FAFAF7;
  --bg-soft: #F3F2EC;
  --fg: #0A0A0A;
  --fg-soft: #3A3A37;
  --muted: #8A8A82;
  --line: #E8E6DE;
  --line-soft: #EFEDE6;
  --amber: #E89547;
  --amber-soft: #F4B97A;
  --amber-glow: rgba(232, 149, 71, 0.18);
  --nav-bg: rgba(250, 250, 247, 0.72);
  --compass-opacity: 0.06;
  --shadow-card: 0 20px 40px -20px rgba(0, 0, 0, 0.12);
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, sans-serif;
  --display: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0A0A;
    --bg-soft: #141413;
    --fg: #FAFAF7;
    --fg-soft: #C8C6BE;
    --muted: #7A7A72;
    --line: #262523;
    --line-soft: #1C1B19;
    --amber-glow: rgba(232, 149, 71, 0.28);
    --nav-bg: rgba(10, 10, 10, 0.72);
    --compass-opacity: 0.10;
    --shadow-card: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .compass-bg { animation: none !important; }
}

/* Skip link for a11y */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 12px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Content-visibility for off-screen perf */
section.apps, section.contact { content-visibility: auto; contain-intrinsic-size: 1px 800px; }

::selection { background: var(--amber); color: var(--bg); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--nav-bg);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms ease, background 300ms ease;
}
.nav.scrolled { border-bottom-color: var(--line); }

.wordmark {
  font-family: var(--serif);
  font-size: 32px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.wordmark .dot {
  width: 5px; height: 5px;
  background: var(--amber);
  border-radius: 50%;
  display: inline-block;
  transform: translateY(-4px);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  transition: border-color 200ms ease;
}
.lang-toggle:hover { border-color: var(--fg); }
.lang-toggle .seg {
  padding: 3px 8px;
  border-radius: 999px;
  transition: color 200ms ease, background 200ms ease;
  color: var(--muted);
}
.lang-toggle .seg.active {
  background: var(--fg);
  color: var(--bg);
}
.nav-contact {
  color: var(--fg-soft);
  transition: color 200ms ease;
  position: relative;
}
.nav-contact:hover { color: var(--fg); }
.nav-contact::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 260ms ease;
}
.nav-contact:hover::after { width: 100%; }

/* ============ HERO ============ */
.hero {
  min-height: 100vh;
  padding: 180px 40px 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}
.eyebrow::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--muted);
  display: inline-block;
}

.hero-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(64px, 11vw, 180px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0 0 56px;
  max-width: 1200px;
}
.hero-title .italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.hero-title .amber { color: var(--amber); }

.hero-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 64px;
  max-width: 1100px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.hero-meta-col .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.hero-meta-col .value {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--fg);
}
.hero-meta-col .value .serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

/* Compass mark — faintly rotating background element */
.compass-bg {
  position: absolute;
  right: -80px;
  top: 140px;
  width: 420px;
  height: 420px;
  opacity: var(--compass-opacity);
  color: var(--fg);
  pointer-events: none;
  animation: spin 80s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============ MANIFESTO ============ */
.manifesto {
  padding: 140px 40px;
  max-width: 1440px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.manifesto-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 80px;
  align-items: start;
}
.section-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section-label .num {
  color: var(--amber);
  font-weight: 500;
}
.manifesto-text {
  font-family: var(--display);
  font-size: clamp(32px, 3.8vw, 56px);
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.02em;
  max-width: 1000px;
  text-wrap: pretty;
}
.manifesto-text .serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}
.manifesto-text .muted { color: var(--muted); }

/* ============ APPS ============ */
.apps {
  padding: 140px 40px 100px;
  max-width: 1440px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.apps-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 80px;
  gap: 40px;
  flex-wrap: wrap;
}
.apps-title {
  font-family: var(--display);
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin: 24px 0 0;
}
.apps-title .serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}
.apps-count {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.app-card {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 48px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  overflow: hidden;
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1), border-color 300ms ease, background 300ms ease;
}
.app-card:hover {
  border-color: var(--fg);
  transform: translateY(-4px);
}

.app-card.coming {
  background: var(--bg);
  border-style: dashed;
}

.app-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: auto;
}

.app-status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.app-status.live {
  background: var(--fg);
  color: var(--bg);
}
.app-status.live .pulse {
  position: relative;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}
.app-status.live .pulse::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--amber);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { transform: scale(1);    opacity: 0.6; }
  80%  { transform: scale(3.5);  opacity: 0; }
  100% { transform: scale(3.5);  opacity: 0; }
}
.app-status.soon {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.app-index {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.app-icon-wrap {
  width: 120px; height: 120px;
  border-radius: 28px;
  overflow: hidden;
  margin: 48px 0 40px;
  background: var(--bg);
  border: 1px solid var(--line);
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-card);
}
.app-card:hover .app-icon-wrap {
  transform: scale(1.08) rotate(-3deg);
}
.app-icon-wrap img {
  width: 100%; height: 100%;
  display: block;
}

.app-name {
  font-family: var(--display);
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0 0 12px;
}

.app-desc {
  font-family: var(--display);
  font-size: 18px;
  color: var(--fg-soft);
  line-height: 1.4;
  max-width: 360px;
  margin: 0 0 32px;
  letter-spacing: -0.005em;
}

.app-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  background: var(--bg);
  transition: all 200ms ease;
}
.store-btn:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.store-btn svg { width: 14px; height: 14px; }
.store-btn .arrow { margin-left: 2px; transition: transform 200ms ease; }
.store-btn:hover .arrow { transform: translate(2px, -2px); }

.store-btn-faded {
  opacity: 0.5;
  cursor: default;
  pointer-events: auto;
}
.store-btn-faded:hover {
  background: var(--bg);
  color: var(--fg);
  border-color: var(--line);
  opacity: 0.7;
}

/* ============ CONTACT / FOOTER ============ */
.contact {
  padding: 160px 40px 140px;
  max-width: 1440px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.contact-title {
  font-family: var(--display);
  font-size: clamp(56px, 10vw, 160px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-weight: 500;
  margin: 24px 0 40px;
}
.contact-title .serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: var(--display);
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg);
  padding: 20px 0;
  position: relative;
}
.contact-email::after {
  content: '';
  position: absolute;
  left: 0; bottom: 12px;
  width: 100%; height: 1px;
  background: var(--fg);
  transform-origin: left;
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}
.contact-email:hover::after {
  transform: scaleX(0);
  transform-origin: right;
}
.contact-email .arrow {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform 300ms ease;
}
.contact-email:hover .arrow {
  transform: translate(4px, -4px) rotate(-45deg);
}

.footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 40px 80px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 40px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.footer .col strong {
  display: block;
  color: var(--fg);
  margin-bottom: 8px;
  font-weight: 500;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .nav { padding: 16px 20px; }
  .hero { padding: 140px 20px 80px; }
  .manifesto, .apps, .contact { padding-left: 20px; padding-right: 20px; }
  .footer { padding-left: 20px; padding-right: 20px; }
  .manifesto-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-meta { grid-template-columns: 1fr; gap: 32px; }
  .app-grid { grid-template-columns: 1fr; }
  .app-card { min-height: auto; padding: 32px; }
  .app-name { font-size: 36px; }
  .footer { grid-template-columns: 1fr 1fr; }
  .compass-bg { width: 260px; height: 260px; right: -80px; top: 80px; }
  .nav-contact { display: none; }
}

/* ============ INTRO ANIMATION ============ */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}
.delay-1 { animation-delay: 120ms; }
.delay-2 { animation-delay: 260ms; }
.delay-3 { animation-delay: 420ms; }
.delay-4 { animation-delay: 580ms; }

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 900ms cubic-bezier(0.22, 1, 0.36, 1), transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
