/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  --cream: #f7f3ed;
  --cream-dark: #e8e0d4;
  --white: #ffffff;
  --ink: #2c2a26;
  --ink-soft: #5c574f;
  --sage: #708460;
  --sage-dark: #556648;
  --sage-light: #e8ede4;
  --success-bg: #eef4ea;
  --success-ink: #3d5235;
  --error-bg: #faf0ed;
  --error-ink: #7a4a3d;
  --border: rgba(44, 42, 38, 0.08);
  --shadow: 0 12px 40px rgba(44, 42, 38, 0.08);

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --radius: 18px;
  --max-width: 420px;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(ellipse at top, var(--white) 0%, transparent 60%),
    var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.app {
  width: 100%;
  max-width: var(--max-width);
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 2rem 1.5rem 1.75rem;
  text-align: center;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
}

.hero__subtitle {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ==========================================================================
   Status
   ========================================================================== */

.status {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: opacity 0.25s ease;
}

.status[hidden] {
  display: none;
}

.status--loading {
  background: var(--sage-light);
  color: var(--sage-dark);
}

.status--success {
  background: var(--success-bg);
  color: var(--success-ink);
}

.status--error {
  background: var(--error-bg);
  color: var(--error-ink);
}

.status__spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.5rem;
  vertical-align: -0.15em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Actions
   ========================================================================== */

.actions {
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--sage);
  color: var(--white);
}

.btn--primary:hover:not(:disabled) {
  background: var(--sage-dark);
}

.btn--secondary {
  margin-top: 0.75rem;
  background: var(--sage-light);
  color: var(--sage-dark);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--cream-dark);
}

.btn__icon {
  display: flex;
  width: 1.35rem;
  height: 1.35rem;
}

.btn__icon svg {
  width: 100%;
  height: 100%;
}

.btn__icon,
.btn__label {
  pointer-events: none;
}

.btn__spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ==========================================================================
   Session gallery
   ========================================================================== */

.session-gallery {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: left;
}

.session-gallery[hidden] {
  display: none;
}

.session-gallery__title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

.session-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.session-gallery__item {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--border);
}

.session-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   State modifiers
   ========================================================================== */

.app--uploading .hero__subtitle,
.app--success .hero__subtitle {
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .status__spinner {
    animation: none;
    border-right-color: currentColor;
    opacity: 0.5;
  }

  .btn {
    transition: none;
  }
}
