/* Minimal landing — Joe Wimmer */

:root {
    --bg: #121110;
    --bg-accent: #1c1a17;
    --text: #edeae4;
    --muted: #9a958c;
    --accent: #a8c4b8;
    --focus: #7eb4ff;
    --font-sans: "DM Sans", system-ui, sans-serif;
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

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

html {
    -webkit-text-size-adjust: 100%;
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, var(--bg-accent), transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 100%, rgba(168, 196, 184, 0.08), transparent 50%);
}

.shell {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 5vw, 3rem);
}

.card {
    width: 100%;
    max-width: 28rem;
    text-align: center;
}

.name {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 2.75rem);
    font-weight: 500;
    font-variation-settings: "SOFT" 50, "WONK" 0.9;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.tagline {
    margin: 0 0 1.75rem;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 400;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    justify-content: center;
    align-items: center;
}

.links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.links a:hover {
    border-bottom-color: currentColor;
}

.links a:focus {
    outline: none;
}

.links a:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 4px;
    border-radius: 2px;
}

.fade-in {
    animation: fade-in 0.7s ease-out both;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Portal pages (/apps, /admin, /login) */

body.portal {
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, var(--bg-accent), transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 100%, rgba(168, 196, 184, 0.08), transparent 50%);
}

.portal-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.portal-topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem clamp(1.25rem, 4vw, 2.5rem);
    border-bottom: 1px solid rgba(237, 234, 228, 0.08);
    background: rgba(18, 17, 16, 0.72);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
}

.portal-brand-mark {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--bg);
    background: linear-gradient(145deg, var(--accent), #8aa89a);
}

.portal-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.portal-brand-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.2;
}

.portal-brand-sub {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.portal-main {
    flex: 1;
    width: 100%;
    max-width: 48rem;
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem) 3rem;
}

body.portal-wide .portal-main {
    max-width: 64rem;
}

body.portal-centered .portal-main {
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-main-narrow {
    max-width: 28rem;
}

.portal-hero {
    margin-bottom: 2rem;
}

.portal-eyebrow {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-title {
    margin: 0 0 0.5rem;
    font-family: var(--font-display);
    font-size: clamp(1.875rem, 4vw, 2.5rem);
    font-weight: 500;
    font-variation-settings: "SOFT" 50, "WONK" 0.9;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.portal-lead {
    margin: 0;
    max-width: 36rem;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.portal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
}

.portal-nav-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease;
}

.portal-nav-link:hover {
    background: rgba(168, 196, 184, 0.1);
}

.portal-actions {
    margin: 1.5rem 0 0;
}

.portal-footer-link {
    margin: 1.25rem 0 0;
    font-size: 0.9375rem;
    text-align: center;
}

.portal-footer-link a {
    color: var(--muted);
    text-decoration: none;
}

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

.portal-panel {
    padding: 1.5rem;
    border: 1px solid rgba(237, 234, 228, 0.1);
    border-radius: 0.875rem;
    background: rgba(28, 26, 23, 0.55);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.18);
}

.portal-signin {
    text-align: center;
    width: 100%;
}

.portal-section {
    margin-bottom: 1.25rem;
}

.section-title {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 500;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.625rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-primary:hover {
    background: #bfd8cc;
}

.btn-secondary {
    color: var(--text);
    background: rgba(237, 234, 228, 0.06);
    border-color: rgba(237, 234, 228, 0.12);
}

.btn-secondary:hover {
    background: rgba(237, 234, 228, 0.1);
    border-color: rgba(237, 234, 228, 0.2);
}

.btn-ghost {
    color: var(--muted);
    background: transparent;
    border-color: rgba(237, 234, 228, 0.12);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: rgba(237, 234, 228, 0.24);
    background: rgba(237, 234, 228, 0.04);
}

.btn-danger {
    color: #ffd8d8;
    background: rgba(180, 70, 70, 0.35);
    border-color: rgba(255, 160, 160, 0.25);
}

.btn-danger:hover {
    background: rgba(180, 70, 70, 0.5);
}

.btn-sm {
    padding: 0.45rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.8rem 1.25rem;
    font-size: 1rem;
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: 0.625rem;
    border: 1px solid transparent;
    margin-bottom: 1.25rem;
}

.alert-info {
    color: var(--text);
    background: rgba(168, 196, 184, 0.12);
    border-color: rgba(168, 196, 184, 0.2);
}

.alert-success {
    color: #d8f0e4;
    background: rgba(80, 140, 110, 0.25);
    border-color: rgba(120, 180, 150, 0.35);
}

.alert-error {
    color: #ffd8d8;
    background: rgba(140, 60, 60, 0.25);
    border-color: rgba(200, 100, 100, 0.35);
}

.app-grid {
    display: grid;
    gap: 1rem;
}

.app-grid[hidden] {
    display: none !important;
}

.app-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid rgba(237, 234, 228, 0.1);
    border-radius: 0.875rem;
    background: rgba(28, 26, 23, 0.55);
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.12);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.app-card:hover {
    border-color: rgba(168, 196, 184, 0.25);
    transform: translateY(-2px);
}

.app-card-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--bg);
    background: linear-gradient(145deg, rgba(168, 196, 184, 0.95), rgba(138, 168, 154, 0.85));
}

.app-card-body {
    flex: 1;
    min-width: 0;
}

.app-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.125rem;
    font-weight: 500;
}

.app-card-description {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    border: 1px dashed rgba(237, 234, 228, 0.15);
    border-radius: 0.875rem;
    background: rgba(28, 26, 23, 0.35);
}

.empty-state[hidden] {
    display: none !important;
}

.empty-state-icon {
    display: grid;
    grid-template-columns: repeat(2, 1rem);
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    opacity: 0.45;
}

.empty-state-icon span {
    display: block;
    width: 1rem;
    height: 1rem;
    border: 1px solid rgba(168, 196, 184, 0.5);
    border-radius: 0.25rem;
}

.empty-state h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
}

.empty-state p {
    margin: 0;
    max-width: 28rem;
    color: var(--muted);
    line-height: 1.6;
}

.portal-form {
    display: grid;
    gap: 1rem;
}

.form-row {
    display: grid;
    gap: 1rem;
}

.form-group {
    display: grid;
    gap: 0.35rem;
}

.form-group span {
    color: var(--muted);
    font-size: 0.875rem;
}

.form-group input,
.inline-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid rgba(237, 234, 228, 0.15);
    border-radius: 0.5rem;
    color: var(--text);
    background: rgba(18, 17, 16, 0.65);
    font: inherit;
}

.form-group input:focus,
.inline-select:focus,
.btn:focus-visible,
.portal-brand:focus-visible,
.portal-nav-link:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--text);
    background: rgba(168, 196, 184, 0.15);
    border: 1px solid rgba(168, 196, 184, 0.2);
}

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

.table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(237, 234, 228, 0.08);
    border-radius: 0.625rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(237, 234, 228, 0.08);
    text-align: left;
    vertical-align: top;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table th {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(18, 17, 16, 0.45);
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.inline-select {
    min-width: 9rem;
    max-width: 12rem;
}

@media (min-width: 40rem) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }

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

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

    .links a,
    .btn,
    .app-card {
        transition: none;
    }

    .btn:hover,
    .app-card:hover {
        transform: none;
    }
}
