@font-face {
  font-family: "NaturalMono";
  src: url("./Assets/Fonts/NaturalMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NaturalMono";
  src: url("./Assets/Fonts/NaturalMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050505;
  --ink: #f7f7f2;
  --card: #0d0d0d;
  --line: rgba(247, 247, 242, 0.12);
  --muted: rgba(247, 247, 242, 0.55);
  --mono: "NaturalMono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  background: var(--bg); /* fills safe-area / overscroll gaps on iOS */
}

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

/* ── Noise grain overlay ──────────────────────────────────────────────────── */
/* NOTE: intentionally NOT on body::before as a fixed overlay — that creates
   a compositor layer conflict with position:fixed on iOS Safari. Grain is
   scoped to individual sections (hero::before, about-section::before etc.) */

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  background: transparent;
  transition: background 360ms ease;
}

.site-header-overlay {
  min-height: 84px;
  padding: 0 32px;
  background: transparent;
}

.site-header.is-scrolled {
  background: #050505;
}

.site-header-left,
.site-header-center,
.site-header-right {
  display: flex;
  align-items: center;
  height: 84px;
  min-height: 84px;
}

.site-header-left {
  justify-content: flex-start;
}

.site-header-center {
  justify-content: center;
}

.site-header-right {
  justify-content: flex-end;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

.site-logo {
  display: block;
  width: 72px;
  height: auto;
}

/* ── Nav toggle ───────────────────────────────────────────────────────────── */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 13px;
  width: auto;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  flex: 0 0 auto;
  line-height: 1;
  opacity: 1;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 200ms ease;
}

.nav-toggle:active { opacity: 0.5; }
@media (hover: hover) { .nav-toggle:hover { opacity: 0.5; } }

.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 22px;
  height: 16px;
}

.nav-toggle-icon span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
}

.nav-toggle-label {
  display: inline-block;
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  line-height: 1;
}

/* ── Nav backdrop ─────────────────────────────────────────────────────────── */
.nav-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(0,0,0,0.72);
  padding: 0;
  z-index: 9001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}
.nav-backdrop.is-open { opacity: 1; pointer-events: auto; }

/* ── Nav drawer ───────────────────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 28vw;
  min-width: 320px;
  max-width: 460px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 30px 28px 32px;
  background: #000;
  border-right: 1px solid rgba(247,247,242,0.06);
  z-index: 9002;
  justify-self: start;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-100%);
  transition: transform 260ms cubic-bezier(0.16,1,0.3,1), visibility 0ms linear 260ms;
}
.site-nav.is-open {
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition: transform 260ms cubic-bezier(0.16,1,0.3,1);
}

/* Close button */
.nav-close {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: max-content;
  margin-bottom: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  opacity: 1;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 200ms ease;
}
.nav-close:active { opacity: 0.5; }
@media (hover: hover) { .nav-close:hover { opacity: 0.5; } }

.nav-close-icon {
  position: relative;
  width: 16px;
  height: 16px;
}
.nav-close-icon span {
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 1px;
  background: var(--ink);
}
.nav-close-icon span:nth-child(1) { transform: rotate(45deg); }
.nav-close-icon span:nth-child(2) { transform: rotate(-45deg); }

.nav-close-label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  line-height: 1;
}

/* Nav links */
.site-nav a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(2.4rem, 3.6vw, 4.9rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 260ms ease, transform 260ms ease;
}
.site-nav.is-open a { opacity: 1; transform: translateX(0); }
.site-nav.is-open a:nth-child(2) { transition-delay: 80ms; }
.site-nav.is-open a:nth-child(3) { transition-delay: 150ms; }
.site-nav.is-open a:nth-child(4) { transition-delay: 220ms; }
.site-nav.is-open:has(a:hover) a:not(:hover) { opacity: 0.22; transition: opacity 160ms ease; }

.nav-social {
  margin-top: auto;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.site-nav .nav-social a {
  font-size: 0.68rem !important;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 247, 242, 0.35);
  text-decoration: none;
  font-family: var(--mono);
  opacity: 1 !important;
  transform: none !important;
  transition: color 200ms ease;
  line-height: 1;
}

.site-nav .nav-social a:hover {
  color: var(--ink);
}

.nav-num {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: rgba(247,247,242,0.32);
  line-height: 1;
  text-transform: uppercase;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 84px 48px 72px;
  overflow: hidden;
  background: var(--bg);
  z-index: 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--bg);
}

/* Subtle radial glow */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 20% 80%, rgba(247,247,242,0.04) 0%, transparent 70%);
}

/* Film grain */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  background-repeat: repeat;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 28px;
}

.hero-title {
  margin: 0 0 40px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(4.2rem, 13vw, 16rem);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--ink);
  max-width: 14ch;
}

.hero-tagline {
  margin: 0 0 52px;
  font-family: var(--mono);
  font-size: clamp(0.72rem, 1.1vw, 0.86rem);
  letter-spacing: 0.14em;
  line-height: 1.7;
  color: var(--muted);
  text-transform: uppercase;
  max-width: 620px;
}

/* ── Ghost button ─────────────────────────────────────────────────────────── */
.button {
  display: inline-block;
  padding: 14px 28px;
  font-size: 0.72rem;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid rgba(247, 247, 242, 0.38);
  background: transparent;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}

.button:hover {
  border-color: var(--ink);
  background: rgba(247, 247, 242, 0.05);
}

/* ── Section wrapper ──────────────────────────────────────────────────────── */
.section {
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
  padding: 96px 0;
}

.section + .section {
  padding-top: 0;
}

/* ── Panel label ──────────────────────────────────────────────────────────── */
.panel-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 48px;
}

/* ── Divider line ─────────────────────────────────────────────────────────── */
.rule {
  width: 100%;
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ── Statement strip ──────────────────────────────────────────────────────── */
.statement {
  width: 100%;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 64px 48px;
}

.statement-inner {
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
}

.statement-text {
  font-size: clamp(1.1rem, 2vw, 1.7rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 860px;
  margin: 0;
}


/* ── Apps feed ────────────────────────────────────────────────────────────── */
.apps-feed {
  border-top: 1px solid var(--line);
  scroll-margin-top: 0;
}

/* ── App block entrance animation ────────────────────────────────────────── */
/* No entrance animation — matching main site behaviour. Opacity transitions
   on large content blocks create GPU compositing layers that iOS Safari
   incorrectly renders above position:fixed elements. */

/* ── App block ────────────────────────────────────────────────────────────── */
.app-block {
  display: grid;
  grid-template-columns: auto 1fr;
  border-bottom: 1px solid var(--line);
  height: calc(100vh - 84px);
}

.app-block-artwork {
  position: relative;
  /* A4 ratio derived from block height so image fills exactly screen-minus-header */
  width: calc((100vh - 84px) / 1.414);
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.app-block-img {
  position: absolute;
  top: 32px;
  left: 32px;
  right: 32px;
  bottom: 32px;
  width: calc(100% - 64px);
  height: calc(100% - 64px);
  object-fit: contain;
}

.app-block-placeholder {
  width: 100%;
  height: 100%;
  background: var(--card);
}

.app-block-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 72px;
  gap: 0;
}

.app-block-tagline {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.app-block-name {
  font-size: clamp(2.4rem, 4vw, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.92;
  color: var(--ink);
  margin: 0 0 28px;
}

.app-block-desc {
  font-size: clamp(0.9rem, 1.1vw, 1.05rem);
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 40px;
  max-width: 52ch;
  white-space: pre-wrap;
}

.app-block-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid rgba(247, 247, 242, 0.3);
  width: fit-content;
  transition: border-color 200ms ease, background 200ms ease;
}

.app-block-link:hover {
  border-color: var(--ink);
  background: rgba(247, 247, 242, 0.04);
}

/* ── Closing statement ────────────────────────────────────────────────────── */
.closing {
  width: 100%;
  padding: 120px 48px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
}

.closing-inner {
  width: min(1240px, calc(100% - 0px));
  margin: 0 auto;
}

.closing-title {
  font-size: clamp(2rem, 4vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.94;
  margin: 0 0 32px;
  color: var(--ink);
}

/* ── About page ───────────────────────────────────────────────────────────── */
.about-section {
  position: relative;
  width: 100%;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 84px 48px 80px;
  background: var(--bg);
  overflow: hidden;
}

.about-section--centered {
  justify-content: center;
}

.about-section::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 50% at 80% 20%, rgba(247,247,242,0.03) 0%, transparent 70%);
}

.about-content {
  position: relative;
  z-index: 1;
  max-width: 860px;
}

.about-eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 32px;
}

.about-rule {
  width: 100%;
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0 0 52px;
}

.about-mindhaus-link {
  display: block;
  margin-top: 48px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 200ms ease;
}

.about-mindhaus-link:hover {
  color: var(--ink);
}

.about-text {
  font-size: clamp(1.2rem, 2.2vw, 2rem);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 56px;
}

@media (max-width: 720px) {
  .about-section {
    padding: 84px 20px 80px;
  }

  .about-text {
    font-size: clamp(1.1rem, 5vw, 1.4rem);
  }
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 48px 36px;
}

.footer-inner {
  width: min(1240px, calc(100% - 0px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  align-items: center;
  gap: 32px;
}

.footer-copy {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0;
  text-transform: uppercase;
}

.footer-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.footer-logo {
  width: 48px;
  height: auto;
  opacity: 0.5;
  transition: opacity 200ms ease;
}

.footer-logo:hover {
  opacity: 1;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  /* ── Header — exact match to main site ───────────────────────────────── */
  .site-header {
    grid-template-columns: 56px 1fr 56px;
  }

  .site-header-left,
  .site-header-center,
  .site-header-right {
    height: 64px;
    min-height: 64px;
  }

  .site-header-overlay {
    min-height: 64px;
    padding-left: 12px;
    padding-right: 12px;
    background: transparent;
  }


  .nav-toggle-label {
    display: none;
  }

  .nav-close {
    margin-bottom: 18px;
  }

  .site-nav {
    width: 78vw;
    min-width: 0;
    max-width: 340px;
    height: 100dvh;
    padding: 24px 22px 28px;
    gap: 16px;
  }

  .site-nav a {
    font-size: clamp(2.2rem, 10vw, 3.6rem);
  }

  /* ── Hero ────────────────────────────────────────────────────────────── */
  .hero {
    justify-content: flex-end;
    padding: 64px 20px 48px;
  }

  /* ── App blocks ──────────────────────────────────────────────────────── */
  .app-block {
    grid-template-columns: 1fr;
    height: auto;
  }

  .app-block-artwork {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.414;
  }

  .app-block-img {
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: calc(100% - 32px);
    height: calc(100% - 32px);
  }

  .app-block-body {
    padding: 36px 24px 52px;
  }

  .app-block-name {
    margin-bottom: 16px;
  }

  .app-block-desc {
    margin-bottom: 28px;
  }

  .app-block-link {
    align-self: flex-start;
  }

  /* ── Footer ──────────────────────────────────────────────────────────── */
  .site-footer {
    padding: 40px 24px 28px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 16px;
    justify-items: center;
    text-align: center;
  }

  .footer-inner > * {
    order: 1;
  }

  .footer-logo-link {
    order: 0;
  }

  .footer-copy {
    text-align: center;
  }
}

/* ── Loading / empty states ───────────────────────────────────────────────── */
.apps-loading {
  grid-column: 1 / -1;
  padding: 48px 0;
}

.apps-loading-text {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: rgba(247,247,242,0.2);
  text-transform: uppercase;
}

.apps-empty {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  grid-column: 1 / -1;
}

.header-nav-link {
  text-decoration: none;
  color: var(--muted);
  transition: color 200ms ease;
}

.header-nav-link:hover {
  color: var(--ink);
}

@media (max-width: 480px) {
  .apps-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
  }

  .app-name {
    font-size: 0.95rem;
  }

  .app-desc {
    font-size: 0.8rem;
  }
}
