/* ===================================================
   Instituto Walden4 — Experimentos de Psicologia
   Tema compartilhado (light, navy accent)
   =================================================== */

:root {
    --navy-950:  #0D1B2E;
    --navy-900:  #152338;
    --navy-800:  #1B2D47;
    --navy-700:  #223856;
    --navy-600:  #2A4568;
    --navy-500:  #345078;
    --navy-400:  #4A6A96;
    --navy-300:  #6A8CB8;
    --navy-200:  #A7C0DD;
    --navy-100:  #D6E3F1;
    --navy-50:   #EEF4FA;

    --white:     #FFFFFF;
    --off-white: #F7F9FC;
    --grey-50:   #F2F5F9;
    --grey-100:  #E7ECF3;
    --grey-200:  #D6DEE9;
    --grey-300:  #B7C2D2;
    --grey-400:  #8C97AB;
    --grey-500:  #69748A;
    --grey-600:  #515B70;
    --grey-700:  #3A4356;
    --grey-800:  #272E3D;
    --grey-900:  #161B26;

    --ink:       #14213A;

    --color-bg:           var(--white);
    --color-surface:      var(--white);
    --color-surface-alt:  var(--off-white);
    --color-text:         var(--grey-700);
    --color-text-muted:   var(--grey-600);
    --color-border:       var(--grey-100);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --shadow-xs:  0 1px 2px rgba(20, 33, 58, 0.05);
    --shadow-sm:  0 2px 8px rgba(20, 33, 58, 0.06);
    --shadow-md:  0 8px 24px rgba(20, 33, 58, 0.08);
    --shadow-lg:  0 16px 40px rgba(20, 33, 58, 0.10);

    --r-sm:   8px;
    --r-md:   14px;
    --r-lg:   20px;
    --r-xl:   28px;
    --r-full: 9999px;

    --ease-out:    cubic-bezier(0.33, 1, 0.68, 1);
    --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
    --dur-fast:    200ms;
    --dur-mid:     350ms;

    --max-content: 920px;
    --max-wide:    1240px;
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

img { display: block; max-width: 100%; }

/* ===== Navigation ===== */
.nav-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.80);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--color-border);
    transition: all var(--dur-mid) var(--ease-out);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .nav-bar { background: rgba(255, 255, 255, 0.97); }
}

.nav-container {
    max-width: var(--max-wide);
    margin: 0 auto;
    padding: 0 32px;
    height: 68px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo { display: flex; flex-direction: column; gap: 2px; text-decoration: none; }

.nav-logo-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--navy-900);
    line-height: 1.1;
}

.nav-logo-tagline {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--navy-500);
    line-height: 1;
}

.nav-menu { display: flex; list-style: none; align-items: center; gap: 4px; }

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--grey-600);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    transition: all var(--dur-fast) var(--ease-out);
}

.nav-link .material-icons { font-size: 18px; }
.nav-link:hover { background-color: var(--navy-50); color: var(--navy-800); }

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--navy-800);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--r-full);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all var(--dur-mid) var(--ease-spring);
    margin-left: 8px;
}

.nav-cta .material-icons { font-size: 17px; }
.nav-cta:hover { transform: translateY(-2px); background: var(--navy-700); box-shadow: 0 6px 18px rgba(27, 45, 71, 0.28); }

/* ===== Page hero ===== */
.page-hero {
    position: relative;
    overflow: hidden;
    background-color: var(--white);
    padding: 140px 32px 64px;
    text-align: center;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 50% -8%, rgba(42, 69, 104, 0.07) 0%, transparent 55%),
        radial-gradient(circle at 88% 18%, rgba(74, 106, 150, 0.06) 0%, transparent 45%),
        radial-gradient(rgba(42, 69, 104, 0.05) 1px, transparent 1px);
    background-size: auto, auto, 24px 24px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
    mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
}

.page-hero-inner { position: relative; z-index: 1; max-width: var(--max-content); margin: 0 auto; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 6px 10px;
    border: 1px solid var(--navy-200);
    border-radius: var(--r-full);
    background: var(--navy-50);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--navy-700);
    margin-bottom: 28px;
}

.eyebrow .material-icons { font-size: 16px; color: var(--navy-500); }

.page-title {
    font-size: clamp(34px, 6vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin-bottom: 20px;
}

.page-title em { font-style: normal; color: var(--navy-500); }

.page-subtitle {
    font-size: clamp(16px, 2.2vw, 19px);
    font-weight: 400;
    line-height: 1.7;
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto;
}

/* ===== Buttons ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 32px;
    background: var(--navy-800);
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--r-full);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--dur-mid) var(--ease-spring);
}

.btn-primary .material-icons { font-size: 19px; }
.btn-primary:hover { transform: translateY(-3px); background: var(--navy-700); box-shadow: 0 10px 28px rgba(27, 45, 71, 0.30); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: transparent;
    color: var(--navy-800);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid var(--navy-400);
    border-radius: var(--r-full);
    cursor: pointer;
    transition: all var(--dur-mid) var(--ease-out);
}

.btn-ghost .material-icons { font-size: 19px; }
.btn-ghost:hover { border-color: var(--navy-500); background: var(--navy-50); transform: translateY(-2px); }

/* ===== Experiments listing ===== */
.listing-section { padding: 24px 32px 100px; }
.listing-container { max-width: var(--max-wide); margin: 0 auto; }

.exp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.exp-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    text-decoration: none;
    transition: all var(--dur-mid) var(--ease-out);
    box-shadow: var(--shadow-xs);
}

.exp-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--navy-700);
    opacity: 0;
    transition: opacity var(--dur-mid) var(--ease-out);
}

.exp-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-6px); border-color: var(--navy-200); }
.exp-card:hover::before { opacity: 1; }

.exp-card-content { padding: 32px; flex-grow: 1; display: flex; flex-direction: column; }

.exp-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--r-md);
    background: var(--navy-50);
    border: 1px solid var(--navy-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    flex-shrink: 0;
}

.exp-icon .material-icons { font-size: 26px; color: var(--navy-700); }

.exp-category {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--navy-500);
    margin-bottom: 8px;
}

.exp-card-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.exp-card-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text-muted);
    flex-grow: 1;
    margin-bottom: 20px;
}

.exp-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--navy-600);
    transition: gap var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.exp-card:hover .exp-card-link { gap: 10px; color: var(--navy-800); }
.exp-card-link .material-icons { font-size: 18px; }

/* Empty state */
.exp-empty {
    max-width: 560px;
    margin: 24px auto;
    text-align: center;
    padding: 64px 32px;
    border: 1.5px dashed var(--navy-200);
    border-radius: var(--r-xl);
    background: var(--off-white);
}

.exp-empty .material-icons { font-size: 44px; color: var(--navy-300); margin-bottom: 16px; }
.exp-empty h2 { font-size: 22px; color: var(--ink); margin-bottom: 10px; }
.exp-empty p { color: var(--color-text-muted); }

/* ===== Experiment page scaffold ===== */
.exp-main { padding: 24px 20px 96px; }
.exp-stage {
    max-width: 720px;
    margin: 0 auto;
    background: var(--white);
    border: 1px solid var(--color-border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
    padding: 40px 36px;
}

.panel { display: none; }
.panel.active { display: block; animation: fade-in var(--dur-mid) var(--ease-out); }

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

.panel-lead {
    font-size: 16px;
    line-height: 1.75;
    color: var(--color-text);
    margin-bottom: 24px;
}

.panel h3 {
    font-size: 18px;
    color: var(--ink);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.steps { list-style: none; margin: 0 0 28px; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; color: var(--color-text); }
.steps .num {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: var(--r-full);
    background: var(--navy-50);
    border: 1px solid var(--navy-100);
    color: var(--navy-700);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.actions-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

.trial-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--grey-500);
}

.progress-track { height: 6px; border-radius: var(--r-full); background: var(--grey-100); overflow: hidden; margin-bottom: 28px; }
.progress-fill { height: 100%; width: 0; background: var(--navy-600); border-radius: var(--r-full); transition: width var(--dur-mid) var(--ease-out); }

/* Results */
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 24px 0 28px; }
.result-stat {
    background: var(--off-white);
    border: 1px solid var(--color-border);
    border-radius: var(--r-lg);
    padding: 22px 18px;
    text-align: center;
}
.result-stat .value { font-size: 32px; font-weight: 800; color: var(--navy-700); letter-spacing: -0.02em; line-height: 1; }
.result-stat .value small { font-size: 15px; font-weight: 600; color: var(--navy-400); }
.result-stat .label { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--grey-500); margin-top: 8px; }

.explain {
    background: var(--navy-50);
    border: 1px solid var(--navy-100);
    border-radius: var(--r-lg);
    padding: 24px 26px;
    margin-top: 8px;
}
.explain h3 { color: var(--navy-800); }
.explain p { font-size: 14.5px; line-height: 1.75; color: var(--grey-700); }
.explain p + p { margin-top: 12px; }

.disclaimer { font-size: 12.5px; color: var(--grey-500); text-align: center; margin-top: 28px; line-height: 1.6; }

/* ===== Footer ===== */
.footer {
    background: var(--grey-50);
    color: var(--color-text);
    padding: 56px 32px 32px;
    border-top: 1px solid var(--color-border);
}

.footer-inner {
    max-width: var(--max-wide);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-brand-name { font-size: 18px; font-weight: 700; color: var(--navy-900); }
.footer-brand-sub { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--navy-500); }

.footer-links { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--grey-600);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    transition: all var(--dur-fast) var(--ease-out);
}
.footer-link:hover { color: var(--navy-800); background: var(--white); }

.footer-bottom {
    max-width: var(--max-wide);
    margin: 32px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    font-size: 13px;
    color: var(--grey-600);
    text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .exp-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .nav-container { padding: 0 20px; height: 60px; }
    .nav-menu { gap: 0; }
    .nav-link span:not(.material-icons) { display: none; }
    .nav-link { padding: 8px 10px; }
    .page-hero { padding: 110px 20px 48px; }
    .listing-section { padding: 16px 20px 72px; }
    .exp-grid { grid-template-columns: 1fr; }
    .exp-stage { padding: 28px 22px; }
    .footer-inner { flex-direction: column; text-align: center; }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

:focus-visible { outline: 2px solid var(--navy-500); outline-offset: 3px; border-radius: 4px; }
::selection { background-color: var(--navy-700); color: var(--white); }
