/* =========================================
   Dr. Sergio Maranhao - Bio Page
   Premium Design with Motion
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ---------- Tokens ---------- */
:root {
    --bg: #F2F4F7;
    --surface: #FFFFFF;
    --primary: #1A3C5E;
    --accent: #2D8C82;
    --accent-light: #3AA89E;
    --accent-dark: #236E66;
    --text: #1A1F36;
    --text-2: #5A6478;
    --text-3: #8892A4;
    --border: rgba(26, 60, 94, 0.07);
    --cta-grad: linear-gradient(135deg, #2D8C82 0%, #3AA89E 50%, #2D8C82 100%);
    --hero-overlay: linear-gradient(
        to bottom,
        rgba(12, 25, 38, 0) 0%,
        rgba(12, 25, 38, 0.03) 35%,
        rgba(12, 25, 38, 0.4) 60%,
        rgba(12, 25, 38, 0.88) 82%,
        rgba(12, 25, 38, 0.98) 100%
    );
    --r-sm: 14px;
    --r-md: 18px;
    --r-lg: 28px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.03);
    --shadow-hover: 0 8px 28px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ========== HERO ========== */
.hero {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 560px;
    overflow: hidden;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.hero-image-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 110%;
    object-fit: cover;
    object-position: center 15%;
    will-change: transform, opacity;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, transform 0.1s linear;
}

.hero-image.active {
    opacity: 1;
}

/* Fine-tune each photo's crop */
.hero-image:nth-child(1) { object-position: center 12%; }  /* bracos cruzados */
.hero-image:nth-child(2) { object-position: center 20%; }  /* ao lado do logo */
.hero-image:nth-child(3) { object-position: center 18%; }  /* no computador com estetoscopio */
.hero-image:nth-child(4) { object-position: center 30%; }  /* trabalhando notebook */

.hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--hero-overlay);
    pointer-events: none;
}

/* Ambient floating particles */
.hero-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    animation: floatUp var(--dur) var(--delay) linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(-20px) translateX(5px) scale(1);
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-260px) translateX(var(--drift)) scale(0.3);
        opacity: 0;
    }
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 28px 40px;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: rgba(45, 140, 130, 0.15);
    border: 1px solid rgba(45, 140, 130, 0.35);
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #7DD4CC;
    margin-bottom: 18px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(12px);
    animation: revealUp 0.7s var(--ease) 0.6s forwards;
}

#badgeText {
    display: inline-block;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4DE0D0;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

.hero-name {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.05;
    color: #FFFFFF;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
    opacity: 0;
    transform: translateY(20px);
    animation: revealUp 0.8s var(--ease) 0.8s forwards;
}

.hero-title {
    font-size: 0.88rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    letter-spacing: 0.3px;
    opacity: 0;
    transform: translateY(12px);
    animation: revealUp 0.7s var(--ease) 1s forwards;
}

.hero-title:nth-of-type(2) {
    animation-delay: 1.1s;
}

.hero-line {
    width: 40px;
    height: 2px;
    background: var(--accent);
    margin-top: 18px;
    border-radius: 2px;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    animation: lineGrow 0.8s var(--ease) 1.3s forwards;
}

@keyframes lineGrow {
    to { opacity: 1; transform: scaleX(1); }
}

/* Scroll indicator */
.scroll-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 0;
    animation: revealUp 0.6s var(--ease) 1.8s forwards;
    transition: opacity 0.4s ease;
}

.scroll-hint.hidden { opacity: 0; pointer-events: none; }

.scroll-mouse {
    width: 22px;
    height: 34px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 7px;
}

.scroll-dot {
    width: 3px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(8px); opacity: 0.2; }
}

/* ========== LINKS SECTION ========== */
.links-section {
    width: 100%;
    max-width: 480px;
    padding: 28px 20px 48px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

/* ---- Animated background orbs ---- */
.bg-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.35;
    will-change: transform;
}

.orb-1 {
    width: 220px;
    height: 220px;
    background: rgba(45, 140, 130, 0.25);
    top: -40px;
    right: -60px;
    animation: orbFloat1 12s ease-in-out infinite;
}

.orb-2 {
    width: 180px;
    height: 180px;
    background: rgba(58, 168, 158, 0.2);
    bottom: 20%;
    left: -70px;
    animation: orbFloat2 15s ease-in-out infinite;
}

.orb-3 {
    width: 140px;
    height: 140px;
    background: rgba(26, 60, 94, 0.12);
    top: 45%;
    right: -30px;
    animation: orbFloat3 10s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-30px, 40px) scale(1.1); }
    66% { transform: translate(20px, -20px) scale(0.95); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.15); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(-25px, 25px) scale(1.08); }
    80% { transform: translate(15px, -15px) scale(0.92); }
}

/* ---- Typewriter ---- */
.typewriter-wrap {
    text-align: center;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    padding: 0 8px;
    position: relative;
    z-index: 1;
}

.typewriter-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.3px;
}

.typewriter-cursor {
    font-weight: 300;
    color: var(--accent);
    animation: blink 1s step-end infinite;
    margin-left: 1px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Ensure cards sit above orbs */
.link-card, .accordion-card, .footer {
    position: relative;
    z-index: 1;
}

/* ========== ANIMATION ITEMS ========== */
.anim-item {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.anim-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* stagger via JS */

/* ========== LINK CARDS ========== */
.link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow);
    transition: all 0.35s var(--ease);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.link-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(45, 140, 130, 0.18);
}

.link-card:active {
    transform: translateY(-1px) scale(0.99);
    transition-duration: 0.1s;
}

/* ---- Icon containers ---- */
.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: var(--r-sm);
    transition: all 0.35s var(--ease);
}

/* Default icon style */
.card-icon {
    background: rgba(45, 140, 130, 0.08);
    color: var(--accent);
}

.link-card:hover .card-icon {
    transform: scale(1.05);
}

/* WhatsApp CTA icon */
.cta-icon {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #FFFFFF !important;
}

/* Clinic icon */
.icon-clinic {
    background: rgba(45, 140, 130, 0.08);
    color: var(--accent);
}

/* Instagram icon - gradient background */
.icon-instagram {
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #FFFFFF;
}

/* LinkedIn icon */
.icon-linkedin {
    background: #0A66C2;
    color: #FFFFFF;
}

.card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.card-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.card-sublabel {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-3);
    line-height: 1.3;
}

.card-arrow {
    display: flex;
    align-items: center;
    color: var(--text-3);
    transition: all 0.35s var(--ease);
    min-width: 18px;
}

.link-card:hover .card-arrow {
    color: var(--accent);
    transform: translateX(3px);
}

/* ========== CTA CARD ========== */
.cta-card {
    background: var(--cta-grad);
    background-size: 200% 100%;
    border: none;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(45, 140, 130, 0.3);
    animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.cta-card .card-label { color: #FFFFFF; }
.cta-card .card-sublabel { color: rgba(255,255,255,0.75); }
.cta-card .card-arrow { color: rgba(255,255,255,0.6); }

.cta-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(45, 140, 130, 0.4);
    border: none;
}

.cta-card:hover .card-arrow { color: #FFF; transform: translateX(4px); }

/* Shimmer sweep */
.shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.12),
        transparent
    );
    animation: shimmerSweep 3.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmerSweep {
    0%, 100% { left: -100%; }
    50% { left: 140%; }
}

/* ========== ACCORDION ========== */
.accordion-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.35s var(--ease);
}

.accordion-card:hover {
    box-shadow: var(--shadow-hover);
}

.accordion-trigger {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    text-align: left;
    color: var(--text);
    transition: all 0.3s var(--ease);
}

.accordion-trigger:hover {
    background: rgba(45, 140, 130, 0.02);
}

.accordion-trigger .card-label {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
}

.chevron {
    color: var(--text-3);
    transition: transform 0.5s var(--ease), color 0.3s;
    min-width: 20px;
}

.accordion-trigger[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.accordion-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s var(--ease);
}

.accordion-panel[data-open="true"] {
    grid-template-rows: 1fr;
}

.panel-inner {
    overflow: hidden;
    padding: 0 18px;
}

.accordion-panel[data-open="true"] .panel-inner {
    padding: 0 18px 22px;
}

.panel-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.panel-lead {
    font-size: 0.84rem;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 22px;
}

.panel-group { margin-bottom: 18px; }
.panel-group:last-of-type { margin-bottom: 22px; }

.panel-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 10px;
}

.panel-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panel-list li {
    font-size: 0.82rem;
    color: var(--text-2);
    line-height: 1.55;
    padding-left: 18px;
    position: relative;
}

.panel-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
}

.panel-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.panel-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(45, 140, 130, 0.06);
    border: 1px solid rgba(45, 140, 130, 0.12);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--accent-dark);
    letter-spacing: 0.2px;
    transition: all 0.3s var(--ease);
}

.panel-badge:hover {
    background: rgba(45, 140, 130, 0.12);
    transform: translateY(-1px);
}

.panel-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--cta-grad);
    background-size: 200% 100%;
    color: #FFFFFF;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.35s var(--ease);
    box-shadow: 0 3px 12px rgba(45, 140, 130, 0.3);
}

.panel-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(45, 140, 130, 0.4);
    background-position: 100% 50%;
}

/* ========== FOOTER ========== */
.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
}

.footer-text {
    font-size: 0.72rem;
    color: var(--text-3);
    letter-spacing: 0.3px;
}

.footer-credit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    letter-spacing: 0.4px;
    transition: all 0.3s ease;
}

.credit-label {
    color: var(--text-3);
    font-weight: 400;
}

.credit-name {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.footer-credit:hover .credit-name {
    color: var(--accent-dark);
}

/* ========== REVEAL ANIMATION ========== */
@keyframes revealUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVE ========== */
@media (min-width: 481px) {
    .hero {
        border-radius: var(--r-lg);
        margin-top: 16px;
    }
}

@media (max-height: 700px) {
    .hero { height: 460px; }
}

@media (min-height: 800px) {
    .hero { height: 580px; }
}

/* Focus states */
.link-card:focus-visible,
.accordion-trigger:focus-visible,
.panel-cta:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .anim-item { opacity: 1; transform: none; }
}
