:root {
  --ink: #313332;
  --ink-soft: #5a5c5b;
  --muted: #7a7b7a;
  --canvas: #f4f2ef;
  --canvas-deep: #ebe7e1;
  --accent: #496455;
  --chrome: rgba(252, 249, 248, 0.92);
  --panel: #fcf9f8;
  --shadow: 0 28px 80px rgba(49, 51, 50, 0.14);
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-sans: "Inter Tight", "Inter", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: -0.02em;
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Soft editorial atmosphere — warm wash, not flat fill */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 12% 18%, rgba(73, 100, 85, 0.1), transparent 55%),
    radial-gradient(90% 70% at 88% 72%, rgba(49, 51, 50, 0.06), transparent 50%),
    linear-gradient(165deg, #f7f5f2 0%, var(--canvas) 45%, var(--canvas-deep) 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.035;
  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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  height: 100dvh;
  max-height: 100dvh;
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding:
    calc(22px + var(--safe-top))
    calc(clamp(20px, 4vw, 40px) + var(--safe-right))
    calc(16px + var(--safe-bottom))
    calc(clamp(20px, 4vw, 40px) + var(--safe-left));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  opacity: 0;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
}

.brand__mark {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand__word {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.app-store {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
  border-radius: 8px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-store:hover {
  opacity: 0.88;
  text-decoration: none;
}

.app-store:active {
  transform: scale(0.98);
}

.app-store img {
  width: auto;
  height: auto;
  max-width: 100%;
}

.app-store--nav img {
  width: 120px;
  height: auto;
}

.app-store--hero {
  margin-top: clamp(20px, 3vh, 28px);
}

.app-store--hero img {
  width: clamp(148px, 18vw, 168px);
  height: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  column-gap: clamp(24px, 4vw, 48px);
  min-height: 0;
}

.hero__copy {
  max-width: 28rem;
  opacity: 0;
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.25rem, 6.4vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.hero__subtitle {
  margin: clamp(16px, 2.4vh, 24px) 0 0;
  max-width: 26rem;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.45vw, 1.3rem);
  line-height: 1.4;
  letter-spacing: -0.025em;
  font-weight: 400;
}

.hero__asset {
  margin: 0;
  justify-self: end;
  align-self: center;
  height: min(72dvh, 620px);
  width: auto;
  max-width: min(100%, 300px);
  opacity: 0;
  animation: rise-phone 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.28s forwards;
}

.hero__asset img {
  width: auto;
  height: 100%;
  max-height: inherit;
  object-fit: contain;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  opacity: 0;
  animation: fade 0.6s ease 0.55s forwards;
}

.legal__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.legal__link:hover,
.legal__link:focus-visible {
  color: var(--ink);
  text-decoration: none;
}

.legal__sep {
  color: var(--muted);
  font-size: 0.78rem;
  opacity: 0.7;
}

.overlay[hidden] {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding:
    calc(16px + var(--safe-top))
    calc(16px + var(--safe-right))
    calc(16px + var(--safe-bottom))
    calc(16px + var(--safe-left));
}

.overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(49, 51, 50, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.2s ease;
}

.overlay__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(78dvh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 22px;
  box-shadow: var(--shadow);
  outline: none;
  animation: panel-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px 22px;
  border-bottom: 1px solid rgba(49, 51, 50, 0.08);
}

.overlay__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.overlay__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 1.75rem;
  line-height: 1;
}

.overlay__close:hover,
.overlay__close:focus-visible {
  background: rgba(49, 51, 50, 0.06);
  color: var(--ink);
}

.overlay__body {
  overflow: auto;
  padding: 8px 22px 28px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
  -webkit-overflow-scrolling: touch;
}

.overlay__body h3 {
  margin: 1.35em 0 0.4em;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overlay__body p,
.overlay__body ul {
  margin: 0 0 0.85em;
}

.overlay__body ul {
  padding-left: 1.15em;
}

.overlay__body li + li {
  margin-top: 0.4em;
}

.overlay__body strong {
  color: var(--ink);
  font-weight: 600;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise-phone {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    gap: 10px;
  }

  .hero__copy {
    max-width: 22rem;
  }

  .hero__subtitle {
    margin-inline: auto;
    max-width: 20rem;
  }

  .app-store--hero {
    justify-content: center;
  }

  .hero__asset {
    justify-self: center;
    height: min(44dvh, 420px);
    max-width: min(100%, 210px);
  }

  .hero__title {
    font-size: clamp(2.6rem, 9.5vw, 3.75rem);
  }
}

@media (max-width: 420px) {
  .brand__word {
    font-size: 1.25rem;
  }

  .app-store--nav img {
    width: 104px;
  }

  .hero__asset {
    height: min(40dvh, 360px);
    max-width: 180px;
  }

  .hero__asset img {
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .hero__copy,
  .hero__asset,
  .legal,
  .overlay__backdrop,
  .overlay__panel {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .app-store:active {
    transform: none;
  }
}
