/* yuru.be Theme System - Industrial Zen */

:root {
    /* ========================================
       INDUSTRIAL ZEN - Color System
       Muted grays, high contrast, subtle accent
       ======================================== */

    /* Base colors - Dark theme (default) */
    --bg: #0a0a0a;
    --bg-elevated: #141414;
    --bg-subtle: #1a1a1a;
    --fg: #e8e8e8;
    --fg-muted: #a0a0a0;
    --fg-subtle: #6a6a6a;

    /* Border system */
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --border-focus: rgba(255,255,255,0.24);

    /* Accent color (muted green default) */
    --accent: #7a9b7e;
    --accent-r: 122;
    --accent-g: 155;
    --accent-b: 126;
    --accent-soft: rgba(122,155,126,0.08);
    --accent-muted: rgba(122,155,126,0.16);

    /* Semantic colors - muted palette */
    --success: #7a9b7e;
    --error: #b08080;
    --warning: #b0a080;
    --info: #8090b0;

    /* Legacy color names for compatibility */
    --dim: var(--fg-muted);
    --dimmer: var(--fg-subtle);
    --hover: var(--accent-soft);

    /* Pastel palette (compatibility) */
    --white: #ffffff;
    --grey: #94a3b8;
    --red: #fca5a5;
    --green: #86efac;
    --blue: #93c5fd;
    --yellow: #fde68a;
    --cyan: #a5f3fc;
    --magenta: #f9a8d4;
    --purple: #c4b5fd;
    --red-soft: rgba(252,165,165,0.12);
    --green-soft: rgba(134,239,172,0.12);
    --blue-soft: rgba(147,197,253,0.12);
    --yellow-soft: rgba(253,230,138,0.12);
    --cyan-soft: rgba(165,243,252,0.12);
    --magenta-soft: rgba(249,168,212,0.12);

    /* ========================================
       SPACING SYSTEM - 4px base unit
       ======================================== */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* ========================================
       TIMING & EASING
       ======================================== */
    --transition-fast: 120ms;
    --transition-normal: 200ms;
    --transition-slow: 400ms;
    --transition-smooth: 400ms;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* ========================================
       SHADOWS - Subtle elevation
       ======================================== */
    --shadow-subtle: 0 1px 2px rgba(0,0,0,0.3), 0 0 0 1px var(--border);
    --shadow-elevated: 0 4px 12px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
    --shadow-focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-muted);

    /* ========================================
       RADIUS - Sharp but not harsh
       ======================================== */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* ========================================
       TOUCH TARGETS
       ======================================== */
    --touch-min: 44px;
    --touch-spacing: 8px;

    /* ========================================
       TYPOGRAPHY - Monospace hierarchy
       ======================================== */
    --font-mono: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Courier New', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    --text-xs: 0.6875rem;    /* 11px */
    --text-sm: 0.8125rem;    /* 13px */
    --text-base: 0.9375rem;  /* 15px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.375rem;     /* 22px */
    --text-2xl: 1.75rem;     /* 28px */

    --line-height: 1.6;
    --line-height-tight: 1.4;
    --line-height-loose: 1.8;

    /* Grid removed - orbs only */

    /* Legacy compat */
    --toast-bg: var(--bg-elevated);
    --modal-bg: var(--bg-elevated);
    --card-bg: var(--bg-elevated);
    --glass-bg: rgba(10,10,10,0.7);
    --glass-border: var(--border);
    --glow-accent: 0 0 20px rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.3);
    --glow-sm: 0 0 10px rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.2);
}

/* ========================================
   LIGHT THEME - Industrial zen in daylight
   ======================================== */
[data-theme="light"] {
    --bg: #f5f5f5;
    --bg-elevated: #ffffff;
    --bg-subtle: #ececec;
    --fg: #1a1a1a;
    --fg-muted: #606060;
    --fg-subtle: #909090;

    --border: rgba(0,0,0,0.08);
    --border-hover: rgba(0,0,0,0.16);
    --border-focus: rgba(0,0,0,0.32);

    --accent: #5a7a5e;
    --accent-r: 90;
    --accent-g: 122;
    --accent-b: 94;
    --accent-soft: rgba(90,122,94,0.06);
    --accent-muted: rgba(90,122,94,0.12);

    --shadow-subtle: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px var(--border);
    --shadow-elevated: 0 4px 12px rgba(0,0,0,0.08), 0 0 0 1px var(--border);

    --success: #5a7a5e;
    --error: #906060;
    --warning: #908060;
    --info: #607090;

    --glass-bg: rgba(245,245,245,0.7);
}

/* ========================================
   ANIMATED BACKGROUND
   ======================================== */
#yuru-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* Grid texture removed - orbs only */

/* ========================================
   NOISE OVERLAY - Film grain texture
   ======================================== */
.noise,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.012;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    z-index: 9999;
    mix-blend-mode: overlay;
}

/* ========================================
   GLOBAL RESET & BASE STYLES
   ======================================== */
* {
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

html {
    overscroll-behavior: contain;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-mono);
    font-size: var(--text-base);
    line-height: var(--line-height);
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}

/* ========================================
   CUSTOM SCROLLBAR - Industrial aesthetic
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fg-subtle);
    background-clip: padding-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-hover) transparent;
}

/* ========================================
   TEXT SELECTION
   ======================================== */
::selection {
    background: var(--accent-muted);
    color: var(--fg);
}

::-moz-selection {
    background: var(--accent-muted);
    color: var(--fg);
}

/* ========================================
   FOCUS STATES - Intentional & precise
   ======================================== */
:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
    transition: box-shadow var(--transition-fast) var(--ease-out-expo);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible,
[role="radio"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* ========================================
   PREVENT TEXT SELECTION ON UI ELEMENTS
   ======================================== */
button, .btn, .card-interactive, .link, .back-link, .theme-color, .ai-card {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

/* ========================================
   LINK STYLES
   ======================================== */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-normal) var(--ease-out-expo);
}

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

/* ========================================
   CARDS - Industrial containers
   ======================================== */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition:
        border-color var(--transition-normal) var(--ease-out-expo),
        box-shadow var(--transition-normal) var(--ease-out-expo),
        transform var(--transition-fast) var(--ease-out-expo);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-subtle);
}

.card-sm {
    padding: var(--space-3);
    border-radius: var(--radius-md);
}

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    border-color: var(--accent-soft);
    box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow-subtle);
}

.card-interactive:active {
    transform: scale(0.98);
    transition: transform 60ms var(--ease-out-expo);
}

/* ========================================
   BUTTONS - Mechanical precision
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    min-height: var(--touch-min);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition:
        border-color var(--transition-normal) var(--ease-out-expo),
        background var(--transition-normal) var(--ease-out-expo),
        color var(--transition-normal) var(--ease-out-expo),
        transform var(--transition-fast) var(--ease-out-expo);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-soft);
    opacity: 0;
    transition: opacity var(--transition-fast) var(--ease-out-expo);
    pointer-events: none;
}

.btn:hover {
    border-color: var(--border-hover);
    background: var(--accent-soft);
}

.btn:active {
    transform: scale(0.97);
    transition: transform 60ms var(--ease-out-expo);
}

.btn:active::before {
    opacity: 1;
}

.btn-primary {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.btn-primary:hover {
    background: var(--fg-muted);
    border-color: var(--fg-muted);
}

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

.btn-accent:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    min-height: 36px;
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
}

.btn-icon {
    padding: var(--space-3);
    min-width: var(--touch-min);
    min-height: var(--touch-min);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
    background: transparent;
    border-color: var(--border);
}

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 50%;
    left: 50%;
    margin-left: -7px;
    margin-top: -7px;
    border: 2px solid var(--fg);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   INPUT FIELDS - Clean & functional
   ======================================== */
.input,
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="url"],
input[type="number"],
textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    min-height: var(--touch-min);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: max(16px, var(--text-sm));
    line-height: var(--line-height);
    transition:
        border-color var(--transition-normal) var(--ease-out-expo),
        box-shadow var(--transition-normal) var(--ease-out-expo),
        background var(--transition-normal) var(--ease-out-expo);
}

.input:hover {
    border-color: var(--border-hover);
}

.input:focus,
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input::placeholder {
    color: var(--fg-subtle);
}

textarea.input,
textarea {
    min-height: 120px;
    resize: vertical;
    line-height: var(--line-height-loose);
}

/* ========================================
   BADGES & TAGS
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-accent {
    background: var(--accent-soft);
    border-color: var(--accent-muted);
    color: var(--accent);
}

/* ========================================
   LABELS & CAPTIONS
   ======================================== */
.label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg-subtle);
    font-weight: 500;
}

.label-accent {
    color: var(--accent);
}

/* ========================================
   BACK LINK - Navigation element
   ======================================== */
.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--fg);
    text-decoration: none;
    transition:
        border-color var(--transition-normal) var(--ease-out-expo),
        background var(--transition-normal) var(--ease-out-expo),
        transform var(--transition-fast) var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.back-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-soft);
    opacity: 0;
    transition: opacity var(--transition-fast) var(--ease-out-expo);
}

.back-link:hover {
    background: var(--accent-soft);
    border-color: var(--border-hover);
}

.back-link:active {
    transform: scale(0.96);
    transition: transform 60ms var(--ease-out-expo);
}

.back-link:active::before {
    opacity: 1;
}

/* ========================================
   DIVIDERS
   ======================================== */
.divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-4) 0;
}

/* ========================================
   STATUS INDICATORS
   ======================================== */
.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot-static {
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast {
    position: fixed;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    box-shadow: var(--shadow-elevated);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity var(--transition-normal) var(--ease-out-expo),
        visibility var(--transition-normal) var(--ease-out-expo),
        transform var(--transition-slow) var(--ease-out-expo);
    z-index: 8000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   GLASSMORPHISM UTILITY
   ======================================== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
}

/* ========================================
   CONTAINER UTILITIES
   ======================================== */
.container-accent {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition:
        border-color var(--transition-normal) var(--ease-out-expo),
        box-shadow var(--transition-normal) var(--ease-out-expo);
}

.container-accent:hover {
    border-color: var(--accent-soft);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

/* ========================================
   SKELETON LOADERS
   ======================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-subtle) 0%,
        var(--border-hover) 50%,
        var(--bg-subtle) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: var(--space-2);
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: var(--space-4);
}

.skeleton-button {
    height: var(--touch-min);
    width: 120px;
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-lg);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

/* ========================================
   ANIMATIONS - Calm transitions
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeSlide {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutLeft {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes glow {
    0%, 100% { box-shadow: var(--glow-sm); }
    50% { box-shadow: var(--glow-accent); }
}

@keyframes scalePress {
    0% { transform: scale(1); }
    50% { transform: scale(0.96); }
    100% { transform: scale(1); }
}

/* ========================================
   PAGE TRANSITIONS
   ======================================== */
.page-enter {
    animation: slideInRight var(--transition-slow) var(--ease-out-expo);
}

.page-exit {
    animation: slideOutLeft var(--transition-slow) var(--ease-out-expo);
}

.fade-enter {
    animation: fadeIn var(--transition-normal) var(--ease-out-expo);
}

/* ========================================
   FLEX/GRID UTILITIES
   ======================================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row-mobile-col { flex-direction: row; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-4); }
.gap-lg { gap: var(--space-6); }

/* ========================================
   TOUCH SPACING UTILITIES
   ======================================== */
.touch-spacing-y > * + * {
    margin-top: var(--space-3);
}

.touch-spacing-x > * + * {
    margin-left: var(--space-3);
}

/* ========================================
   PULL-TO-REFRESH (Visual only)
   ======================================== */
.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
    opacity: 0;
    transform: translateY(-100%);
    transition:
        transform var(--transition-slow) var(--ease-out-expo),
        opacity var(--transition-slow) var(--ease-out-expo);
    pointer-events: none;
    z-index: 8500;
}

.pull-to-refresh.visible {
    opacity: 1;
    transform: translateY(0);
}

.pull-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Screen Reader Only Text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to Main Content Link */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 10000;
    padding: 1rem 1.5rem;
    background: var(--fg);
    color: var(--bg);
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    font-weight: 500;
}

.skip-to-main:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 0;
}

/* ========================================
   RESPONSIVE - Touch device optimizations
   ======================================== */

/* Small phones */
@media (max-width: 480px) {
    :root {
        --touch-min: 48px;
        --touch-spacing: 12px;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .flex-row-mobile-col {
        flex-direction: column;
    }

    .btn-full-mobile {
        width: 100%;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    :root {
        --touch-min: 48px;
        --touch-spacing: 12px;
    }

    .btn, .input, .back-link {
        min-height: 48px;
        -webkit-tap-highlight-color: rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.1);
    }

    .btn-icon {
        min-width: 48px;
        min-height: 48px;
    }

    .touch-spacing-y > * + * {
        margin-top: var(--touch-spacing);
    }

    .touch-spacing-x > * + * {
        margin-left: var(--touch-spacing);
    }

    .btn:active,
    .card-interactive:active,
    .link:active {
        transform: scale(0.96);
        transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .toast {
        bottom: max(2rem, calc(2rem + env(safe-area-inset-bottom)));
    }
}

/* Landscape mode optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .noise,
    body::after {
        opacity: 0;
    }

    .skeleton,
    .pulse,
    .status-dot {
        animation: none !important;
    }

    .skeleton {
        background: var(--bg-subtle);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border: rgba(255, 255, 255, 0.3);
        --fg-subtle: rgba(255, 255, 255, 0.7);
    }

    .btn,
    .card,
    .input {
        border-width: 2px;
    }
}

/* Print styles */
@media print {
    body::before,
    body::after,
    .noise,
    #yuru-bg {
        display: none;
    }
}

/* ========================================
   TOOL/PAGE SHARED PATTERNS
   ======================================== */

/* Tool header with back button */
.tool-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.tool-header .title {
    font-size: var(--text-lg);
    font-weight: 500;
}

/* Page container - standard max-width with animation */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    animation: fadeUp 0.5s ease-out;
    position: relative;
    z-index: 1;
}

.page-container-lg {
    max-width: 1000px;
}

.page-container-xl {
    max-width: 1200px;
}

/* Section labels */
.section-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg-subtle);
    padding: 1rem 1rem 0.5rem;
}

/* Column container with gap separators */
.column-container {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.column-container:hover {
    border-color: rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.3);
    box-shadow: 0 0 20px rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.08);
}

/* Link item inside column */
.link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    min-height: var(--touch-min);
    background: var(--bg);
    color: var(--fg);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: background var(--transition-normal);
}

.link-item:hover {
    background: rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.06);
}

.link-item-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.link-item-icon {
    width: 14px;
    height: 14px;
    opacity: 0.5;
    flex-shrink: 0;
}

.link-item-arrow {
    opacity: 0.25;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}

.link-item:hover .link-item-arrow {
    opacity: 0.5;
    transform: translateX(2px);
}

/* Scrollable feed container */
.scroll-container {
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.3) transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
}

.scroll-container::-webkit-scrollbar {
    width: 6px;
}

.scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.3);
    border-radius: 3px;
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.5);
}

/* Pill/chip buttons */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    min-height: var(--touch-min);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--fg);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: all var(--transition-normal);
}

.pill:hover {
    border-color: rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.5);
    background: rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.08);
    box-shadow: 0 0 12px rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.15);
}

.pill:active {
    transform: scale(0.96);
}

.pill-icon {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

/* Footer */
.page-footer {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    color: var(--fg-subtle);
}

/* ========================================
   HOME PAGE SPECIFIC
   ======================================== */

/* Logo */
.logo {
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent);
    opacity: 0.8;
}

/* 3-column grid */
.home-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}
