/* ==========================================================================
   Theme: "Reading Room" — content-first and typographic.
   Archivo carries headings, nav, labels, and buttons. Source Serif 4 carries
   body copy. No card shadows or heavy radius anywhere — hairline rules do
   the separating. One pine-green accent, used only for links and controls.

   Header/footer/nav are styled via Tailwind utility + component classes
   directly in each page's HTML (see tailwind-config.js for .btn/.nav-link/
   .container-page). Everything below covers what Tailwind utilities in the
   markup don't: hero, cards, forms, the terms modal, and the prose template.
   ========================================================================== */

:root {
    --bg: #faf9f7;
    --surface: #ffffff;
    --ink: #16171b;
    --muted: #6b6f76;
    --border: #e5e3de;
    --accent: #1f6f57;
    --accent-dark: #164e3d;
    --error: #b3261e;
    --font-display: 'Archivo', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-body: 'Source Serif 4', ui-serif, Georgia, serif;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    font-family: var(--font-body);
    color: var(--ink);
    margin: 0;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6,
label, button, input, select,
.brand, .nav-user {
    font-family: var(--font-display);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 0;
}

h3 {
    font-size: 1rem;
    margin-bottom: 6px;
    font-family: Georgia, 'Times New Roman', Times, serif;
}

h3 a, h4 a, h5 a {
    text-decoration: none;
    color: inherit;
}

.aboutus{
    line-height: 50px;
}

p {
    line-height: 1.65;
}

a {
    color: var(--accent);
    text-decoration-color: rgba(31, 111, 87, 0.35);
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-dark);
}

/* ---------- Layout ---------- */

main {
    max-width: 72rem;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

@media (min-width: 640px) {
    main { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
    main { padding-left: 2rem; padding-right: 2rem; }
}

.hero {
    text-align: center;
    padding: 12px 8px 36px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: clamp(1.7rem, 3.4vw, 2.3rem);
}

.hero p {
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 1rem;
    margin: 8px 0 0;
}

/* ---------- Content grid: hairline cells, no shadows ---------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    margin-bottom: 32px;
}

.card {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 22px 24px;
    transition: background-color 0.15s ease;
}

.card:hover {
    background: rgba(31, 111, 87, 0.045);
}

.card:hover h3 a {
    color: var(--accent);
}

.card p {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Standalone informational card (not part of a grid — e.g. "our mission",
   "your feedback is on its way") gets its own hairline box. */
main > .card {
    border: 1px solid var(--border);
    border-radius: 3px;
    margin-bottom: 28px;
}

main > .card:hover {
    background: transparent;
}

/* ---------- About page: side-by-side team cards ---------- */

#experiences {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 28px;
}

.veer, .geetansh {
    flex: 1 1 260px;
    margin: 0;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    text-align: center;
}

.us {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    margin: 0 auto 14px;
}

/* ---------- Forms (login / signup / profile) ---------- */

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 30px;
    max-width: 380px;
    margin: 0 auto 20px;
}

.form-card.profile-form {
    max-width: 640px;
}

.form-card label {
    display: block;
    margin-top: 16px;
    margin-bottom: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.form-card input,
.form-card select,
.form-card textarea {
    width: 100%;
    padding: 7px 2px;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--ink);
    transition: border-color 0.15s ease;
}

.form-card select {
    padding: 7px 0;
}

.form-card textarea {
    resize: vertical;
    min-height: 4.5em;
    line-height: 1.5;
    font-family: var(--font-body);
}

.form-card input[type="file"] {
    padding: 8px 0;
    cursor: pointer;
}

.form-notice {
    max-width: 640px;
    margin: 0 auto 20px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 3px;
    background: rgba(31, 111, 87, 0.045);
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--ink);
}

.form-notice strong {
    color: var(--accent-dark);
}

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

.form-card .field-hint {
    display: block;
    margin-top: 3px;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--muted);
}

.form-card h2 {
    font-size: 1rem;
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.form-card h2:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.form-card button {
    width: 100%;
    margin-top: 22px;
    padding: 11px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.1s ease;
}

.form-card button:hover {
    background: var(--accent-dark);
}

.form-card button:active:not(:disabled) {
    opacity: 0.85;
}

.form-card button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.form-footnote {
    text-align: center;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.9rem;
}

/* ---------- Profile data cards (courses/extracurriculars/etc. pulled
   from the signed-in user's profile, shown above the static advice
   content on each restricted page) ---------- */

.profile-data-card {
    padding: 26px 28px;
}

.profile-data-card h2 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.profile-data-intro {
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.85rem;
    margin: 0 0 18px;
}

.profile-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.profile-data-grid h3 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-family: var(--font-display);
    margin-bottom: 8px;
}

.profile-data-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.92rem;
}

.profile-data-list li {
    padding: 5px 0;
    border-top: 1px solid var(--border);
}

.profile-data-list li:first-child {
    border-top: none;
}

.profile-data-empty {
    color: var(--muted);
    font-size: 0.88rem;
    font-style: italic;
    margin: 0;
}

.profile-data-meta {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.85rem;
}

.profile-data-meta strong {
    color: var(--ink);
    font-weight: 700;
}

.profile-data-edit {
    margin-top: 14px;
    font-family: var(--font-display);
    font-size: 0.85rem;
}

/* ---------- Homepage radar chart (logged-in users only) ---------- */

.radar-card {
    max-width: 520px;
    margin: 0 auto 32px;
    text-align: center;
}

.radar-chart-wrap {
    max-width: 380px;
    margin: 0 auto;
}

.radar-svg {
    display: block;
    width: 100%;
    height: auto;
}

.radar-grid-ring,
.radar-axis-line {
    fill: none;
    stroke: var(--border);
    stroke-width: 1;
}

.radar-data-polygon {
    fill: rgba(31, 111, 87, 0.16);
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linejoin: round;
}

.radar-data-dot {
    fill: var(--accent);
}

.radar-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    fill: var(--ink);
}

.radar-label-score {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    fill: var(--accent);
}

/* ---------- Locked / gated content ---------- */

.locked-card {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 3px;
    padding: 30px;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

.form-status {
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.88rem;
    min-height: 1.2em;
}

.form-status-error {
    color: var(--error);
}

/* ---------- Gated pages: hide content until auth check resolves ---------- */

body.gated main {
    display: none;
}

/* ---------- Terms & conditions modal ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 23, 27, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.modal-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    padding: 26px;
    display: flex;
    flex-direction: column;
    transform: scale(1);
    transition: transform 0.2s ease;
}

.modal-overlay.modal-hidden .modal-box {
    transform: scale(0.97);
}

.modal-box h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

.modal-subtitle {
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.88rem;
    margin-top: 0;
}

.modal-scroll {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 14px 4px;
    overflow-y: auto;
    max-height: 40vh;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.modal-scroll h3 {
    font-size: 0.92rem;
    color: var(--accent-dark);
    margin-bottom: 4px;
}

.modal-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0;
    margin-bottom: 16px;
}

.modal-checkbox input {
    margin-top: 4px;
}

.modal-accept {
    width: 100%;
    padding: 11px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.1s ease;
}

.modal-accept:disabled {
    background: var(--border);
    color: var(--muted);
    cursor: not-allowed;
}

.modal-accept:hover:not(:disabled) {
    background: var(--accent-dark);
}

.modal-accept:active:not(:disabled) {
    opacity: 0.85;
}

/* ---------- Plain prose template (Terms & Conditions, Privacy) ----------
   Long-form reading pages skip cards/hover/shadows entirely: a single
   readable column, hairline dividers between sections, small eyebrow
   labels instead of boxed headings. */

.prose-page {
    max-width: 66ch;
    margin: 0 auto;
}

.prose-section {
    padding: 26px 0;
    border-top: 1px solid var(--border);
}

.prose-section:first-child {
    border-top: none;
    padding-top: 4px;
}

.prose-eyebrow {
    display: block;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.prose-section h2 {
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.prose-section p {
    color: #2b2c30;
    font-size: 0.98rem;
    margin: 0 0 12px;
}

.prose-section p:last-child {
    margin-bottom: 0;
}

/* ---------- Responsive site nav ----------
   Mobile: collapsed by default, animates open/closed on toggle.
   Desktop (>=768px): always visible, transitions disabled so the layout
   never fights the animation while resizing across the breakpoint. */

@media (max-width: 767px) {
    .site-nav {
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
        visibility: hidden;
        transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0.3s;
    }

    .site-nav.nav-open {
        max-height: 90vh;
        opacity: 1;
        visibility: visible;
        overflow-y: auto;
        padding-bottom: 1rem;
    }
}

@media (min-width: 768px) {
    .site-nav {
        max-height: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transition: none;
    }
}

/* ---------- Scroll-triggered reveal animation ---------- */

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
