/* ============================================
   OMORIOUS STYLESHEET
   A minimal, responsive design for the lab
   ============================================ */

/* ============================================
   RESET & BASE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-text: #1b211c;
    --color-text-light: #5b665f;
    --color-text-lighter: #7a857e;
    --color-border: #d2d9cf;
    --color-bg: #f7f8f5;
    --color-bg-alt: #ecefe8;
    --color-link: #0f4ea8;
    --color-link-hover: #0b3d82;
    --color-focus: #0ea5e9;
    --color-status-exploring: #2b7a52;
    --color-status-resting: #58645f;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-link);
    text-decoration: none;
}

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

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
    border-radius: 2px;
}

ul,
ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-bg-alt);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2rem 0;
}

img {
    max-width: 100%;
    height: auto;
}

strong {
    font-weight: 600;
}

em {
    font-style: italic;
}

time {
    font-size: 0.875rem;
    color: var(--color-text-light);
    font-variant-numeric: tabular-nums;
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   HEADER
   ============================================ */

.site-header {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 3rem;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.site-title:hover {
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 10;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
    content: "";
    position: absolute;
    left: 0;
}

.nav-toggle-icon::before {
    top: -7px;
}

.nav-toggle-icon::after {
    top: 7px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

.site-nav {
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    color: var(--color-text);
    font-size: 1rem;
}

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

.skip-link {
    position: absolute;
    left: 1rem;
    top: -9999px;
    z-index: 1000;
    background: var(--color-text);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

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

.site-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.site-footer p {
    margin: 0;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    min-height: 60vh;
}

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

.page-header {
    margin-bottom: 2rem;
}

.back-nav {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.back-nav a {
    color: var(--color-text-light);
}

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

.page-header h1 {
    margin-bottom: 0;
}

.page-content {
    max-width: 42rem;
}

.page-content-wide {
    max-width: none;
}

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

.home h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.home>p {
    font-size: 1.125rem;
    line-height: 1.7;
    max-width: 42rem;
}

/* ============================================
   ACTIVITY FEED - TABLE LAYOUT
   ============================================ */

.activity-feed {
    margin-top: 2rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.activity-header {
    display: grid;
    grid-template-columns: 110px 1.2fr 1.6fr 2.8fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-alt);
    border-bottom: 2px solid var(--color-border);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
}

.activity-item {
    display: grid;
    grid-template-columns: 110px 1.2fr 1.6fr 2.8fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    align-items: center;
    transition: background-color 0.15s ease;
}

.activity-item:hover {
    background-color: var(--color-bg-alt);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-date {
    color: var(--color-text-light);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
}

.activity-content {
    min-width: 0;
}

.activity-content h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-content h3 a {
    color: var(--color-link);
    text-decoration: none;
}

.activity-content h3 a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

.activity-content p {
    margin: 0;
    color: var(--color-text-lighter);
    font-size: 0.85rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-description p {
    color: var(--color-text-light);
}

/* ============================================
   LAB TABLE
   ============================================ */

.lab-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.lab-filter {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.5rem 0.875rem;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--color-text-light);
    cursor: pointer;
}

.filter-btn:hover {
    border-color: var(--color-text-lighter);
    color: var(--color-text);
}

.filter-btn[aria-pressed="true"] {
    background-color: var(--color-text);
    border-color: var(--color-text);
    color: var(--color-bg);
}

.filter-count {
    font-size: 0.7em;
    opacity: 0.6;
    margin-left: 0.125rem;
}

.filter-btn[aria-pressed="true"] .filter-count {
    opacity: 0.75;
}

.lab-no-results td {
    text-align: center;
    color: var(--color-text-light);
    font-style: italic;
    padding: 2rem 1rem;
}

.lab-sort-mobile {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.lab-sort-mobile label {
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

.lab-sort-mobile select {
    font: inherit;
    font-size: 0.8125rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
}

.lab-table-wrap {
    margin-top: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow-x: auto;
}

.lab-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 100%;
    table-layout: fixed;
}

.lab-table th,
.lab-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
    text-align: left;
}

.lab-table th {
    background: var(--color-bg-alt);
    border-bottom: 2px solid var(--color-border);
}

.lab-table th button {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

.lab-table th button::after {
    content: " \2195";
    font-size: 0.8em;
    color: var(--color-text-lighter);
}

.lab-table th button[data-active="true"] {
    color: var(--color-text);
}

.lab-table th button[data-active="true"][data-direction="asc"]::after {
    content: " \2191";
    color: var(--color-text);
}

.lab-table th button[data-active="true"][data-direction="desc"]::after {
    content: " \2193";
    color: var(--color-text);
}

.lab-table tbody tr:hover {
    background-color: var(--color-bg-alt);
}

.lab-table tbody tr:last-child td {
    border-bottom: 0;
}

.lab-table td:nth-child(1) {
    width: 18%;
    font-weight: 600;
}

.lab-table td:nth-child(2) {
    width: 10%;
}

.lab-table td:nth-child(3) {
    width: 24%;
}

.lab-table td:nth-child(4) {
    width: 36%;
    color: var(--color-text-light);
}

.lab-table td:nth-child(5) {
    width: 12%;
}

@media (max-width: 1100px) and (min-width: 769px) {
    .lab-table {
        min-width: 980px;
        table-layout: auto;
    }
}

/* ============================================
   PROJECT LISTS (LAB PAGE)
   ============================================ */

.project-list {
    margin-top: 2rem;
}

.project-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.project-item:last-child {
    border-bottom: none;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}

.project-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.project-header time {
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.project-field {
    margin-bottom: 1.25rem;
}

.project-field-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-light);
    margin-bottom: 0.35rem;
}

.project-field-value {
    margin: 0;
    color: var(--color-text);
    line-height: 1.6;
}

.themes {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.theme {
    font-size: 0.75rem;
    color: var(--color-text-light);
    background: var(--color-bg-alt);
    padding: 0.125rem 0.5rem;
    border-radius: 3px;
}

/* ============================================
   NOTES PAGE
   ============================================ */

.notes-list {
    margin-top: 2rem;
}

.note-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.note-item:last-child {
    border-bottom: none;
}

.note-item time {
    text-align: right;
    padding-top: 0.25rem;
}

.note-title-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.note-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.note-reading-time {
    font-size: 0.8rem;
    color: var(--color-text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.note-content p {
    color: var(--color-text-light);
    margin: 0;
}

.note-page-date {
    display: block;
    color: var(--color-text-light);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.empty-state {
    color: var(--color-text-light);
    font-style: italic;
    padding: 2rem 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {

    /* Typography scales down */
    html {
        font-size: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .home h1 {
        font-size: 2rem;
    }

    /* Header stays horizontal with hamburger */
    .site-header .container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .nav-toggle {
        display: block;
    }

    /* Nav hidden by default, shown on toggle */
    .site-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        padding: 0.5rem 1.5rem 1rem;
        z-index: 100;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        padding: 0.75rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--color-border);
    }

    .site-nav a:last-child {
        border-bottom: none;
    }

    .site-header {
        position: relative;
    }

    /* Activity feed: better mobile layout */
    .activity-header {
        display: none;
    }

    .activity-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        padding: 1rem;
        border-left: 3px solid var(--color-border);
    }

    .activity-item:hover {
        border-left-color: var(--color-link);
    }

    .activity-date {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        margin-bottom: 0.125rem;
    }

    .activity-content h3,
    .activity-content p {
        white-space: normal;
    }

    .activity-content h3 {
        font-size: 1rem;
    }

    /* Lab controls: show sort select, stack vertically on mobile */
    .lab-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.625rem;
        margin-top: 1.5rem;
    }

    .lab-sort-mobile {
        display: flex;
    }

    /* Lab table: card layout on mobile */
    .lab-table-wrap {
        border: none;
        border-radius: 0;
        overflow-x: visible;
    }

    .lab-table tbody tr.lab-no-results {
        border: none;
        padding: 1rem 0;
    }

    .lab-table {
        min-width: 0;
        table-layout: auto;
    }

    .lab-table,
    .lab-table thead,
    .lab-table tbody,
    .lab-table tr,
    .lab-table th,
    .lab-table td {
        display: block;
    }

    .lab-table thead {
        display: none;
    }

    .lab-table tbody tr {
        border: 1px solid var(--color-border);
        border-radius: 4px;
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .lab-table td {
        padding: 0.25rem 0;
        border-bottom: none;
        width: 100%;
    }

    .lab-table td:nth-child(1) {
        width: 100%;
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }

    .lab-table td:nth-child(2) {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .lab-table td:nth-child(3) {
        width: 100%;
        font-style: italic;
    }

    .lab-table td:nth-child(4) {
        width: 100%;
        margin-top: 0.25rem;
    }

    .lab-table td:nth-child(5) {
        width: 100%;
        margin-top: 0.5rem;
        font-size: 0.8rem;
        color: var(--color-text-lighter);
    }

    /* Project headers stack */
    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Note items stack */
    .note-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .note-item time {
        text-align: left;
    }

    /* Footer: centered, smaller */
    .site-footer {
        text-align: center;
        font-size: 0.8rem;
        margin-top: 3rem;
    }

    /* Project detail */
    .project-detail-header h1 {
        font-size: 2rem;
    }

    .changelog-entry {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .site-header {
        padding: 1rem 0;
    }

    .site-nav {
        padding: 0.5rem 1rem 1rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {

    .site-header,
    .site-footer,
    .site-nav,
    .nav-toggle {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        color: var(--color-text);
        text-decoration: underline;
    }

    .activity-item,
    .project-item {
        page-break-inside: avoid;
    }
}

/* ============================================
   PROJECT DETAIL PAGES
   ============================================ */

.project-detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.project-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.project-meta-dates {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.project-meta time {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.status {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.status-exploring {
    background: var(--color-status-exploring);
    color: white;
}

.status-resting {
    background: var(--color-status-resting);
    color: white;
}

.project-detail-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.project-detail-header .project-field {
    margin-bottom: 1.25rem;
}

.project-detail-header .project-field-value {
    font-size: 1rem;
}

.project-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--color-link);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
}

.project-link:hover {
    background: var(--color-link-hover);
}

.project-detail-content {
    max-width: 42rem;
    margin-bottom: 3rem;
}

.project-detail-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.project-detail-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.project-detail-content img {
    margin: 2rem 0;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.project-detail-content figure {
    margin: 2rem 0;
}

.project-detail-content figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
    text-align: center;
}

/* Project Screenshots */
.project-screenshots {
    margin-bottom: 1.5rem;
}

.screenshot-desktop {
    margin: 0 0 1.5rem;
}

.screenshot-desktop img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    display: block;
}

/* Changelog Section */
.project-changelog {
    margin-top: 1.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.project-changelog h2 {
    margin-bottom: 1.5rem;
}

.changelog-list {
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.changelog-entry {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.15s ease;
}

.changelog-entry:hover {
    background-color: var(--color-bg-alt);
}

.changelog-entry:last-child {
    border-bottom: none;
}

.changelog-entry time {
    color: var(--color-text-light);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    padding-top: 0.25rem;
}

.changelog-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.changelog-content p {
    margin: 0;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

