:root {
  color-scheme: light;
  --app-ivory: #f5f0e8;
  --app-paper: #fffdf9;
  --app-ink: #1f1c18;
  --app-muted: #716b63;
  --app-accent: #b8603f;
  --app-line: rgba(31, 28, 24, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--app-ivory);
  color: var(--app-ink);
  font-family: "Poppins", sans-serif;
}

html.is-standalone,
html.is-standalone body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background-color: #17130f;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

html.is-standalone {
  overflow: hidden;
}

html.is-standalone body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(16, 14, 12, 0.08) 0%, rgba(16, 14, 12, 0.24) 32%, rgba(23, 19, 15, 0.92) 92%, #17130f 100%),
    url("/assets/hero-dog-paris-2026.webp") center 44% / cover no-repeat;
}

button,
a {
  font: inherit;
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(184, 96, 63, 0.42);
  outline-offset: 4px;
}

.app-entry {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  padding: max(18px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom));
}

html.is-standalone .app-entry {
  position: fixed;
  inset: 0;
  width: 100%;
  height: auto;
  min-height: 0;
  padding-right: max(20px, env(safe-area-inset-right));
  padding-left: max(20px, env(safe-area-inset-left));
  overflow: hidden;
  overscroll-behavior: none;
}

.app-entry-photo,
.app-entry-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.app-entry-photo {
  background: url("/assets/hero-dog-paris-2026.webp") center 44% / cover no-repeat;
  transform: scale(1.025);
  animation: app-photo-arrive 1.1s cubic-bezier(0.2, 0.72, 0.2, 1) both;
}

.app-entry-shade {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(16, 14, 12, 0.08) 0%, rgba(16, 14, 12, 0.24) 32%, rgba(23, 19, 15, 0.92) 92%, #17130f 100%),
    linear-gradient(90deg, rgba(16, 14, 12, 0.2), transparent 65%);
}

.app-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-entry-header {
  animation: app-rise 0.55s 0.06s ease-out both;
}

.app-brand {
  display: grid;
  width: 148px;
  height: 78px;
  overflow: hidden;
  place-items: center;
}

.app-brand img {
  width: 146px;
  max-width: none;
  height: auto;
  opacity: 0.94;
  transform: translateY(-18px);
}

.app-access {
  align-self: end;
  width: min(100%, 540px);
  padding: 54px 0 22px;
  color: #fff;
  animation: app-rise 0.7s 0.12s cubic-bezier(0.2, 0.72, 0.2, 1) both;
}

html:not(.is-standalone) .app-installed-view,
html.is-standalone .app-install-view {
  display: none;
}

.app-kicker {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.app-access h1 {
  max-width: 500px;
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3rem, 14vw, 5.2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.9;
}

.app-intro {
  max-width: 450px;
  margin: 18px 0 25px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  line-height: 1.55;
}

.app-access-list {
  display: grid;
  gap: 10px;
}

.app-access-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 13px 4px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: padding 0.2s ease, background 0.2s ease;
}

.app-access-button:hover,
.app-access-button:active {
  padding-right: 10px;
  padding-left: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.app-access-client {
  padding: 13px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.app-access-admin {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 42px;
  padding: 6px 2px;
  border-bottom: 0;
  color: rgba(255, 255, 255, 0.64);
}

.app-access-admin .app-access-icon,
.app-access-admin small {
  display: none;
}

.app-access-admin strong {
  font-size: 0.7rem;
  font-weight: 600;
}

.app-access-admin .app-access-arrow {
  font-size: 0.92rem;
}

.app-access-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
}

.app-access-icon svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.app-access-button strong,
.app-access-button small {
  display: block;
}

.app-access-button strong {
  font-size: 1rem;
}

.app-access-button small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.72rem;
}

.app-access-arrow {
  font-size: 1.35rem;
}

.app-install-button,
.app-dialog-action {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  border: 0;
  border-radius: 14px;
  background: var(--app-paper);
  color: var(--app-ink);
  font-weight: 700;
  cursor: pointer;
}

.app-install-button {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.app-install-button::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.65) 50%, transparent 75%);
  content: "";
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}

.app-install-button:hover {
  transform: translateY(-2px);
}

.app-install-button:hover::after {
  transform: translateX(120%);
}

.app-install-button:disabled {
  cursor: default;
  opacity: 0.8;
  transform: none;
}

.app-install-note {
  margin: 11px 2px 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.7rem;
  line-height: 1.5;
}

.app-install-dialog {
  width: min(calc(100% - 32px), 430px);
  padding: 28px;
  border: 0;
  border-radius: 24px;
  background: var(--app-paper);
  color: var(--app-ink);
  box-shadow: 0 28px 90px rgba(18, 15, 12, 0.35);
}

.app-install-dialog::backdrop {
  background: rgba(18, 15, 12, 0.62);
  backdrop-filter: blur(5px);
}

.app-install-dialog h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 2.25rem;
  line-height: 1;
}

.app-dialog-message {
  margin: 14px 0 0;
  color: var(--app-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.app-install-dialog ol {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding-left: 22px;
  color: var(--app-muted);
  line-height: 1.5;
}

.app-install-dialog [hidden] {
  display: none !important;
}

.app-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(31, 28, 24, 0.06);
  cursor: pointer;
  font-size: 1.45rem;
}

.app-dialog-action {
  background: var(--app-ink);
  color: #fff;
}

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

@keyframes app-photo-arrive {
  from { opacity: 0.7; transform: scale(1.075); }
  to { opacity: 1; transform: scale(1.025); }
}

@media (min-width: 760px) {
  .app-entry {
    padding-right: clamp(32px, 7vw, 100px);
    padding-left: clamp(32px, 7vw, 100px);
  }

  .app-access {
    padding-bottom: 34px;
  }
}

@media (max-height: 690px) {
  .app-access {
    padding-top: 28px;
  }

  .app-access h1 {
    font-size: clamp(2.7rem, 12vw, 4.2rem);
  }

  .app-intro {
    margin: 13px 0 16px;
  }

  .app-access-button {
    min-height: 66px;
  }
}

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