/* ==========================================================================
   Oxyscapist — Tactile Editorial Generative Design System
   Seed: 10000000 (ken.cv Archetype)
   Material: Archival Ivory & Sumi Charcoal / Stacked Physical Dossier Sheets
   ========================================================================== */

:root {
    /* Palette & Paper Stocks */
    --canvas-bg: #1f1f23;
    --ground-color: #161619;
    --sheet-cream: #faf7f2;
    --sheet-tan: #f4efe6;
    --sheet-blue: #ebf0f4;
    --ink-primary: #18181b;
    --ink-secondary: #52525b;
    --ink-muted: #71717a;
    --accent-color: #c2410c;
    --accent-blue: #0284c7;
    --accent-green: #16a34a;
    --sheet-shadow: rgba(0, 0, 0, 0.32);

    /* Typography */
    --font-heading: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Liter', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Departure Mono', monospace;
    --font-hand: 'Slackside One', cursive;

    /* Physics & Elevation */
    --elevation-card: 0 16px 40px -8px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.12);
    --elevation-focused: 0 28px 65px -12px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.15);
    --radius-sheet: 8px;
    --radius-pill: 9999px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--canvas-bg);
    color: var(--ink-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.04) 0%, transparent 60%),
        linear-gradient(180deg, #1c1c20 0%, #17171a 100%);
}

/* ==========================================================================
   Tabletop Canvas & Environment
   ========================================================================== */
.lab-stage {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 84px 16px 100px;
}

.lab-canvas {
    position: relative;
    width: 100%;
    max-width: 1080px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lab-ground {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 180px;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 10, 12, 0.6) 100%);
    pointer-events: none;
    z-index: 1;
}

.lab-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.035;
    z-index: 2;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Minimal Topbar Navigation
   ========================================================================== */
.lab-topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: rgba(28, 28, 32, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 100;
}

.lab-topbar-left {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.lab-topbar-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 0.2s;
}

.lab-topbar-name:hover {
    color: #f4f4f5;
}

.lab-topbar-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #a1a1aa;
    letter-spacing: 0.03em;
}

/* Tab Switcher in Header */
.sheet-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.28);
    padding: 3px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-btn {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    color: #a1a1aa;
    background: transparent;
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn:hover {
    color: #ffffff;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.lab-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seed-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e4e4e7;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s;
}

.seed-badge:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.seed-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

#about-btn {
    font-family: var(--font-heading);
    font-size: 0.84rem;
    font-weight: 600;
    color: #d4d4d8;
    background: transparent;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    transition: color 0.2s;
}

#about-btn:hover {
    color: #ffffff;
}

.btn-primary {
    font-family: var(--font-heading);
    font-size: 0.84rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--accent-color);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(194, 65, 12, 0.35);
}

.btn-primary:hover {
    background: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 65, 12, 0.45);
}

/* ==========================================================================
   Envelope & Stationery Dossier Scene
   ========================================================================== */
.env-scene {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 12px auto 28px;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.env {
    width: 100%;
    background: #faf7f2;
    border: 1px solid #e5e0d8;
    border-radius: 8px;
    padding: 32px 36px;
    box-shadow: var(--elevation-card);
    text-align: left;
    cursor: pointer;
    display: flex;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
}

.env:hover {
    transform: translateY(-2px);
    box-shadow: var(--elevation-focused);
}

.env-face {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.env-address {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.env-name {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: #18181b;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.env-title {
    font-family: var(--font-hand);
    font-size: 1.45rem;
    color: #71717a;
    line-height: 1;
}

.env-blurb {
    font-family: var(--font-body);
    font-size: 0.96rem;
    color: #3f3f46;
    line-height: 1.45;
    margin-top: 6px;
    max-width: 420px;
}

.env-coords {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #a1a1aa;
    letter-spacing: 0.04em;
    margin-top: 8px;
}

/* Postmark Stamp & Cancellation */
.env-stamp {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.env-stamp-paper {
    width: 74px;
    height: 90px;
    background: #f4efe6;
    border: 1px dashed #a1a1aa;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    transform: rotate(2deg);
}

.stamp-emblem {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stamp-cube {
    width: 40px;
    height: 40px;
}

.stamp-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #18181b;
}

.env-cancel {
    position: absolute;
    top: -12px;
    right: -24px;
    width: 140px;
    height: 90px;
    pointer-events: none;
    color: #991b1b;
    stroke: currentColor;
    fill: currentColor;
    opacity: 0.85;
    transform: rotate(-6deg);
}

.env-cancel circle {
    fill: none;
    stroke-width: 1.8;
}

.env-cancel text {
    font-family: var(--font-heading);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    fill: #991b1b;
    stroke: none;
}

.env-waves path {
    fill: none;
    stroke-width: 1.4;
}

.env-back {
    display: none;
}

.lab-hint {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: #a1a1aa;
    margin-bottom: 24px;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lab-hint::before {
    content: "↓";
    font-size: 0.85rem;
    animation: bounceDown 1.5s infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* ==========================================================================
   Interactive Archival Paper Sheets (article.sheet)
   ========================================================================== */
.sheet {
    position: relative;
    width: 100%;
    max-width: 680px;
    border-radius: var(--radius-sheet);
    padding: 32px 36px;
    box-shadow: var(--elevation-card);
    margin-bottom: 32px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.sheet:focus-visible {
    box-shadow: 0 0 0 3px var(--accent-color), var(--elevation-focused);
}

/* Paper Tones */
.sheet[data-tone="cream"] {
    background-color: var(--sheet-cream);
    transform: rotate(-0.5deg);
}

.sheet[data-tone="tan"] {
    background-color: var(--sheet-tan);
    transform: rotate(0.6deg);
}

.sheet[data-tone="blue"] {
    background-color: var(--sheet-blue);
    transform: rotate(-0.4deg);
}

.sheet:hover {
    transform: translateY(-3px) rotate(0deg);
    box-shadow: var(--elevation-focused);
}

.sheet.focused {
    transform: translateY(-4px) rotate(0deg) !important;
    box-shadow: var(--elevation-focused) !important;
    border-color: rgba(0, 0, 0, 0.12);
}

/* Sheet Header */
.sheet-head {
    border-bottom: 1px solid rgba(24, 24, 27, 0.1);
    padding-bottom: 18px;
    margin-bottom: 20px;
}

.sheet-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.sheet-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sheet-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #18181b;
}

.sheet-head h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: #18181b;
    letter-spacing: -0.02em;
}

.sheet-desc {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: #52525b;
    margin-top: 4px;
    line-height: 1.4;
}

/* Sheet Items List */
.sheet-items {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.sheet-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(24, 24, 27, 0.06);
    transition: transform 0.15s ease;
}

.sheet-item:last-child {
    border-bottom: none;
}

.sheet-item:hover {
    transform: translateX(4px);
}

.item-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: #18181b;
}

.item-brief {
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: #52525b;
    line-height: 1.45;
}

.item-status {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.item-status.live {
    background: #dcfce7;
    color: #15803d;
}

.item-status.rating {
    background: #fef3c7;
    color: #b45309;
}

.item-status.users {
    background: #e0e7ff;
    color: #4338ca;
}

.item-status.utility {
    background: #f3e8ff;
    color: #7e22ce;
}

.item-status.internal {
    background: #f4f4f5;
    color: #52525b;
}

.item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.meta-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #71717a;
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 8px;
    border-radius: 4px;
}

.meta-period {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #a1a1aa;
}

.item-link {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: none;
    transition: text-decoration 0.2s;
}

.item-link:hover {
    text-decoration: underline;
}

/* Sheet Footer Actions */
.sheet-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(24, 24, 27, 0.08);
    display: flex;
    justify-content: flex-end;
}

.sheet-all {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: #18181b;
    background: transparent;
    border: 1px solid rgba(24, 24, 27, 0.2);
    padding: 7px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sheet-all:hover {
    background: #18181b;
    color: #ffffff;
}

/* ==========================================================================
   Use Cases Stack (Sheet 3)
   ========================================================================== */
.usecases-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.usecase-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    padding: 16px 20px;
    transition: background 0.2s;
}

.usecase-card:hover {
    background: rgba(255, 255, 255, 0.9);
}

.usecase-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.usecase-icon {
    font-size: 1rem;
    color: var(--accent-blue);
}

.usecase-head h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: #18181b;
}

.usecase-body {
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: #52525b;
    line-height: 1.45;
    margin-bottom: 10px;
}

.usecase-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.usecase-pills span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #3f3f46;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ==========================================================================
   Tactile Stickers (Die-cut with SVG Filter)
   ========================================================================== */
.sticker {
    position: relative;
    margin: 12px 6px;
    filter: url(#die-cut) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-block;
}

.sticker:hover {
    transform: scale(1.06) rotate(0deg) !important;
}

.sticker-inner {
    background: #ffffff;
    border-radius: 6px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #18181b;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    user-select: none;
    border: none;
}

.btn-sticker {
    cursor: pointer;
    background: #ffffff;
}

.sticker[data-sticker="0"] {
    transform: rotate(-3deg);
}

.sticker[data-sticker="1"] {
    transform: rotate(2deg);
}

.sticker[data-sticker="2"] {
    transform: rotate(-1.5deg);
}

.sticker[data-sticker="3"] {
    transform: rotate(4deg);
}

/* ==========================================================================
   Pinned Ground Footer
   ========================================================================== */
.lab-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: rgba(22, 22, 25, 0.9);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 50;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-links a,
.footer-links button {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: #a1a1aa;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.footer-links a:hover,
.footer-links button:hover {
    color: #ffffff;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #71717a;
}

/* ==========================================================================
   Modal Dialogs (About, Colophon, Inquire)
   ========================================================================== */
.lab-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 12, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 200;
}

.lab-modal[hidden] {
    display: none;
}

.lab-modal-panel {
    background: #faf7f2;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 10px;
    padding: 36px 40px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.lab-modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 1.8rem;
    line-height: 1;
    background: transparent;
    border: none;
    color: #71717a;
    cursor: pointer;
    transition: color 0.2s;
}

.lab-modal-close:hover {
    color: #18181b;
}

.lab-modal-panel h2 {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 800;
    color: #18181b;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.modal-lead {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 20px;
}

.modal-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: #3f3f46;
    line-height: 1.6;
}

.colophon-section {
    margin-top: 12px;
}

.colophon-section h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: #18181b;
    margin-bottom: 6px;
}

.colophon-section p {
    font-size: 0.88rem;
    color: #52525b;
}

.seed-table-wrap {
    overflow-x: auto;
    margin-top: 8px;
}

.seed-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.74rem;
}

.seed-table th,
.seed-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.seed-table th {
    background: rgba(0, 0, 0, 0.04);
    font-weight: 700;
    color: #18181b;
}

.seed-table td:first-child {
    font-weight: 600;
    color: var(--accent-color);
}

.inquire-list {
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.92rem;
}

.inquire-contact-box {
    margin-top: 18px;
    background: #f4efe6;
    border: 1px solid #e5e0d8;
    border-radius: 8px;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.box-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inquire-email {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #18181b;
    text-decoration: none;
    transition: color 0.2s;
}

.inquire-email:hover {
    color: var(--accent-color);
}

.btn-copy {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    background: #18181b;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: #3f3f46;
}

.modal-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 768px) {
    .lab-topbar {
        padding: 0 16px;
    }

    .lab-topbar-tag {
        display: none;
    }

    .sheet-tabs {
        gap: 2px;
    }

    .tab-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .seed-badge {
        display: none;
    }

    .lab-stage {
        padding: 72px 12px 70px;
    }

    .env {
        padding: 24px 20px;
    }

    .env-name {
        font-size: 1.45rem;
    }

    .env-blurb {
        font-size: 0.88rem;
    }

    .env-stamp {
        display: none; /* Hide heavy stamp on narrow viewports */
    }

    .sheet {
        padding: 24px 20px;
        margin-bottom: 24px;
        transform: none !important;
    }

    .sheet-item {
        flex-direction: column;
        gap: 8px;
    }

    .item-meta {
        align-items: flex-start;
    }

    .lab-footer {
        padding: 0 16px;
    }

    .footer-copy {
        display: none;
    }
}
