:root {
  --color-bg: #070706;
  --color-surface: #0e0d0b;
  --color-surface-raised: #17140f;
  --color-gold: #f4c75d;
  --color-gold-strong: #ffd978;
  --color-gold-dark: #9f7227;
  --color-text: #fffaf0;
  --color-muted: #c9bda7;
  --color-border: rgba(244, 199, 93, 0.24);
  --color-border-strong: rgba(244, 199, 93, 0.5);
  --shadow-card: 0 32px 80px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 12px 36px rgba(191, 131, 32, 0.18);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-full: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --transition-fast: 180ms ease;
  --font-display: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  min-width: 320px;
  background: var(--color-bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--color-text);
  background:
    radial-gradient(circle at 50% -12%, rgba(244, 199, 93, 0.16), transparent 36rem),
    radial-gradient(circle at 8% 72%, rgba(150, 96, 22, 0.08), transparent 28rem),
    var(--color-bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  mask-image: radial-gradient(circle at center, black 0%, transparent 72%);
  pointer-events: none;
}

a {
  color: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100dvh;
  place-items: center;
  padding:
    max(var(--space-5), env(safe-area-inset-top))
    var(--space-4)
    max(var(--space-5), env(safe-area-inset-bottom));
}

.profile-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  min-width: 0;
  overflow: hidden;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 30%),
    rgba(14, 13, 11, 0.94);
  box-shadow: var(--shadow-card), inset 0 1px rgba(255, 255, 255, 0.04);
  isolation: isolate;
}

.profile-card::before {
  position: absolute;
  top: -8rem;
  left: 50%;
  z-index: -1;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgba(244, 199, 93, 0.12);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 199, 93, 0.09), transparent 66%);
  content: "";
  transform: translateX(-50%);
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 var(--space-4);
  color: var(--color-gold);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.portrait-frame {
  position: relative;
  width: min(62vw, 220px);
  overflow: hidden;
  padding: var(--space-1);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--color-gold-strong), var(--color-gold-dark) 45%, #33220b);
  box-shadow: var(--shadow-gold);
}

.portrait-frame::after {
  position: absolute;
  inset: var(--space-1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius-md) - var(--space-1));
  content: "";
  pointer-events: none;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-md) - var(--space-1));
  background: #090909;
}

h1 {
  max-width: 100%;
  margin: var(--space-5) 0 var(--space-2);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 8vw, 2.5rem);
  font-weight: 600;
  letter-spacing: 0.035em;
  line-height: 1.08;
  overflow-wrap: break-word;
}

.handle {
  min-height: 44px;
  padding: 10px var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-gold-strong);
  background: rgba(244, 199, 93, 0.06);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 22px;
  text-decoration: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.intro {
  max-width: 30ch;
  margin: var(--space-4) 0 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.link-list {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.link-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  gap: var(--space-3);
  align-items: center;
  min-height: 72px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: var(--color-surface-raised);
  text-decoration: none;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.link-card--primary {
  border-color: var(--color-gold);
  color: #211706;
  background: linear-gradient(135deg, var(--color-gold-strong), var(--color-gold) 55%, #d99f36);
  box-shadow: 0 12px 28px rgba(191, 131, 32, 0.18);
}

.link-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-gold);
  background: rgba(244, 199, 93, 0.065);
}

.link-card--primary .link-icon {
  border-color: rgba(33, 23, 6, 0.18);
  color: #211706;
  background: rgba(33, 23, 6, 0.08);
}

.link-icon svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.social-icon--whatsapp {
  color: #25d366;
}

.link-card--primary .social-icon--whatsapp {
  color: #128c4a;
}

.social-icon--youtube {
  color: #ff0033;
}

.social-icon--instagram {
  color: #d62976;
  fill: url(#instagram-gradient);
}

.link-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.link-copy strong {
  font-size: 0.95rem;
  font-weight: 720;
  line-height: 1.3;
}

.link-copy small {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.link-card--primary .link-copy small {
  color: rgba(33, 23, 6, 0.75);
}

.link-arrow {
  color: var(--color-gold);
  font-size: 1.2rem;
  line-height: 1;
  text-align: right;
}

.link-card--primary .link-arrow {
  color: #211706;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-6);
  color: #9f9583;
  font-size: 0.75rem;
  text-align: center;
}

.site-footer a {
  min-height: 24px;
  color: var(--color-muted);
  text-underline-offset: 3px;
}

.handle:hover,
.site-footer a:hover {
  color: var(--color-gold-strong);
}

.handle:hover {
  border-color: var(--color-border-strong);
  background: rgba(244, 199, 93, 0.1);
}

.link-card:hover {
  border-color: var(--color-border-strong);
  background: #1d1912;
  transform: translateY(-2px);
}

.link-card--primary:hover {
  border-color: var(--color-gold-strong);
  background: linear-gradient(135deg, #ffe28f, var(--color-gold-strong) 55%, #e6ad43);
}

.link-card:not(.link-card--primary) .link-icon:has(.social-icon--whatsapp) {
  color: #25d366;
}

.link-card:not(.link-card--primary) .link-icon:has(.social-icon--youtube) {
  color: #ff0033;
}

.link-card:not(.link-card--primary) .link-icon:has(.social-icon--instagram) {
  color: #d62976;
}

a:focus-visible {
  outline: 3px solid #fff2c3;
  outline-offset: 3px;
}

.profile-header > *,
.link-card,
.site-footer {
  animation: reveal 520ms cubic-bezier(0.2, 0.75, 0.3, 1) both;
}

.profile-header > :nth-child(2) { animation-delay: 60ms; }
.profile-header > :nth-child(3) { animation-delay: 100ms; }
.profile-header > :nth-child(4) { animation-delay: 140ms; }
.profile-header > :nth-child(5) { animation-delay: 180ms; }
.link-card:nth-child(1) { animation-delay: 220ms; }
.link-card:nth-child(2) { animation-delay: 280ms; }
.link-card:nth-child(3) { animation-delay: 340ms; }
.site-footer { animation-delay: 400ms; }

@keyframes reveal {
  from {
    transform: translateY(10px);
  }
  to {
    transform: translateY(0);
  }
}

.error-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: var(--space-5);
  text-align: center;
}

.error-content {
  width: min(100%, 440px);
  padding: var(--space-7) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.error-code {
  margin: 0;
  color: var(--color-gold);
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
}

.error-content h1 {
  margin-top: var(--space-4);
}

.error-content p:not(.error-code) {
  color: var(--color-muted);
}

.home-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-4);
  padding: 0 var(--space-5);
  border-radius: var(--radius-full);
  color: #211706;
  background: var(--color-gold);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 359px) {
  .page-shell {
    padding-right: var(--space-2);
    padding-left: var(--space-2);
  }

  .profile-card {
    padding: var(--space-4);
    border-radius: var(--radius-md);
  }

  .link-card {
    grid-template-columns: 40px minmax(0, 1fr) 20px;
    gap: var(--space-2);
    padding-right: var(--space-3);
    padding-left: var(--space-3);
  }

  .link-icon {
    width: 40px;
    height: 40px;
  }
}

@media (min-width: 768px) {
  .page-shell {
    padding-top: var(--space-7);
    padding-bottom: var(--space-7);
  }

  .profile-card {
    padding: var(--space-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Paleta suave da página principal. */
body:has(.page-shell) {
  --color-bg: #101511;
  --color-surface-raised: #19221c;
  --color-text: #f4f6f3;
  --color-muted: #bdc7bf;
  --color-border: rgba(127, 160, 136, .24);
  --color-border-strong: rgba(127, 180, 141, .5);
  --color-gold: #c6ab75;
  --color-gold-strong: #d8c49a;
  --color-gold-dark: #766440;
  --shadow-card: 0 28px 70px rgba(0, 0, 0, .32);
  --shadow-gold: 0 8px 24px rgba(0, 0, 0, .2);
  background: radial-gradient(circle at 50% 0%, #1b2c20, transparent 36rem), #101511;
}

.page-shell .profile-card {
  background: #151c17;
}

.page-shell .profile-card::before {
  border-color: rgba(185, 164, 115, .12);
  background: radial-gradient(circle, rgba(74, 125, 87, .12), transparent 66%);
}

.page-shell .portrait-frame {
  background: #736243;
  border-color: rgba(198, 171, 117, .55);
}

.page-shell .handle {
  color: #d8c49a;
  background: rgba(198, 171, 117, .05);
}

.page-shell .link-card--primary {
  border-color: rgba(79, 177, 112, .65);
  color: #f4f8f5;
  background: #214431;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}

.page-shell .link-icon,
.page-shell .link-card--primary .link-icon {
  border-color: rgba(127, 160, 136, .28);
  background: rgba(0, 0, 0, .14);
}

.page-shell .link-card--primary .social-icon--whatsapp { color: #25d366; }
.page-shell .link-card--primary .link-copy small { color: #c8d8cd; }
.page-shell .link-card--primary .link-arrow { color: #a9d7b5; }
.page-shell .link-card:hover { background: #202e24; }
.page-shell .link-card--primary:hover { border-color: #62c884; background: #28543a; }
.page-shell .handle:hover { background: rgba(198, 171, 117, .08); }
.page-shell a:focus-visible { outline-color: #91e1aa; }

/* Sequência de entrada e resposta ao toque na página principal. */
@media (prefers-reduced-motion: no-preference) {
  .page-shell .profile-card { animation: card-enter 480ms ease-out both; }
  .page-shell .profile-header > *,
  .page-shell .link-card,
  .page-shell .site-footer { animation: content-enter 420ms ease-out both; }
  .page-shell .profile-header .eyebrow { animation-delay: 60ms; }
  .page-shell .profile-header .portrait-frame { animation: portrait-enter 560ms ease-out 80ms both; }
  .page-shell .profile-header h1 { animation-delay: 160ms; }
  .page-shell .profile-header .handle { animation-delay: 200ms; }
  .page-shell .profile-header .intro { animation-delay: 240ms; }
  .page-shell .link-card:nth-child(1) { animation: content-enter 420ms ease-out 280ms both, primary-glow 900ms ease-out 700ms; }
  .page-shell .link-card:nth-child(2) { animation-delay: 340ms; }
  .page-shell .link-card:nth-child(3) { animation-delay: 400ms; }
  .page-shell .site-footer { animation-delay: 440ms; }
  .page-shell .link-icon, .page-shell .link-arrow { transition: transform 180ms ease; }
  .page-shell .link-card:active { transform: scale(.98); background: #2a3c2f; }
  .page-shell .link-card--primary:active { background: #326446; }
  @media (hover: hover) {
    .page-shell .link-card:hover .link-icon { transform: scale(1.08); }
    .page-shell .link-card:hover .link-arrow { transform: translate(3px, -3px); }
    .page-shell .link-card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
  }
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes portrait-enter {
  0% { opacity: 0; transform: scale(.97); }
  65% { opacity: 1; box-shadow: 0 0 24px rgba(198, 171, 117, .28); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes content-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes primary-glow {
  50% { box-shadow: 0 0 22px rgba(79, 177, 112, .28); }
}
