@import url('css/fonts.css');
@import url('css/tokens.css');
@import url('css/base.css');
@import url('css/interview.css');
@import url('css/resume.css');

/* ---------- App shell: desktop ---------- */

.shell-desktop {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    flex: none;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: var(--sp-5) var(--sp-3);
    transition: width var(--dur) ease;
    overflow: visible;
    z-index: 10;
}

.sidebar-brand {
    padding: 0 var(--sp-2) var(--sp-5);
    overflow: hidden;
}

.sidebar-collapse-btn {
    position: absolute;
    top: 50%;
    right: -14px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    padding: 0;
    background: var(--surface);
    color: var(--subtle);
    cursor: pointer;
    border-radius: var(--r-pill);
    z-index: 15;
    opacity: 0;
    box-shadow: var(--shadow-sm);
    transition: opacity var(--dur-fast) ease, color var(--dur-fast) ease, background var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.sidebar:hover .sidebar-collapse-btn,
.sidebar-collapse-btn:focus-visible {
    opacity: 1;
}

.sidebar-collapse-btn:hover {
    color: var(--ink);
    background: var(--surface2);
    box-shadow: var(--shadow);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
}

.sidebar-foot {
    padding-top: var(--sp-3);
    border-top: 1px solid var(--line);
    margin-top: var(--sp-3);
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 10px var(--sp-3);
    border-radius: var(--r-md);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    min-height: 44px;
    transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item:hover {
    background: var(--surface2);
    color: var(--ink);
    text-decoration: none;
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary-text);
}

.nav-item>svg {
    flex: none;
}

.nav-badge {
    margin-left: auto;
}

/* --- Collapsed sidebar --- */

.sidebar.collapsed {
    width: var(--sidebar-w-collapsed);
    padding: var(--sp-5) 10px;
}

.sidebar.collapsed .sidebar-brand {
    padding: 0 0 var(--sp-5);
    display: flex;
    justify-content: center;
}

.sidebar.collapsed .sidebar-brand .logo-word {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px 0;
}

.sidebar.collapsed .nav-item>span:not(.avatar),
.sidebar.collapsed .nav-badge {
    display: none;
}

.shell-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.page {
    flex: 1 1 auto;
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
    padding: var(--sp-6) var(--sp-5) var(--sp-7);
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
}

/* ---------- App shell: mobile ---------- */

.shell-mobile {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) var(--sp-4) 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.topbar-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -.01em;
}

.shell-mobile>.page {
    padding: var(--sp-4) var(--sp-4) calc(var(--tabbar-h) + var(--sp-6) + env(safe-area-inset-bottom));
    max-width: none;
}

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    align-items: stretch;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--subtle);
    font-size: 11px;
    font-weight: 600;
    border: 0;
    background: none;
    cursor: pointer;
    padding: 6px 2px;
}

.tab:hover {
    text-decoration: none;
}

.tab.active {
    color: var(--primary-text);
}

/* ---------- Auth shells ---------- */

.auth-hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--sp-8);
}

.auth-hero-copy {
    max-width: 520px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    justify-self: end;
}

.auth-scrollcue {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    color: var(--subtle);
    font-size: 13px;
    font-weight: 600;
    margin-top: var(--sp-6);
}

.auth-scrollcue svg {
    animation: sap-nudge 2s ease-in-out infinite;
}

@keyframes sap-nudge {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(4px);
    }
}

@media (max-width: 899px) {
    .auth-hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-block: var(--sp-7);
    }

    .auth-card {
        justify-self: stretch;
        max-width: none;
    }
}

.auth-mobile {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg);
}

.auth-mobile-top {
    flex: 0 0 38%;
    min-height: 210px;
    padding: calc(env(safe-area-inset-top) + var(--sp-4)) 0 var(--sp-2);
    display: flex;
    flex-direction: column;
}

.auth-mobile-form {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--sp-5) var(--sp-4) calc(env(safe-area-inset-bottom) + var(--sp-5));
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}

/* ---------- Carousel ---------- */

.carousel {
    position: relative;
}

.carousel-track {
    display: flex;
    gap: var(--sp-3);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-track:not(.carousel-ready) .carousel-clone-prev {
    display: none;
}

.carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: var(--sp-3);
}

.carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--r-pill);
    border: 0;
    padding: 0;
    background: var(--line);
    cursor: pointer;
    transition: width var(--dur) ease, background var(--dur) ease;
}

.carousel-dot.on {
    width: 20px;
    background: var(--primary);
}

/* Arrows sit over the decorative art, never over the banner copy. */
.carousel-arrow {
    position: absolute;
    top: var(--sp-4);
    z-index: 2;
    background: var(--surface);
    box-shadow: var(--shadow-overlay);
}

.carousel-arrow.prev {
    right: 58px;
}

.carousel-arrow.next {
    right: var(--sp-4);
}

.banner {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 200px;
    padding: var(--sp-5) var(--sp-6);
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    overflow: hidden;
    background: var(--surface2);
    color: var(--ink);
}

.banner:hover {
    text-decoration: none;
}

/* Height-driven so the motif always fits the banner; width follows the SVG ratio. */
.banner-art {
    position: absolute;
    top: var(--sp-4);
    right: var(--sp-6);
    bottom: auto;
    left: auto;
    height: calc(100% - (2 * var(--sp-4)));
    width: auto;
    max-width: 38%;
    object-fit: contain;
    object-position: right center;
    pointer-events: none;
}

.banner-body {
    position: relative;
    max-width: 58%;
}

.banner-body h3 {
    font-size: 20px;
    line-height: 26px;
}

@media (max-width: 639px) {
    .banner {
        min-height: 168px;
        padding: var(--sp-4);
    }

    .banner-art {
        right: var(--sp-3);
        max-width: 30%;
        opacity: .75;
    }

    .banner-body {
        max-width: 68%;
    }
}

/* ---------- Feature / recent cards ---------- */

.feature-card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.feature-card h4 {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.recent-card {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 10px var(--sp-3);
    min-height: 44px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
}

.recent-card:hover {
    border-color: var(--primary);
    text-decoration: none;
}

/* ---------- Brand lockup ---------- */

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
}

.logo:hover {
    text-decoration: none;
}

.logo-word {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -.03em;
    font-size: 20px;
}

/* ---------- Community ---------- */

.verified-tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border-radius: var(--r-pill);
    background: var(--primary);
    color: var(--primary-on);
    vertical-align: middle;
}

.inst-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border-radius: var(--r-md);
}

.inst-primary { background: var(--primary-soft); color: var(--primary-text); }
.inst-success { background: var(--success-soft); color: var(--success-text); }
.inst-info { background: var(--info-soft); color: var(--info-text); }
.inst-warn { background: var(--warn-soft); color: var(--warn-text); }

.post-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    line-height: 20px;
}

/* One-time code box: spaced digits read like the code in the email. */
.otp-input {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 22px;
    letter-spacing: .5em;
    text-align: center;
}

/* The kind badge drops to its own line before the name gets squeezed to nothing. */
.post-head-text {
    min-width: 150px;
}

/* A long college name truncates rather than stacking one word per line on a phone. */
.post-author > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-link {
    color: inherit;
}

.post-link:hover {
    text-decoration: none;
}

.post-link:hover .post-title {
    color: var(--primary-text);
}

.post-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
    line-height: 22px;
    letter-spacing: -.01em;
    color: var(--ink);
}

/* Wide: text beside the image. Narrow: title and snippet above a full-width image, as on Reddit. */
.post-main {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-4);
}

.post-text {
    flex: 1 1 auto;
    min-width: 0;
}

.post-media {
    display: block;
    flex: 0 0 200px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface2);
}

.post-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-media-full {
    width: 100%;
    aspect-ratio: 16 / 7;
}

@media (max-width: 639px) {
    .post-main {
        flex-direction: column;
        gap: var(--sp-3);
    }

    .post-media {
        flex: none;
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .post-media-full {
        aspect-ratio: 16 / 9;
    }
}

.post-body {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* The teaser collapses paragraph breaks so all three clamped lines carry text. */
.post-body-clamp {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-tag {
    padding: 2px 10px;
    font-size: 12px;
    color: var(--muted);
}

.post-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--line);
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    min-width: 44px;
    padding: 0 var(--sp-3);
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.vote-btn:hover {
    border-color: var(--primary);
    color: var(--primary-text);
}

.vote-btn[aria-pressed='true'] {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-text);
}

.vote-btn:disabled {
    cursor: progress;
}

.comment-bubble {
    padding: var(--sp-3);
    border-radius: 4px var(--r-lg) var(--r-lg) var(--r-lg);
    background: var(--surface2);
}

.comment-author {
    background: var(--primary-soft);
}

.comment-actions {
    padding-left: var(--sp-2);
}

.comment-replies {
    margin-left: 17px;
    padding-left: var(--sp-4);
    border-left: 2px solid var(--line);
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 0 var(--sp-1);
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.link-btn:hover {
    color: var(--primary-text);
}

.link-danger,
.link-danger:hover {
    color: var(--error-text);
}

.post-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) 0;
    color: var(--ink);
    border-top: 1px solid var(--line);
}

.post-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.post-row:hover {
    text-decoration: none;
}

.post-row:hover .post-row-title {
    color: var(--primary-text);
}

.post-row-title {
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Avatar photo upload ---------- */

.avatar-photo-wrap {
    position: relative;
    display: inline-flex;
    flex: none;
    cursor: pointer;
}

.avatar-photo-wrap:hover .avatar-camera-overlay {
    opacity: 1;
}

.avatar-camera-overlay {
    position: absolute;
    inset: 0;
    border-radius: var(--r-pill);
    background: rgba(0, 0, 0, .45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    opacity: 0;
    transition: opacity var(--dur-fast) ease;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
    text-align: center;
    pointer-events: none;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--r-pill);
    display: block;
}

/* Crop/zoom editor canvas */
.avatar-crop-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
}

.avatar-crop-canvas {
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    display: block;
    cursor: grab;
    touch-action: none;
    background: #111;
}

.avatar-crop-canvas:active {
    cursor: grabbing;
}

.avatar-crop-controls {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.avatar-crop-controls .zoom-track {
    -webkit-appearance: none;
    appearance: none;
    width: 140px;
    height: 4px;
    border-radius: var(--r-pill);
    background: var(--track);
    outline: none;
    cursor: pointer;
}

.avatar-crop-controls .zoom-track::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: var(--r-pill);
    background: var(--primary);
    cursor: pointer;
}

.avatar-crop-controls .zoom-track::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: var(--r-pill);
    background: var(--primary);
    border: 0;
    cursor: pointer;
}

.avatar-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    padding: var(--sp-2) 0;
}

.avatar-current-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-2);
}

.avatar-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--sp-3);
    border: 2px dashed var(--line);
    border-radius: var(--r-lg);
    padding: var(--sp-6) var(--sp-5);
    cursor: pointer;
    transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-fast) ease;
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
    background: var(--surface2);
}

.avatar-upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.avatar-upload-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--r-pill);
    background: var(--primary-soft);
    color: var(--primary-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--dur-fast) ease;
}

.avatar-upload-zone:hover .avatar-upload-icon {
    transform: scale(1.06);
}

/* Roadmap checkpoints: the whole row is the tap target. */
.checkpoint {
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-md);
    cursor: pointer;
}

.checkpoint:hover {
    background: var(--surface2);
}

.checkpoint input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: none;
    accent-color: var(--primary);
}
