/* ABOUTME: Base styles for Pollen using the customizable token system */
/* ABOUTME: All styles reference tokens.css variables for user customization */

/* =============================================
   VIEW TRANSITIONS API - Cross-document navigation
   ============================================= */

/* Enable View Transitions for MPA navigation */
@view-transition {
    navigation: auto;
}

/* Default transition for root (entire page) */
::view-transition-old(root) {
    animation: fade-out 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

::view-transition-new(root) {
    animation: fade-in 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Main content slides up on entry, slides down on exit */
::view-transition-old(main-content) {
    animation: slide-out-down 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

::view-transition-new(main-content) {
    animation: slide-in-up 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes slide-out-down {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes slide-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header stays fixed - no transition needed, just persist */
::view-transition-old(header),
::view-transition-new(header) {
    animation: none;
    mix-blend-mode: normal;
}

/* Profile avatar morph transition */
::view-transition-old(profile-avatar),
::view-transition-new(profile-avatar) {
    animation-duration: 0.4s;
    animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Page title crossfade with scale */
::view-transition-old(page-title) {
    animation: title-out 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

::view-transition-new(page-title) {
    animation: title-in 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes title-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes title-in {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Compose FAB stays persistent */
::view-transition-old(compose-fab),
::view-transition-new(compose-fab) {
    animation: none;
    mix-blend-mode: normal;
}

/* Reduced motion: disable all view transitions */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}

/* =============================================
   END VIEW TRANSITIONS
   ============================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

/* Soft atmospheric wash behind every page — pink/sky/lavender/amber radial gradients
   that drift slightly over 15s. Fixed, non-interactive, behind all content. */
.gradient-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 50% 50% at 20% 20%, color-mix(in srgb, var(--pink) 14%, transparent), transparent),
        radial-gradient(ellipse 40% 60% at 80% 30%, color-mix(in srgb, var(--sky) 14%, transparent), transparent),
        radial-gradient(ellipse 60% 40% at 50% 80%, color-mix(in srgb, var(--lavender) 11%, transparent), transparent),
        radial-gradient(ellipse 45% 45% at 70% 70%, color-mix(in srgb, var(--amber) 8%, transparent), transparent);
    animation: mesh-shift 15s ease-in-out infinite alternate;
    will-change: transform;
    contain: strict;
}

@keyframes mesh-shift {
    0% { filter: hue-rotate(0deg); transform: scale(1); }
    50% { filter: hue-rotate(8deg); transform: scale(1.05); }
    100% { filter: hue-rotate(-5deg); transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
    .gradient-mesh { animation: none; }
}

html {
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text);
    min-height: 100vh;
    background: var(--bg);
    background-attachment: var(--bg-attachment);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

/* Typography */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--text);
    letter-spacing: var(--letter-spacing-tight);
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-ultrabold);
    letter-spacing: var(--letter-spacing-tight);
}

h2 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
}

h3 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-medium);
}

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    transition:
        color var(--duration) var(--ease),
        transform var(--duration) var(--ease);
}

a:hover {
    color: var(--link-hover);
}

/* Top Navigation */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(var(--header-blur)) saturate(1.5);
    -webkit-backdrop-filter: blur(var(--header-blur)) saturate(1.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    padding: var(--space-sm) var(--space-xl);
    display: flex;
    align-items: center;
    overflow: visible;
    view-transition-name: header;
}

.top-nav::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    background-size: 50% 100%;
    background-repeat: no-repeat;
    animation: nav-shimmer 8s ease-in-out infinite;
}

@keyframes nav-shimmer {
    0% { background-position: -100% 0; }
    50%, 100% { background-position: 200% 0; }
}

.nav-logo {
    display: block;
    position: relative;
    z-index: 1;
    text-decoration: none;
}

.nav-logo img {
    height: 32px;
    width: auto;
    display: block;
    transition: transform var(--duration) var(--ease-spring);
}

.nav-logo:hover img {
    transform: scale(1.05);
}

.nav-logo pollen-logo {
    display: block;
    transition: transform var(--duration) var(--ease-spring);
}

.nav-logo:hover pollen-logo {
    transform: scale(1.03);
}

@keyframes gentle-float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-3px) rotate(5deg);
    }
}

.nav-links {
    display: flex;
    gap: 2px;
    margin-left: auto;
    position: relative;
    z-index: 1;
}

/* Search */
.search-container {
    position: relative;
}

.search-input {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--btn-radius);
    padding: 0.6rem 1rem 0.6rem 2.2rem;
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    color: var(--text);
    width: 180px;
    transition: all var(--duration) var(--ease);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    width: 220px;
    background: var(--input-bg-focus);
    border-color: var(--input-border-focus);
    box-shadow: var(--focus-ring);
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* Main layout */
main {
    max-width: var(--main-max-width, 1400px);
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-xl);
    position: relative;
    z-index: 2;
    view-transition-name: main-content;
    flex: 1;
    width: 100%;
}

/* Profile pages: main respects profile width setting */
main:has(.profile-page) {
    max-width: var(--profile-width, 1400px);
}

/* Explore page: cards area goes wider than default main width */
main:has(.explore-page) {
    max-width: 1800px;
}

.main-single-column {
    max-width: var(--content-width);
    margin: 0 auto;
}

.main-with-sidebar {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
    gap: var(--space-3xl);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: var(--space-xl);
    height: fit-content;
}

/* Cards - glassmorphism */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--surface-blur));
    -webkit-backdrop-filter: blur(var(--surface-blur));
    border-radius: var(--card-radius);
    border: var(--card-border-width) solid var(--card-border);
    box-shadow: var(--card-shadow);
    animation: fade-float-in 1s var(--ease);
}

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

/* Profile card */
.profile-card {
    padding: var(--space-xl);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--avatar-bg);
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: var(--font-size-4xl);
    color: var(--text-secondary);
    box-shadow: var(--avatar-shadow);
}

.profile-name {
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    text-align: center;
    margin-bottom: var(--space-xs);
    font-weight: var(--font-weight-bold);
}

.profile-handle {
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-md);
}

.profile-bio {
    text-align: center;
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 1px solid var(--input-border);
}

.stat {
    text-align: center;
}

.stat-number {
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    color: var(--text);
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    letter-spacing: var(--letter-spacing);
}

/* Buttons — 3-tier hierarchy: primary, secondary (default), ghost */
button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    cursor: pointer;
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--btn-secondary-border);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--btn-radius);
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing);
    transition: all var(--duration) var(--ease);
}

button:hover,
.button:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

/* Primary — filled accent, for main actions (compose, follow, submit) */
button.primary,
.button.primary {
    background: var(--gradient-accent);
    color: var(--btn-text);
    border-color: transparent;
    box-shadow: var(--btn-shadow);
}

button.primary:hover,
.button.primary:hover {
    filter: brightness(1.05);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Ghost — text only, for tertiary actions (cancel, dismiss) */
button.ghost,
.button.ghost {
    background: transparent;
    border-color: transparent;
    color: var(--btn-ghost-text);
}

button.ghost:hover,
.button.ghost:hover {
    background: var(--tint-warm);
    border-color: transparent;
    color: var(--accent);
}

/* Danger — for destructive actions (delete, block) */
button.danger,
.button.danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border-color: transparent;
}

button.danger:hover,
.button.danger:hover {
    background: var(--color-danger);
    color: var(--btn-text);
    box-shadow: var(--shadow-sm);
}

/* Form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea {
    width: 100%;
    padding: var(--input-padding);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--input-radius);
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    color: var(--text);
    transition: all var(--duration) var(--ease);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="url"]::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
textarea:focus {
    outline: none;
    background: var(--input-bg-focus);
    border-color: var(--input-border-focus);
    box-shadow: var(--focus-ring);
}

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

/* Explore cards */
.explore-card {
    background: var(--surface);
    backdrop-filter: blur(var(--surface-blur));
    -webkit-backdrop-filter: blur(var(--surface-blur));
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--surface-border);
    margin-bottom: var(--space-lg);
}

.explore-card .explore-title {
    font-family: var(--font-display);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

/* Trending tags */
.trending-tags {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.trending-tag {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--input-border);
    text-decoration: none;
    color: var(--text-secondary);
    transition: color var(--duration) var(--ease);
}

.trending-tag:last-child {
    border-bottom: none;
}

.trending-tag:hover {
    color: var(--accent);
}

.trending-tag-name {
    font-size: var(--font-size-base);
}

.trending-tag-count {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    backdrop-filter: blur(var(--modal-blur));
    -webkit-backdrop-filter: blur(var(--modal-blur));
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    animation: modal-fade-in 0.3s var(--ease);
}

.modal-overlay[hidden] {
    display: none;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--space-xl);
    animation: modal-slide-in 0.3s var(--ease);
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.modal-title {
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    padding: var(--space-sm);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius);
    transition:
        color var(--duration-fast) var(--ease),
        background var(--duration-fast) var(--ease);
}

.modal-close:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* Landing page */
.landing-hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-4xl) var(--space-xl);
    animation: fade-float-in 0.8s var(--ease);
}

.landing-logo-image {
    max-width: min(90vw, 500px);
    height: auto;
    margin-bottom: var(--space-lg);
    animation: gentle-float 4s ease-in-out infinite;
    filter: drop-shadow(0 8px 32px rgba(232, 165, 90, 0.15));
}

.landing-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 15vw, 10rem);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing);
    color: var(--accent);
    margin-bottom: var(--space-md);
    line-height: 0.9;
    text-transform: lowercase;
    view-transition-name: page-title;
}

.landing-tagline {
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    font-style: italic;
    font-weight: var(--font-weight-light);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    animation: fade-float-in 0.8s var(--ease) 0.15s backwards;
}

.landing-description {
    max-width: 440px;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-loose);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    animation: fade-float-in 0.8s var(--ease) 0.3s backwards;
}

.landing-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
    animation: fade-float-in 0.8s var(--ease) 0.45s backwards;
}

/* Page header */
.page-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
    animation: fade-float-in 0.8s var(--ease);
}

.page-title {
    font-family: var(--font-display);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-ultrabold);
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: var(--space-sm);
    text-transform: lowercase;
    view-transition-name: page-title;
}

.page-subtitle {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-light);
    color: var(--text-secondary);
    font-style: italic;
}

/* =============================================
   LOGIN PAGE — atmosphere account explainer
   ============================================= */

.login-stage {
    max-width: 30rem;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.login-card {
    position: relative;
    width: 100%;
    background: var(--card-bg);
    border: var(--card-border-width) solid var(--card-border);
    border-radius: var(--card-radius);
    padding: var(--space-xl);
    display: grid;
    gap: var(--space-lg);
    backdrop-filter: blur(var(--surface-blur));
    -webkit-backdrop-filter: blur(var(--surface-blur));
}

.login-card__title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 1.6vw + 0.9rem, 1.95rem);
    font-weight: var(--font-weight-ultrabold);
    letter-spacing: var(--letter-spacing-tight);
    line-height: 1.12;
    color: var(--text);
    margin: 0;
    max-width: 20ch;
    view-transition-name: page-title;
}

/*
   Marker-pen highlight on "atmosphere account" — kept inline so the phrase
   sits in flow, and the highlight reads as a swipe behind the words rather
   than a separate block. box-decoration-break: clone keeps it tidy if the
   phrase wraps.
*/
.login-card__title-em {
    font-style: italic;
    color: var(--text);
    background-image: linear-gradient(
        180deg,
        transparent 0%,
        transparent 15%,
        var(--accent-glow) 15%,
        var(--accent-glow) 92%,
        transparent 92%
    );
    padding: 0 0.18em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.login-card__form {
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.login-card__hint {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.45;
}

/* Primary "don't have an account?" sign-up row — sits between the form and
   the disclosure so the registration path is obvious without opening it. */
.login-card__signup {
    margin: 0;
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    text-align: center;
    padding-top: var(--space-xs);
    border-top: 1px dashed var(--surface-border);
}

.login-card__signup a {
    font-weight: var(--font-weight-bold);
    color: var(--link-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    text-decoration-color: var(--link-underline);
}

.login-card__signup a:hover {
    color: var(--link-hover);
}

/* atmo-input — handle field with mark icon + submit arrow */
.atmo-input {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-round);
    padding: 0.4rem 0.5rem 0.4rem 0.85rem;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.atmo-input:focus-within {
    background: var(--input-bg-focus);
    border-color: var(--input-border-focus);
    box-shadow: var(--focus-ring);
}

.atmo-input__icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-muted);
    display: block;
    opacity: 0.7;
}

.atmo-input input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.55rem 0;
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: var(--font-weight-medium);
    color: var(--text);
    letter-spacing: -0.005em;
}

.atmo-input input:focus {
    outline: none;
}

.atmo-input input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/*
   Overrides the global `button` padding so this round submit stays round.
   `gap: 0` removes the inline-flex gap on the inherited button rule too.
*/
.atmo-input__submit {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    gap: 0;
    border-radius: 50%;
    border: none;
    background: var(--text);
    color: var(--bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}

.atmo-input__submit:hover {
    background: var(--accent);
    color: white;
    transform: translateX(1px);
    border: none;
    box-shadow: none;
}

.atmo-input__submit svg {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* "wait, what's an atmosphere account?" disclosure */
.atmo-disclosure > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: var(--font-weight-bold);
    color: var(--link-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    text-decoration-color: var(--link-underline);
    padding: 0.15rem 0;
    border-radius: 4px;
}

.atmo-disclosure > summary::-webkit-details-marker {
    display: none;
}

.atmo-disclosure > summary::after {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2.5px solid currentColor;
    border-bottom: 2.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.18s ease;
}

.atmo-disclosure[open] > summary::after {
    transform: translateY(1px) rotate(225deg);
}

.atmo-disclosure > summary:hover {
    color: var(--link-hover);
}

.atmo-disclosure__panel {
    position: relative;
    margin-top: var(--space-md);
    padding: var(--space-lg);
    background: var(--surface-hover);
    border: 1px solid var(--surface-border);
    border-radius: var(--card-radius-sm);
    display: grid;
    gap: var(--space-md);
}

@media (prefers-reduced-motion: no-preference) {
    .atmo-disclosure[open] .atmo-disclosure__panel {
        animation: atmo-pop 0.22s ease-out;
    }
    @keyframes atmo-pop {
        from { opacity: 0; transform: translateY(-4px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

.atmo-disclosure__lede {
    font-size: 1.0625rem;
    margin: 0;
    max-width: 48ch;
    color: var(--text);
}

.atmo-disclosure__heading {
    font-size: var(--font-size-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: var(--font-weight-ultrabold);
    color: var(--text-secondary);
    margin: 0;
}

/* apps grid — each app is a small chip with its real logo */
.atmo-apps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
    gap: var(--space-sm);
}

.atmo-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    padding: var(--space-sm) 0.4rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    text-align: center;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .atmo-app:hover {
        transform: translateY(-2px);
        background: var(--surface-hover);
        border-color: var(--accent);
    }
}

.atmo-app__logo {
    width: 36px;
    height: 36px;
    display: block;
    flex-shrink: 0;
}

.atmo-app__logo img,
.atmo-app__logo svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.atmo-app__name {
    font-size: 0.78rem;
    font-weight: var(--font-weight-bold);
    line-height: 1;
    letter-spacing: -0.005em;
    color: var(--text);
}

/* secondary links under the apps grid: find-more + migrate */
.atmo-disclosure__more,
.atmo-disclosure__migrate {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-align: center;
}

.atmo-disclosure__more a,
.atmo-disclosure__migrate a {
    color: var(--link-color);
    font-weight: var(--font-weight-medium);
}

.atmo-disclosure__more a:hover,
.atmo-disclosure__migrate a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* atmosphereaccount.com badge — official 88x31 button */
.login-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.atmo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--text);
    color: white;
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    text-decoration: none;
    line-height: 0;
    transition: transform 0.12s ease, opacity 0.15s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .atmo-badge:hover {
        transform: translateY(-1px);
        opacity: 0.9;
    }
}

.atmo-badge img {
    width: 88px;
    height: 31px;
    display: block;
    image-rendering: -webkit-optimize-contrast;
}

/* visually hidden but available to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Dashboard layout — single column, no sidebar */
.dashboard-feed {
    max-width: var(--content-width);
    margin: 0 auto;
}

/* Profile bar — compact horizontal strip above feed */
.profile-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    margin-bottom: var(--space-md);
}

.profile-bar-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.profile-bar-link:hover {
    text-decoration: none;
}

.profile-bar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--avatar-bg);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.profile-bar-info {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    min-width: 0;
}

.profile-bar-name {
    font-family: var(--font-display);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-bar-handle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-bar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-left: auto;
    flex-shrink: 0;
}

.profile-bar-action {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease);
}

.profile-bar-action:hover {
    color: var(--accent);
}

/* Follow suggestions — horizontal bar */
.suggestions-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--card-border-width) solid var(--card-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    overflow-x: auto;
}

.suggestions-label {
    font-family: var(--font-display);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-muted);
    text-transform: lowercase;
    letter-spacing: var(--letter-spacing-wide);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Feed controls (header + toggle row) */
.feed-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

/* Feed header */
.feed-header {
    font-family: var(--font-display);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-light);
    font-style: italic;
    color: var(--text-muted);
    padding: var(--space-xs) 0;
    letter-spacing: var(--letter-spacing-wide);
    text-transform: lowercase;
}

.sidebar-section-title {
    font-family: var(--font-display);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-muted);
    text-transform: lowercase;
    letter-spacing: var(--letter-spacing-wide);
    margin-bottom: var(--space-md);
}

/* Follow suggestions */
.suggestions-list {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.suggestion-profile {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.suggestion-profile:hover {
    text-decoration: none;
}

.suggestion-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--avatar-bg);
    flex-shrink: 0;
}

.suggestion-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.suggestion-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-handle {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-follow-btn {
    flex-shrink: 0;
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-xs);
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-xs);
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing);
    text-transform: uppercase;
    margin-bottom: var(--space-xl);
    color: var(--text-secondary);
}

/* Feed container */
.feed-container {
    max-width: var(--content-width);
    margin: 0 auto;
}

/* .btn — alias system matching button/. button tiers */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    cursor: pointer;
    border: 1px solid var(--btn-secondary-border);
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--btn-radius);
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing);
    text-decoration: none;
    transition: all var(--duration) var(--ease);
}

.btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--btn-text);
    border-color: transparent;
    box-shadow: var(--btn-shadow);
}

.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: var(--btn-text);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--btn-secondary-border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--btn-ghost-text);
}

.btn-ghost:hover {
    background: var(--tint-warm);
    border-color: transparent;
    color: var(--accent);
}

.btn-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border-color: transparent;
}

.btn-danger:hover {
    background: var(--color-danger);
    color: var(--btn-text);
    box-shadow: var(--shadow-sm);
}

.btn-full {
    width: 100%;
}

/* Input styles */
.input {
    width: 100%;
    padding: var(--input-padding);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--input-radius);
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    color: var(--text);
    transition: all var(--duration) var(--ease);
    text-align: center;
}

.input::placeholder {
    color: var(--text-muted);
}

.input:focus {
    outline: none;
    background: var(--input-bg-focus);
    border-color: var(--input-border-focus);
    box-shadow: var(--focus-ring);
}

/* Navigation links */
.nav-link {
    padding: 7px 16px;
    font-size: 13.5px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-round);
    font-family: var(--font-body);
    font-weight: var(--font-weight-normal);
    transition: all 0.35s var(--ease-spring);
    position: relative;
}

.nav-link::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius-round);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--coral) 8%, transparent),
        color-mix(in srgb, var(--amber) 6%, transparent));
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.4s var(--ease-spring);
}

.nav-link:hover {
    color: var(--coral);
    transform: translateY(-2px);
}

.nav-link:hover::before {
    opacity: 1;
    transform: scale(1);
}

.nav-link.active {
    color: var(--coral);
    font-weight: var(--font-weight-medium);
}

.nav-link.active::before {
    opacity: 1;
    transform: scale(1);
}

.nav-emoji {
    display: inline-block;
    margin-right: 3px;
    font-family: 'GT Maru Emoji', sans-serif;
    font-size: 14px;
    transition: transform 0.4s var(--ease-spring);
}

.nav-link:hover .nav-emoji {
    transform: translateY(-3px) scale(1.2) rotate(-8deg);
}

.nav-link-primary {
    background: var(--gradient-accent);
    color: var(--btn-text);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--btn-radius);
    box-shadow: var(--btn-shadow);
}

.nav-link-primary:hover {
    background: var(--gradient-accent);
    filter: brightness(1.05);
    box-shadow: var(--shadow-glow);
    color: var(--btn-text);
}

.nav-link-primary::before {
    display: none;
}

/* =============================================
   PROFILE AMBIENT BASELINE
   Let the user's --bg carry the whole page. No overlays, no
   particles — the vibe (flat color or gradient) paints the
   viewport directly so ember, midnight, aurora, rainbow etc.
   read cleanly without cream radials layered on top.
   ============================================= */
body:has(.profile-page) {
    background: var(--bg);
    background-attachment: var(--profile-ambient-bg-attachment);
}

/* Glassmorphic surfaces for profile cards and posts. Tints from the
   user's --surface / --surface-border / --text so swapping vibes
   (ember, midnight, aurora) carries through. Keeps the backdrop-filter
   so the glass effect still works on any bg, gradient or solid.
   Header is intentionally excluded — its appearance is driven entirely
   by --profile-header-* tokens so the customize toggle owns it. */
.profile-page pollen-post,
.profile-page .card {
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--card-border-width) var(--card-border-style, solid) var(--surface-border);
    border-radius: var(--card-radius);
    /* Card shadow uses --card-shadow so toggling borders to 0 can also drop
       the shadow for a truly edgeless look. Default keeps the soft glass shadow. */
    box-shadow: var(--card-shadow, 0 4px 20px color-mix(in srgb, var(--text) 8%, transparent));
}

/* Profile page */
.profile-page {
    max-width: var(--content-width);
    margin: 0 auto;
}

/* Profile header — clean by default, card styling opt-in.
   When the user enables the header card the customize panel feeds:
     --profile-header-bg          (color-mix surface tint or transparent)
     --profile-header-padding     (16–64px)
     --profile-header-blur        (0–24px backdrop blur)
     --profile-header-radius      (matches --card-radius by default)
   Sticky position is driven by --header-position so the customize toggle
   can flip it without us reaching for a class hook. */
.profile-header {
    padding: var(--profile-header-padding, var(--space-2xl) var(--space-xl));
    text-align: var(--header-align, center);
    margin-bottom: var(--space-xl);
    background: var(--profile-header-bg, transparent);
    border: var(--profile-header-border, none);
    border-radius: var(--profile-header-radius, var(--card-radius, 12px));
    box-shadow: var(--profile-header-shadow, none);
    backdrop-filter: blur(var(--profile-header-blur, 0px));
    -webkit-backdrop-filter: blur(var(--profile-header-blur, 0px));
    position: var(--header-position, static);
    top: var(--space-md);
    z-index: 10;
}

/* Legacy class for backwards compatibility */
.profile-card-large {
    padding: var(--space-xl);
    text-align: var(--header-align, center);
    margin-bottom: var(--space-xl);
}

.profile-avatar-large {
    width: var(--avatar-size, 100px);
    height: var(--avatar-size, 100px);
    border-radius: 50%;
    background: var(--avatar-bg, linear-gradient(135deg, #f5ebe6 0%, #ede4df 100%));
    margin: 0 auto var(--space-lg);
    box-shadow: var(--avatar-shadow, none);
    view-transition-name: profile-avatar;
}

/* Left-aligned header adjustments */
.profile-header[style*="--header-align: left"] .profile-avatar-large,
.profile-card-large[style*="--header-align: left"] .profile-avatar-large,
.profile-page:has([style*="--header-align: left"]) .profile-avatar-large {
    margin-left: 0;
    margin-right: auto;
}

.profile-display-name {
    font-family: var(--font-display);
    font-size: var(--font-size-3xl, 2rem);
    font-weight: var(--font-weight-normal, 400);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--text);
    margin-bottom: var(--space-xs);
    view-transition-name: page-title;
}

.profile-handle-large {
    font-size: var(--font-size-base);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.profile-pronouns {
    color: var(--text-secondary);
    font-style: italic;
}

.profile-bio-large {
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
}

.profile-header #profile-follow-btn,
.profile-card-large #profile-follow-btn {
    margin-top: var(--space-lg);
}

/* Profile actions — follow button plus a quiet overflow menu. The cluster
   follows --header-align so centered and left-aligned headers both work. */
.profile-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.profile-actions #profile-follow-btn {
    margin-top: 0;
}

.profile-more {
    position: relative;
    display: inline-flex;
}

.profile-more-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-md, 1rem);
    letter-spacing: 0.05em;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s var(--ease-spring), color 0.2s var(--ease-spring);
}

.profile-more-btn:hover,
.profile-more-btn[aria-expanded="true"] {
    background: var(--tint-warm);
    color: var(--text);
}

.profile-more-btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.profile-more-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    padding: var(--space-xs);
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-lg, var(--shadow-md));
    z-index: 30;
}

.profile-more-item {
    display: block;
    width: 100%;
    max-width: 260px;
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-sm, 8px);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: var(--font-size-sm, 0.875rem);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background 0.15s ease-out, color 0.15s ease-out;
}

.profile-more-item:hover,
.profile-more-item:focus-visible {
    background: var(--tint-warm);
    color: var(--text);
    outline: none;
}

.profile-more-item-danger:hover,
.profile-more-item-danger:focus-visible {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* Bloom calendar — sits quietly between the header and the feed */
.profile-bloom-calendar {
    text-align: center;
    margin: calc(var(--space-xl) * -0.5) 0 var(--space-xl);
}

/* Left-aligned bio */
.profile-header[style*="--header-align: left"] .profile-bio-large,
.profile-card-large[style*="--header-align: left"] .profile-bio-large {
    margin-left: 0;
    margin-right: auto;
    text-align: left;
}

/* Profile banner — sits above the header, rounded top, optional via
   --banner-display. Avatar overlaps the banner edge when both are present
   (handled by negative margin on the header below). */
.profile-page .profile-banner {
    display: var(--banner-display, block);
    width: 100%;
    height: var(--banner-height, 220px);
    background-size: cover;
    background-position: center;
    background-color: color-mix(in srgb, var(--accent) 12%, var(--surface));
    border-radius: var(--card-radius, 12px) var(--card-radius, 12px) 0 0;
    margin-bottom: calc(var(--avatar-size, 80px) * -0.5);
}

.profile-page .profile-banner + .profile-header {
    position: relative;
    padding-top: calc(var(--avatar-size, 80px) * 0.5 + var(--space-lg));
}

.profile-page .profile-banner + .profile-header .profile-avatar-large {
    position: relative;
    z-index: 1;
    border: 4px solid var(--surface);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--text) 12%, transparent);
}

/* Error page */
.error-page {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-3xl);
}

.error-page h1 {
    font-family: var(--font-display);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-ultrabold);
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: var(--space-md);
}

.error-page p {
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

/* =============================================
   EXPLORE PAGE
   ============================================= */

/* Scroll timeline for background animation */
@supports (animation-timeline: scroll()) {
    .explore-page {
        timeline-scope: --page-scroll;
    }
}

.explore-page {
    scroll-timeline: --page-scroll block;
}

/* Hero Section */
.explore-hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: var(--space-3xl) var(--space-lg) 0;
}

.explore-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 12vw, 56px);
    font-weight: 600;
    font-style: italic;
    letter-spacing: var(--letter-spacing-tight);
    color: var(--text);
    animation: hero-in 0.8s var(--ease-spring) both;
    view-transition-name: page-title;
}

.explore-tagline {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-style: italic;
    margin-top: var(--space-xs);
    animation: hero-in 0.8s var(--ease-spring) 0.1s both;
}

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

/* Controls Area */
.controls-area {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: var(--space-lg) auto 0;
    padding: 0 var(--space-md);
    animation: hero-in 0.8s var(--ease-spring) 0.15s both;
}

/* Tag filters — glass bar */
.tag-filters {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.35));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tag-filters::-webkit-scrollbar {
    display: none;
}

.tag-pill {
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-round);
    font-size: var(--font-size-xs);
    font-family: var(--font-body);
    color: var(--text-secondary);
    background: transparent;
    border: 1.5px solid color-mix(in srgb, var(--brown-light) 20%, transparent);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--duration) var(--ease-spring);
    flex-shrink: 0;
}

.tag-pill:hover {
    border-color: var(--coral-soft);
    color: var(--coral);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.tag-pill-active {
    background: var(--gradient-accent);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.tag-pill-active:hover {
    color: #fff;
}

/* Sort + Type + Layout bar */
.sort-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.3));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.sort-group {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius);
    padding: var(--space-xs);
}

.bar-divider {
    width: 1px;
    height: 20px;
    background: color-mix(in srgb, var(--brown-light) 15%, transparent);
    margin: 0 var(--space-xs);
    flex-shrink: 0;
}

.type-pills {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
}

.type-pills::-webkit-scrollbar {
    display: none;
}

/* Filter pills — used in both sort-group and type-pills */
.filter-pill {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-family: var(--font-body);
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--duration) var(--ease-spring);
    white-space: nowrap;
}

.filter-pill:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.4);
}

.filter-pill-active {
    background: #fff;
    color: var(--coral);
    box-shadow: var(--shadow-sm);
    font-weight: var(--font-weight-medium);
}

/* Type pills — slightly smaller */
.type-pills .filter-pill {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
}

.type-pills .filter-pill-active {
    background: color-mix(in srgb, var(--coral) 8%, transparent);
    color: var(--coral);
    box-shadow: none;
}

/* Layout switcher */
.layout-switcher {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius);
    padding: var(--space-xs);
    margin-left: auto;
    flex-shrink: 0;
}

.layout-btn {
    all: unset;
    width: 30px;
    height: 26px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--duration) var(--ease-spring);
    box-sizing: border-box;
}

.layout-btn:hover {
    color: var(--text-secondary);
}

.layout-btn.active {
    background: #fff;
    color: var(--coral);
    box-shadow: var(--shadow-sm);
}

.layout-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Explore Feed — full-bleed within main's wide bounds; controls stay centered */
.explore-feed {
    position: relative;
    z-index: 1;
    margin: var(--space-md) 0 var(--space-4xl);
    padding: 0 var(--space-md);
}

/* Tag page back button */
.tag-back {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

/* Scroll-driven animations for cards */
@supports (animation-timeline: view()) {
    .explore-feed pollen-post {
        animation: card-reveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 30%;
    }

    @keyframes card-reveal {
        from {
            opacity: 0;
            transform: translateY(40px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .explore-title,
    .explore-tagline,
    .controls-area,
    .explore-feed pollen-post {
        animation: none;
    }

    .tag-pill,
    .filter-pill,
    .layout-btn {
        transition: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .explore-hero {
        padding: var(--space-2xl) var(--space-md) var(--space-xl);
    }

    .controls-area {
        padding: 0 var(--space-md);
    }

    .sort-bar {
        gap: var(--space-sm);
    }

    .bar-divider {
        display: none;
    }

    .type-pills {
        width: 100%;
    }

    .layout-switcher {
        margin-left: 0;
    }

    .explore-feed {
        padding: 0 var(--space-md);
    }
}

/* =============================================
   END EXPLORE PAGE
   ============================================= */

/* =============================================
   PROFILE PAGE LAYOUT & WIDTH OPTIONS
   ============================================= */

/* Profile page container - uses CSS variable from customization */
.profile-page {
    max-width: var(--profile-width);
    margin: 0 auto;
    transition: max-width 0.3s var(--ease);
    font-size: calc(var(--font-size-base) * var(--font-scale) / 100);
}

/* Width variants (fallback classes for profiles without custom CSS) */
.profile-page.width-narrow {
    max-width: 500px;
}

.profile-page.width-standard {
    max-width: 700px;
}

.profile-page.width-wide {
    max-width: 900px;
}

.profile-page.width-full {
    max-width: 100%;
    padding: 0 var(--space-lg);
}

@media (min-width: 1400px) {
    .profile-page.width-full {
        padding: 0 var(--space-xl);
    }
}

/* Profile card adjustments for wide/full */
.profile-page.width-wide .profile-card-large,
.profile-page.width-full .profile-card-large {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.profile-posts {
    margin-top: var(--space-lg);
}

/* Column layout - single column blog-style */
.profile-posts-column {
    display: flex;
    flex-direction: column;
    gap: var(--profile-gap);
    max-width: var(--content-width);
    margin: 0 auto;
}

/* Masonry layout - CSS columns for true masonry */
.profile-posts-masonry {
    column-count: var(--profile-columns);
    column-gap: var(--profile-gap);
}

.profile-posts-masonry > * {
    break-inside: avoid;
    margin-bottom: var(--profile-gap);
}

/* Grid layout - Instagram-style uniform grid */
.profile-posts-grid {
    display: grid;
    grid-template-columns: repeat(var(--profile-columns), 1fr);
    gap: var(--profile-gap);
}

.profile-posts-grid > * {
    aspect-ratio: 1;
    overflow: hidden;
}

/* Magazine layout - featured post + smaller posts */
.profile-posts-magazine {
    display: grid;
    grid-template-columns: repeat(var(--profile-columns), 1fr);
    gap: var(--profile-gap);
}

.profile-posts-magazine > *:first-child {
    grid-column: 1 / -1;
}

/* Post display toggles via CSS variables */
.profile-page .post-timestamp {
    display: var(--timestamp-display);
}

.profile-page .post-tags {
    display: var(--tags-display);
}

.profile-page .profile-banner {
    display: var(--banner-display);
}

/* Compact reactions mode */
.profile-page[style*="--reactions-size: compact"] .post-reactions,
.profile-page .post-reactions[data-compact="true"] {
    font-size: var(--font-size-xs);
    gap: var(--space-xs);
}

/* Responsive layouts - override column count for small screens */
@media (max-width: 640px) {
    .profile-posts-masonry,
    .profile-posts-grid,
    .profile-posts-magazine {
        column-count: 1;
        grid-template-columns: 1fr;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .profile-posts-masonry,
    .profile-posts-grid,
    .profile-posts-magazine {
        column-count: min(var(--profile-columns), 2);
        grid-template-columns: repeat(min(var(--profile-columns), 2), 1fr);
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .profile-posts-masonry,
    .profile-posts-grid,
    .profile-posts-magazine {
        column-count: min(var(--profile-columns), 3);
        grid-template-columns: repeat(min(var(--profile-columns), 3), 1fr);
    }
}

/* =============================================
   END PROFILE POSTS LAYOUT
   ============================================= */

/* Utility classes */
.text-center {
    text-align: center;
}
.text-muted {
    color: var(--text-muted);
}
.text-secondary {
    color: var(--text-secondary);
}

/* Animation classes */
.fade-in {
    animation: fade-float-in 0.8s var(--ease) backwards;
}

.stagger-1 {
    animation-delay: 0.1s;
}
.stagger-2 {
    animation-delay: 0.2s;
}
.stagger-3 {
    animation-delay: 0.3s;
}
.stagger-4 {
    animation-delay: 0.4s;
}
.stagger-5 {
    animation-delay: 0.5s;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-with-sidebar {
        grid-template-columns: 1fr;
        max-width: var(--content-width);
        margin: 0 auto;
    }

    .sidebar {
        display: none;
    }

    .profile-bar-handle {
        display: none;
    }
}

@media (max-width: 768px) {
    .top-nav {
        padding: var(--space-sm) var(--space-md);
        flex-wrap: wrap;
        gap: var(--space-xs) var(--space-sm);
    }

    .nav-links {
        gap: 0;
        align-items: center;
        flex-shrink: 0;
    }

    .nav-link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 6px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    .nav-emoji {
        display: none;
    }

    .profile-bar-action {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    main,
    .main-content {
        padding: var(--space-xl) var(--space-md);
    }

    .landing-title::after {
        display: none;
    }

    .landing-actions {
        flex-direction: column;
        width: 100%;
        padding: 0 var(--space-lg);
    }

    .landing-actions .btn {
        width: 100%;
    }

    .login-card {
        padding: var(--space-xl);
    }
}

/* =============================================
   SITE FOOTER
   ============================================= */

.site-footer {
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
    margin-top: auto;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.site-footer p {
    margin: 0;
    color: var(--text-muted);
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}

.site-footer a:hover {
    color: var(--accent);
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: var(--space-sm) var(--space-md);
    background: var(--accent);
    color: var(--btn-text);
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* =============================================
   THANKS/CREDITS PAGE
   ============================================= */

.thanks-page {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.thanks-title {
    font-family: var(--font-display);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-ultrabold);
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: var(--space-md);
    text-transform: lowercase;
}

.thanks-intro {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2xl);
}

.credits-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.credit-item {
    background: var(--card-bg);
    border: var(--card-border-width) solid var(--card-border);
    border-radius: var(--card-radius);
    padding: var(--space-xl);
    text-align: left;
}

.credit-item h3 {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-sm);
}

.credit-item p {
    color: var(--text-secondary);
    margin: 0;
}

.credit-item a {
    color: var(--accent);
}

.credit-item a:hover {
    text-decoration: underline;
}

.thanks-back {
    margin-top: var(--space-xl);
}

/* =============================================
   ABOUT PAGE
   ============================================= */

.about-page {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-lg) var(--space-4xl);
}

.about-header {
    margin-bottom: var(--space-3xl);
}

.about-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw + 1rem, var(--font-size-5xl));
    font-weight: var(--font-weight-light);
    letter-spacing: var(--letter-spacing-tight);
    line-height: var(--line-height-tight);
    text-transform: lowercase;
    margin-bottom: var(--space-sm);
}

.about-subtitle {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-light);
    font-style: italic;
    color: var(--text-muted);
    letter-spacing: var(--letter-spacing);
}

/* Story section — the heart of the page */
.about-story {
    margin-bottom: var(--space-3xl);
}

.about-story p {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-loose);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    max-width: 65ch;
}

.about-story p:first-child {
    font-family: var(--font-display);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-light);
    color: var(--text);
    line-height: 1.4;
}

.about-story p:last-child {
    margin-bottom: 0;
}

.about-story a {
    color: var(--accent-warm);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent-warm) 35%, transparent);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--duration-fast) var(--ease);
}

.about-story a:hover {
    text-decoration-color: var(--accent-warm);
}

/* Stats section — big numbers as pull-quotes */
.about-stats {
    margin-bottom: var(--space-3xl);
    padding: var(--space-3xl) 0;
    border-block: 1px solid var(--surface-border);
}

.about-stat-hero {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-xl) 0;
}

.about-stat-hero:first-child {
    padding-top: 0;
}

.about-stat-hero:last-child {
    padding-bottom: 0;
}

.about-stat-number {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw + 1rem, 5.5rem);
    font-weight: var(--font-weight-light);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.about-stat-label {
    font-family: var(--font-display);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-light);
    font-style: italic;
    color: var(--text-muted);
    letter-spacing: var(--letter-spacing-wide);
}

/* Post type breakdown — a little inventory */
.about-type-breakdown {
    list-style: none;
    padding: var(--space-lg) var(--space-xl);
    margin: var(--space-lg) 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-xl);
    background: var(--tint-warm);
    border-radius: var(--radius-lg);
}

.about-type-breakdown li {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

.about-type-breakdown strong {
    font-weight: var(--font-weight-medium);
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.about-type-emoji {
    font-size: 0.85em;
}

/* Closing section */
.about-coda {
    padding-top: 0;
}

.about-coda p {
    font-size: var(--font-size-base);
    color: var(--text-muted);
    font-style: italic;
}

.about-coda a {
    color: var(--accent-warm);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent-warm) 35%, transparent);
    text-underline-offset: 3px;
}

.about-coda a:hover {
    text-decoration-color: var(--accent-warm);
}

/* Entrance animations */
@media (prefers-reduced-motion: no-preference) {
    .about-header,
    .about-story,
    .about-stats,
    .about-coda {
        animation: about-fade-up 600ms cubic-bezier(0.25, 1, 0.5, 1) both;
    }

    .about-story { animation-delay: 80ms; }
    .about-stats { animation-delay: 160ms; }
    .about-coda { animation-delay: 240ms; }

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

/* =============================================
   PRIVACY/POLICY PAGE
   ============================================= */

.policy-page {
    max-width: 700px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
}

.policy-title {
    font-family: var(--font-display);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-ultrabold);
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: var(--space-md);
    text-transform: lowercase;
    text-align: center;
}

.policy-intro {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2xl);
    text-align: center;
}

.policy-sections {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.policy-section {
    background: var(--card-bg);
    border: var(--card-border-width) solid var(--card-border);
    border-radius: var(--card-radius);
    padding: var(--space-xl);
}

.policy-section h2 {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-md);
    text-transform: lowercase;
}

.policy-section p {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    line-height: var(--line-height-loose);
}

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

.policy-section a {
    color: var(--accent);
}

.policy-section a:hover {
    text-decoration: underline;
}

.policy-back {
    text-align: center;
    margin-top: var(--space-xl);
}

/* =============================================
   SINGLE POST PAGE
   ============================================= */

.single-post-page {
    max-width: var(--content-width);
    margin: 0 auto;
}

.single-post-page .post-container {
    margin-bottom: var(--space-lg);
}

/* On single post pages, don't stretch images to full width */
.single-post-page pollen-post {
    --post-media-fit: contain;
}

.single-post-page pollen-image-content .post-media,
.single-post-page pollen-video-content .post-media {
    display: flex;
    justify-content: center;
    background: transparent;
}

.single-post-page pollen-image-content .post-media img,
.single-post-page pollen-video-content .post-media video {
    width: auto;
    max-width: 100%;
    max-height: 80vh;
}

.post-back {
    margin-top: var(--space-2xl);
    text-align: center;
}

/* Atmosphere tooltip */
.atmosphere-tooltip {
    position: relative;
    text-decoration: underline dotted;
    text-decoration-color: var(--accent-warm, #e8a55a);
    text-underline-offset: 3px;
    cursor: help;
}

.atmosphere-tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface, #fffdf8);
    color: var(--text, #3d3028);
    font-size: var(--font-size-xs, 0.75rem);
    line-height: 1.4;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius, 12px);
    border: 1px solid var(--card-border, rgba(232, 165, 90, 0.2));
    box-shadow: 0 4px 16px rgba(180, 150, 120, 0.12);
    white-space: normal;
    width: max-content;
    max-width: 260px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.atmosphere-tooltip:hover::after,
.atmosphere-tooltip:focus::after {
    opacity: 1;
}

/* =============================================
   CARD STYLE PERSONALIZATION TOGGLE
   ============================================= */

/* Style toggle component */
.style-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    user-select: none;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.style-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.style-toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--surface-border);
    border-radius: var(--radius-round);
    transition: background var(--duration-fast) var(--ease);
}

.style-toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform var(--duration-fast) var(--ease);
}

.style-toggle-input:checked + .style-toggle-slider {
    background: var(--accent);
}

.style-toggle-input:checked + .style-toggle-slider::before {
    transform: translateX(16px);
}

.style-toggle-input:focus-visible + .style-toggle-slider {
    box-shadow: var(--focus-ring);
}

.style-toggle-label {
    font-family: var(--font-body);
    white-space: nowrap;
}

.style-toggle:hover .style-toggle-label {
    color: var(--text);
}
