/* ============================================================
   Mônica Guerra · Link in Bio
   Design system: warm terracotta + cream · Playfair + Inter
   ============================================================ */

:root {
  /* Palette — Recipe & Cooking warm terracotta */
  --c-bg-1:        #9A3412;   /* terracotta core */
  --c-bg-2:        #7C2D12;   /* deep burnt */
  --c-bg-3:        #571B0B;   /* darkest edge */
  --c-glow-1:      #F97316;   /* orange glow */
  --c-glow-2:      #FB923C;   /* amber light */
  --c-cream:       #FFF8EE;   /* card cream alt */
  --c-card:        #FFFFFF;
  --c-card-hover:  #FFFCF6;
  --c-ink:         #1F1F1F;
  --c-ink-2:       #4B5563;
  --c-ink-3:       #6B7280;
  --c-gold-1:      #E2B66B;
  --c-gold-2:      #B0762A;
  --c-accent:      #059669;
  --c-on-dark:     #FFFFFF;
  --c-on-dark-2:   rgba(255,255,255,.78);
  --c-on-dark-3:   rgba(255,255,255,.55);
  --c-border-soft: rgba(31,31,31,.06);
  --c-border:      rgba(31,31,31,.10);
  --c-shadow-warm: 0 18px 40px -20px rgba(76, 19, 6, .55);
  --c-shadow-card: 0 2px 8px rgba(76, 19, 6, .08), 0 10px 24px -12px rgba(76, 19, 6, .25);
  --c-shadow-hover: 0 4px 14px rgba(76, 19, 6, .14), 0 22px 40px -16px rgba(76, 19, 6, .40);

  /* Typography */
  --font-display: "Playfair Display", "Times New Roman", Georgia, serif;
  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  /* Spacing scale (4pt) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;
  --s-9: 48px; --s-10: 64px; --s-11: 80px;

  /* Radius */
  --r-sm: 12px; --r-md: 18px; --r-lg: 22px; --r-xl: 28px; --r-pill: 999px;

  /* Container */
  --container: 580px;

  /* Motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 160ms;
  --t-base: 220ms;
  --t-slow: 380ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-ink);
  background: var(--c-bg-2);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  padding-bottom: env(safe-area-inset-bottom);
  padding-top: env(safe-area-inset-top);
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--c-gold-1);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Aurora background (lean GPU-friendly) ----------
   Trades 3 animated blurred glows + SVG turbulence noise for two
   static radial gradients painted by the compositor. Same warmth,
   fraction of the cost. */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  will-change: auto;
  background:
    radial-gradient(60vmin 50vmin at 18% -5%,  rgba(249, 115, 22, .55), transparent 70%),
    radial-gradient(70vmin 60vmin at 95% 38%,  rgba(245, 158, 11, .30), transparent 70%),
    radial-gradient(ellipse 95% 70% at 50% -10%, var(--c-glow-2) 0%, var(--c-bg-1) 28%, var(--c-bg-2) 58%, var(--c-bg-3) 100%);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(var(--s-4), env(safe-area-inset-top)) var(--s-5) var(--s-3);
  background: linear-gradient(to bottom, rgba(0,0,0,.05), rgba(0,0,0,0));
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  color: var(--c-on-dark);
  background: rgba(124, 45, 18, .55);
  border: 1px solid rgba(255,255,255,.22);
  transition: background var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.icon-btn:hover { background: rgba(124, 45, 18, .80); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Page container ---------- */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-3) var(--s-5) var(--s-9);
}

/* ---------- Profile ---------- */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0 var(--s-6);
  text-align: center;
}
.avatar-frame {
  position: relative;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
}
.avatar-frame__ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 220deg, var(--c-gold-1), #F4D38B, var(--c-gold-2), #F8B26A, var(--c-gold-1));
  box-shadow: 0 6px 18px rgba(255, 198, 109, .25);
}
.avatar-frame::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--c-bg-2);
}
.avatar {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 12px 24px -8px rgba(0,0,0,.35), 0 0 0 3px rgba(255,255,255,.18);
}
.profile-name {
  margin: var(--s-2) 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 6vw, 34px);
  letter-spacing: -.01em;
  color: var(--c-on-dark);
  text-shadow: 0 2px 16px rgba(0,0,0,.25);
}
.profile-tagline {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-on-dark-2);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.profile-tagline .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-gold-1);
  box-shadow: 0 0 12px var(--c-gold-1);
}

/* ---------- Section title ---------- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  margin: var(--s-3) 0 var(--s-6);
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 18px;
  color: var(--c-on-dark);
  letter-spacing: .01em;
}
.section-title__ornament {
  flex: 0 0 36px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--c-on-dark-3), transparent);
}

/* ---------- Chip bar (categoria) ---------- */
.chip-bar {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 calc(var(--s-5) * -1) var(--s-5);
  padding: var(--s-2) var(--s-5);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.chip-bar::-webkit-scrollbar { display: none; }

.tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: var(--c-on-dark);
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .005em;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
  cursor: pointer;
}
.tag:hover { background: rgba(255,255,255,.18); }
.tag svg { width: 14px; height: 14px; opacity: .85; }
.tag .tag__count {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,.15);
  padding: 1px 7px;
  border-radius: var(--r-pill);
  color: var(--c-on-dark-2);
}
.tag.is-active {
  background: #FFF;
  color: var(--c-bg-2);
  border-color: #FFF;
}
.tag.is-active .tag__count {
  background: rgba(124, 45, 18, .12);
  color: var(--c-bg-2);
}

/* ---------- Sections ---------- */
.sections {
  display: flex;
  flex-direction: column;
  gap: var(--s-7);
}
.section {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  scroll-margin-top: 72px;
  content-visibility: auto;
  contain-intrinsic-size: 1px 600px;
}
.section__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: 0 var(--s-1) var(--s-1);
}
.section__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,.10);
  color: var(--c-on-dark);
  border: 1px solid rgba(255,255,255,.18);
  flex-shrink: 0;
}
.section__icon svg { width: 18px; height: 18px; }
.section__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: 18px;
  color: var(--c-on-dark);
  line-height: 1.1;
}
.section__subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--c-on-dark-2);
  letter-spacing: .005em;
}
.section__badge {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--c-on-dark-2);
  background: rgba(255,255,255,.10);
  border-radius: var(--r-pill);
  padding: 4px 9px;
  border: 1px solid rgba(255,255,255,.16);
}

/* ---------- Links (cards container per section) ---------- */
.links {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* ---------- Link card ---------- */
.link-card {
  --pad: var(--s-3);
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr 44px;
  align-items: center;
  gap: var(--s-3);
  padding: var(--pad);
  background: var(--c-card);
  border-radius: var(--r-xl);
  box-shadow: var(--c-shadow-card);
  border: 1px solid var(--c-border-soft);
  color: var(--c-ink);
  min-height: 76px;
  transition:
    transform var(--t-base) var(--ease-spring),
    box-shadow var(--t-base) var(--ease-out),
    background var(--t-fast) var(--ease-out);
  isolation: isolate;
}
.link-card:hover {
  transform: translateY(-2px);
  background: var(--c-card-hover);
  box-shadow: var(--c-shadow-hover);
}
.link-card:active { transform: translateY(0) scale(.985); transition-duration: 90ms; }

/* Soft entrance on first paint only (no per-card stagger animation overhead) */
.section { opacity: 0; transform: translateY(8px); animation: rise .35s var(--ease-out) forwards; }
@keyframes rise {
  to { opacity: 1; transform: none; }
}

.thumb {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-cream);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(31,31,31,.04);
}
.thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.thumb--icon {
  background: linear-gradient(135deg, #FEE2C7 0%, #FCD0A8 100%);
  color: var(--c-bg-2);
}
.thumb--icon svg { width: 28px; height: 28px; }

.link-card__title {
  position: relative;
  z-index: 1;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  color: var(--c-ink);
  letter-spacing: -.005em;
  text-align: center;
  /* hyphenate long words */
  word-break: break-word;
  hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 0 var(--s-1);
}

.kebab {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  color: var(--c-ink-3);
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast);
}
.kebab svg { width: 18px; height: 18px; }
.kebab:hover { background: rgba(154, 52, 18, .08); color: var(--c-bg-2); }
.kebab:active { transform: scale(.9); }

/* ---------- Special card: Ebook (no remote thumb) ---------- */
.link-card--ebook .thumb {
  background: linear-gradient(135deg, #FFF4DF 0%, #F5C988 100%);
  color: var(--c-bg-2);
}
.link-card--ebook .thumb svg {
  width: 28px; height: 28px;
}

/* ---------- Spotify Card ---------- */
.spotify-card {
  position: relative;
  background: linear-gradient(140deg, #0F0F0F 0%, #1B1B1B 100%);
  border-radius: var(--r-xl);
  box-shadow: var(--c-shadow-card);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.spotify-card__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4) var(--s-3);
  color: #FFF;
}
.spotify-card__head svg.brand { width: 24px; height: 24px; color: #1DB954; flex-shrink: 0; }
.spotify-card__head h3 {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  flex: 1;
  min-width: 0;
}
.spotify-card__head .badge {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #1DB954;
  background: rgba(29, 185, 84, .12);
  border-radius: var(--r-pill);
  padding: 4px 10px;
  flex-shrink: 0;
}
.spotify-card iframe {
  width: 100%;
  height: 152px;
  border: 0;
  display: block;
}
.spotify-card__placeholder {
  height: 152px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #131313 0%, #1A1A1A 100%);
  color: rgba(255,255,255,.55);
  font-size: 13px;
  letter-spacing: .02em;
}
.spotify-card__placeholder svg {
  width: 28px; height: 28px;
  color: #1DB954;
  margin-right: 10px;
  animation: spotifyPulse 1.6s ease-in-out infinite;
}
@keyframes spotifyPulse {
  0%, 100% { opacity: .4; }
  50%      { opacity: 1; }
}

/* ---------- Footer ---------- */
.page-footer {
  text-align: center;
  padding: var(--s-9) 0 var(--s-4);
  color: var(--c-on-dark-2);
}
.page-footer__signature {
  margin: 0 0 var(--s-2);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--c-on-dark-2);
}
.page-footer__credit {
  margin: 0;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-on-dark-3);
}

/* ---------- QR Sidebar ---------- */
.qr-sidebar {
  display: none;
  position: fixed;
  top: 50%;
  right: var(--s-7);
  transform: translateY(-50%);
  z-index: 20;
  text-align: center;
  color: var(--c-on-dark);
  pointer-events: auto;
}
.qr-sidebar__label {
  margin: 0 0 var(--s-3);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--c-on-dark-2);
  letter-spacing: .01em;
}
.qr-sidebar__card {
  background: #FFF;
  padding: 12px;
  border-radius: var(--r-lg);
  box-shadow: var(--c-shadow-warm);
  display: inline-block;
}
.qr-sidebar__card img { display: block; width: 160px; height: 160px; }
.qr-sidebar__hint {
  margin: var(--s-3) 0 0;
  font-size: 11px;
  color: var(--c-on-dark-3);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---------- Share dialog ---------- */
.share-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(420px, 92vw);
  border-radius: var(--r-xl);
  box-shadow: 0 24px 60px -8px rgba(0,0,0,.5);
  color: var(--c-ink);
}
.share-dialog::backdrop {
  background: rgba(20, 8, 4, .55);
  backdrop-filter: blur(8px);
}
.share-dialog__form {
  background: #FFF;
  border-radius: var(--r-xl);
  padding: var(--s-6);
}
.share-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-2);
}
.share-dialog__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
}
.share-dialog__close {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  color: var(--c-ink-3);
}
.share-dialog__close:hover { background: var(--c-border-soft); color: var(--c-ink); }
.share-dialog__close svg { width: 18px; height: 18px; }

.share-dialog__desc {
  margin: 0 0 var(--s-4);
  color: var(--c-ink-3);
  font-size: 13px;
}
.share-dialog__url {
  display: flex;
  gap: var(--s-2);
  background: var(--c-cream);
  border-radius: var(--r-md);
  padding: 6px;
  margin-bottom: var(--s-5);
  border: 1px solid var(--c-border);
}
.share-dialog__url input {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 0 var(--s-3);
  font-size: 13px;
  color: var(--c-ink);
  font-family: var(--font-sans);
  min-width: 0;
}
.share-dialog__url input:focus { outline: none; }
.share-dialog__copy {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--c-bg-2);
  color: #FFF;
  transition: background var(--t-fast) var(--ease-out), transform var(--t-fast);
}
.share-dialog__copy:hover { background: var(--c-bg-1); }
.share-dialog__copy:active { transform: scale(.92); }
.share-dialog__copy svg { width: 16px; height: 16px; }
.share-dialog__copy .ico-check { display: none; }
.share-dialog__copy.copied .ico-copy { display: none; }
.share-dialog__copy.copied .ico-check { display: block; }
.share-dialog__copy.copied { background: var(--c-accent); }

.share-dialog__qr {
  text-align: center;
  margin-bottom: var(--s-5);
}
.share-dialog__qr img {
  margin: 0 auto;
  width: 160px;
  height: 160px;
  border-radius: var(--r-md);
}
.share-dialog__qr p {
  margin: var(--s-3) 0 0;
  font-size: 12px;
  color: var(--c-ink-3);
}

.share-dialog__channels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-2);
}
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--c-cream);
  font-weight: 600;
  font-size: 13px;
  color: var(--c-ink);
  transition: background var(--t-fast) var(--ease-out), transform var(--t-fast);
  border: 1px solid var(--c-border-soft);
}
.chip:hover { background: #FFEFD9; }
.chip:active { transform: scale(.97); }
.chip svg { width: 16px; height: 16px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: calc(var(--s-7) + env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 24px);
  background: var(--c-ink);
  color: #FFF;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 32px -10px rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
  z-index: 100;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Responsive ---------- */
@media (min-width: 720px) {
  .page { padding-top: var(--s-5); }
  .topbar { padding: var(--s-4) var(--s-7) var(--s-3); }
  .avatar-frame, .avatar { width: 132px; height: 132px; }
  .section-title { font-size: 20px; }
}

@media (min-width: 1100px) {
  .qr-sidebar { display: block; }
  .page { padding-right: 0; }
}

@media (min-width: 1280px) {
  .qr-sidebar { right: var(--s-9); }
}

/* iPhone safe-area aware bottom space already handled via env() */

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .link-card { opacity: 1; transform: none; }
  .aurora__glow { animation: none; }
  .avatar-frame__ring { animation: none; }
}

/* ---------- Print ---------- */
@media print {
  .topbar, .qr-sidebar, .share-dialog, .toast { display: none !important; }
  .aurora { display: none; }
  body { background: #FFF; color: #000; }
  .link-card { box-shadow: none; border: 1px solid #DDD; break-inside: avoid; }
}
