@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Manrope:wght@400;500;600;700;800&family=Noto+Sans+Sinhala:wght@400;500;700;800&display=swap');

:root {
    --bg: #f4ede4;
    --bg-soft: #fbf6ef;
    --panel: rgba(255, 251, 246, 0.88);
    --panel-strong: #fffaf3;
    --ink: #231815;
    --muted: #6e6058;
    --accent: #b04a2f;
    --accent-deep: #7a2917;
    --accent-soft: #f2d8c7;
    --gold: #c7922d;
    --line: rgba(170, 131, 102, 0.24);
    --good: #276347;
    --shadow: 0 22px 60px rgba(76, 43, 28, 0.12);
    --font-heading: "Cormorant Garamond", "Noto Sans Sinhala", Georgia, serif;
    --font-body: "Manrope", "Noto Sans Sinhala", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(176, 74, 47, 0.18), transparent 24%),
        radial-gradient(circle at top right, rgba(199, 146, 45, 0.12), transparent 26%),
        linear-gradient(180deg, #fbf6ef 0%, var(--bg) 52%, #efe6da 100%);
}

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

img {
    max-width: 100%;
}

h1,
h2,
h3,
.brand {
    letter-spacing: -0.02em;
}

a {
    color: var(--accent-deep);
}

.container {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 48px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 8px;
}

.brand {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 2.5vw, 2.6rem);
    font-weight: 700;
    text-decoration: none;
    color: var(--accent-deep);
}

.lang-switch {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 251, 246, 0.68);
    backdrop-filter: blur(14px);
}

.lang-switch a {
    padding: 9px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
}

.lang-switch a:hover,
.lang-switch a:focus-visible {
    background: rgba(176, 74, 47, 0.1);
    outline: none;
}

.hero,
.panel,
.home-hero {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.hero,
.panel {
    padding: 28px;
    margin-bottom: 24px;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
    gap: 28px;
    padding: clamp(28px, 4vw, 44px);
    margin: 18px 0 24px;
    overflow: hidden;
}

.home-hero::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -80px;
    top: -40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(176, 74, 47, 0.16), transparent 68%);
}

.hero-copy,
.hero-side {
    position: relative;
    z-index: 1;
}

.hero-kicker,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--accent-deep);
    margin-bottom: 12px;
}

.hero-kicker::before,
.eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: currentColor;
}

.hero h1,
.home-hero h1,
.panel h2,
.panel h3 {
    font-family: var(--font-heading);
    margin: 0;
}

.home-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.6rem);
    line-height: 0.98;
    max-width: 12ch;
}

.hero-lead {
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    line-height: 1.6;
    margin: 22px 0 12px;
    max-width: 56ch;
}

.hero-description {
    max-width: 62ch;
    line-height: 1.75;
}

.hero-grid,
.grid,
.questionnaire-grid,
.stats,
.info-grid {
    display: grid;
    gap: 18px;
}

.hero-grid {
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
}

.stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-featured {
    margin-bottom: 18px;
}

.stat,
.card,
.highlight-card,
.empty-state {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
}

.stat {
    min-height: 124px;
}

.stat strong {
    display: block;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    margin-bottom: 8px;
}

.stat span,
.stat div {
    color: var(--muted);
    line-height: 1.45;
}

.stat-accent {
    background: linear-gradient(160deg, rgba(176, 74, 47, 0.12), rgba(255, 251, 246, 0.95));
    border-color: rgba(176, 74, 47, 0.2);
}

.highlight-card {
    background: linear-gradient(180deg, rgba(255, 246, 237, 0.95), rgba(255, 252, 247, 0.96));
}

.feature-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.feature-list li + li {
    margin-top: 10px;
}

.panel {
    position: relative;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 18px;
}

.section-heading h2 {
    font-size: clamp(1.9rem, 3vw, 3rem);
}

.section-heading p {
    max-width: 60ch;
    margin: 0;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three,
.questionnaire-grid,
.info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card h3,
.profile-card h3 {
    font-size: 1.45rem;
    margin-bottom: 10px;
}

.profile-card-top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
    margin-bottom: 12px;
}

.empty-state {
    padding: 28px;
}

label {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 6px;
}

input,
select,
textarea,
button {
    width: 100%;
    border-radius: 16px;
    border: 1px solid #d9c4af;
    padding: 13px 15px;
    font: inherit;
    background: #fffdfa;
    color: var(--ink);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 2px solid rgba(176, 74, 47, 0.2);
    outline-offset: 1px;
    border-color: rgba(176, 74, 47, 0.35);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

button,
.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #fff7f2;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    padding: 13px 20px;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(122, 41, 23, 0.16);
}

.button.secondary {
    background: transparent;
    color: var(--accent-deep);
    border: 1px solid rgba(176, 74, 47, 0.28);
    box-shadow: none;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-actions {
    margin-top: 24px;
}

.actions > * {
    width: auto;
    min-width: 170px;
}

.error {
    color: #8a1c1c;
    font-size: 0.88rem;
    margin-top: 6px;
}

.notice {
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
}

.notice.success {
    background: #e9f7ee;
    color: #235835;
    border-color: #b9ddc3;
}

.notice.error-box {
    background: #fceaea;
    color: #7e1f1f;
    border-color: #e8bcbc;
}

.strong-notice {
    font-size: 1rem;
    border-width: 2px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(176, 74, 47, 0.1);
    color: var(--accent-deep);
    margin: 0 8px 8px 0;
    font-size: 0.83rem;
    font-weight: 700;
}

.soft-pill {
    background: var(--accent-soft);
}

.score {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--good);
}

.small {
    font-size: 0.85rem;
}

.muted {
    color: var(--muted);
}

.question-card {
    min-height: 220px;
}

@media (max-width: 980px) {
    .home-hero,
    .hero-grid,
    .grid.two,
    .grid.three,
    .questionnaire-grid,
    .stats,
    .info-grid,
    .section-heading {
        grid-template-columns: 1fr;
    }

    .section-heading {
        display: grid;
        align-items: start;
    }

    .home-hero h1 {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .topbar,
    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar {
        gap: 12px;
    }

    .home-hero,
    .hero,
    .panel {
        padding: 22px;
    }

    .actions > * {
        width: 100%;
    }

    .profile-card-top {
        flex-direction: column;
    }
}
