@font-face {
  font-family: "Chau Philomene One";
  src: url("assets/fonts/ChauPhilomeneOne-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #16344f;
  --muted: #607486;
  --paper: #fffdf8;
  --line: #d9e2e8;
  --accent: #ef765f;
  --accent-dark: #c94e3a;
  --sun: #f7c94b;
  --sky: #dff2f7;
  --whatsapp: #25d366;
  --whatsapp-dark: #1da851;
  --shadow: 0 24px 70px rgba(22, 52, 79, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: #eef6f7;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(247, 201, 75, 0.25), transparent 23rem),
    radial-gradient(circle at 92% 96%, rgba(115, 190, 201, 0.22), transparent 28rem),
    #eef6f7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Chau Philomene One", sans-serif;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

h1 {
  margin-bottom: 0.9rem;
  font-size: clamp(2.3rem, 5.2vw, 3.7rem);
}

h2 {
  margin-bottom: 0.6rem;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

a {
  color: #1c7f8c;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: #267e89;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.description {
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

/* --- header --------------------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 3vw, 3rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(238, 246, 247, 0.86);
  backdrop-filter: blur(14px);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}

.site-brand-name {
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  color: #7d5700;
  background: var(--sun);
  box-shadow: 0 6px 18px rgba(247, 201, 75, 0.4);
  font-size: 1.25rem;
}

.site-nav {
  display: flex;
  flex: 1 1 auto;
  gap: 1.4rem;
  justify-content: center;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

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

.site-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.language-switch {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.language-switch button {
  min-width: 2.6rem;
  padding: 0.35rem 0.1rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.language-switch button.is-current {
  background: var(--ink);
  color: #fff;
}

/* --- buttons -------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 50px;
  padding: 0.75rem 1.35rem;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

.button:not(:disabled):hover {
  transform: translateY(-2px);
}

.button:focus-visible {
  outline: 3px solid rgba(83, 168, 178, 0.35);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-compact {
  min-height: 40px;
  padding: 0.4rem 0.95rem;
  font-size: 0.86rem;
}

.button-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 25px rgba(239, 118, 95, 0.28);
}

.button-primary:not(:disabled):hover {
  background: var(--accent-dark);
}

.button-secondary {
  color: #276c75;
  background: var(--sky);
}

.button-whatsapp {
  background: var(--whatsapp);
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.3);
}

.button-whatsapp:not(:disabled):hover {
  background: var(--whatsapp-dark);
}

/* --- landing -------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 3vw, 3rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.6rem 0 0.9rem;
}

.hero-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.hero-panel {
  padding: clamp(0.6rem, 1.5vw, 1.2rem);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-panel svg {
  display: block;
  width: 100%;
  height: auto;
}

.band {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 3vw, 3rem);
}

.band-tint {
  width: 100%;
  max-width: none;
  background: rgba(255, 253, 248, 0.62);
}

.band-tint > * {
  width: min(1200px, 100%);
  margin-inline: auto;
}

.band-head {
  max-width: 52ch;
  margin-bottom: 2rem;
}

.band-body {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.band-actions {
  margin: 1.75rem 0 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  padding: 1.4rem 1.3rem;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(22, 52, 79, 0.07);
}

.step-number {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 0.9rem;
  place-items: center;
  border-radius: 11px;
  background: var(--sky);
  color: #1c7f8c;
  font-weight: 800;
}

.steps p,
.feature p,
.faq p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.feature {
  padding-top: 1.1rem;
  border-top: 3px solid var(--sun);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.9rem;
}

.gallery-card {
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(22, 52, 79, 0.1);
}

.gallery-card img {
  display: block;
  width: 100%;
  height: auto;
}

.faq {
  display: grid;
  gap: 0.6rem;
  max-width: 68ch;
}

.faq details {
  padding: 0.95rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
}

.faq details[open] summary {
  margin-bottom: 0.55rem;
}

.closing {
  text-align: center;
}

.closing p {
  margin-bottom: 1.5rem;
  color: var(--muted);
}

.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: center;
  padding: 2rem 1rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-contact a {
  color: inherit;
}

/* --- the order page ------------------------------------------------------- */

.app-shell {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 3rem);
}

.intro {
  max-width: 60ch;
}

.top-row {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 3rem);
  align-items: start;
}

.controls {
  position: sticky;
  top: 5.5rem;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.customizer {
  display: grid;
  gap: 0.9rem;
}

.customizer label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.customizer input,
.customizer select {
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.customizer input:focus,
.customizer select:focus {
  border-color: #53a8b2;
  box-shadow: 0 0 0 4px rgba(83, 168, 178, 0.15);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

/* The native file control is kept (its text follows the browser's own
   language) but it sits oddly beside the other fields: unpadded, with a grey
   system button in the middle of a soft form. */
.customizer input[type="file"] {
  padding: 0.5rem 0.55rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.customizer input[type="file"]::file-selector-button {
  margin-right: 0.7rem;
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: 10px;
  background: var(--sky);
  color: #276c75;
  cursor: pointer;
  font-weight: 700;
}

.customizer input[type="file"]:hover::file-selector-button {
  background: #cdeaf1;
}

.field-hint {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.field-error {
  margin: 0.5rem 0 0;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.8rem;
  line-height: 1.45;
}

/* Big enough to judge the photo by: this is the customer's only chance to see
   that the face is sharp, well lit and not half out of frame before it becomes
   the character on 24 cards. */
.photo-preview {
  display: grid;
  gap: 0.5rem;
  justify-items: start;
  margin-top: 0.7rem;
}

/* The attribute alone loses to display:flex, which would leave an empty box
   with the alt text showing in it. */
.photo-preview[hidden] {
  display: none;
}

.photo-preview img {
  width: 100%;
  max-width: 190px;
  aspect-ratio: 1;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(22, 52, 79, 0.16);
}

.photo-preview span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.language-badge {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--sky);
  color: #1c7f8c;
  font-size: 0.75rem;
  font-weight: 800;
}

.preview-frame {
  position: relative;
  padding: clamp(0.6rem, 1.5vw, 1.1rem);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.loading-placeholder {
  display: grid;
  place-items: center;
  min-height: 12rem;
}

.hero-panel[data-ready="true"] .loading-placeholder,
.preview-frame[data-ready="true"] .loading-placeholder {
  display: none;
}

.loading-placeholder span {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(83, 168, 178, 0.25);
  border-top-color: #53a8b2;
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

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

/* --- the picker ----------------------------------------------------------- */

.picker-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.picker-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.picker-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.picker-note {
  max-width: 70ch;
  margin: 0.6rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.counter {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.counter[data-state="full"] {
  background: #dcfce7;
  color: #166534;
}

.picker-error,
.picker-loading {
  color: var(--muted);
  font-size: 0.9rem;
}

.picker-error {
  color: #b91c1c;
}

.picker-group + .picker-group {
  margin-top: 1.5rem;
}

.picker-group h3 {
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-grid {
  display: grid;
  /* Under the 200px thumbnails, so they never upscale on a normal display. */
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
}

.card-tile {
  position: relative;
  display: block;
  padding: 0.4rem;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
  cursor: pointer;
  transition: border-color 120ms ease, opacity 120ms ease, transform 120ms ease;
}

.card-tile:hover:not(:disabled) {
  border-color: #bfdbfe;
  transform: translateY(-2px);
}

.card-tile.is-picked {
  border-color: #2563eb;
  background: #eff6ff;
}

.card-tile:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.card-art {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  place-items: center;
  border-radius: 12px;
  background: #f1f5f9;
}

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

.card-art-empty {
  padding: 0.5rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.card-order {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  min-width: 1.6rem;
  height: 1.6rem;
  place-items: center;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

/* --- sending -------------------------------------------------------------- */

.send-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.send-panel h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}

.send-panel p {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.send-missing {
  margin-top: 0.6rem !important;
  color: #b45309 !important;
  font-weight: 700;
}

.send-actions {
  display: grid;
  gap: 0.6rem;
  min-width: min(320px, 100%);
}

/* --- the confirmation dialog ---------------------------------------------- */

.busy {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(22, 52, 79, 0.45);
  backdrop-filter: blur(3px);
}

.busy[hidden] {
  display: none;
}

.busy-card {
  width: min(30rem, 100%);
  padding: 2rem;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}

.busy-card p {
  color: var(--muted);
}

.sent-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 1rem;
  place-items: center;
  border-radius: 50%;
  background: #dcfce7;
  color: #166534;
  font-size: 1.6rem;
}

.sent-actions {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* --- narrow screens ------------------------------------------------------- */

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .top-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .controls {
    position: static;
  }

  .preview-section {
    order: -1;
  }
}

@media (max-width: 760px) {
  .site-nav {
    display: none;
  }
}

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .send-panel,
  .hero-actions .button {
    width: 100%;
  }
}
