/* ========================================
   desca.work — MUJI Clean Functional
   ======================================== */

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Palette */
:root {
    --bg-unbleached: #f5f4f1;
    --card-white: #ffffff;
    --sidebar-craft: #eae8e4;
    --border-natural: #d8d4ce;
    --text-sumi: #333333;
    --accent-muji-red: #d4553a;
    --success-green: #5a8a5c;
    --muted-kraft: #999490;
}

/* Typography */
html {
    font-family: 'Noto Sans', 'Noto Sans JP', sans-serif;
    font-size: 16px;
    color: var(--text-sumi);
    background: var(--bg-unbleached);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    line-height: 1.65;
    font-weight: 400;
    overflow: hidden;
}

/* Paper texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
}

/* ========================================
   Workspace Layout (CSS Grid)
   ======================================== */
.workspace {
    display: grid;
    grid-template-columns: 56px 1fr;
    height: 100vh;
    transition: grid-template-columns 300ms ease;
}

.workspace.sidebar-expanded {
    grid-template-columns: 240px 1fr;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    background: var(--sidebar-craft);
    border-right: 1px solid var(--border-natural);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 0;
}

/* Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 32px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-logo-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--text-sumi);
}

.sidebar-logo .sidebar-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-sumi);
    opacity: 0;
    transition: opacity 200ms ease;
}

.sidebar-expanded .sidebar-logo .sidebar-label {
    opacity: 1;
}

/* Nav items */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-sumi);
    white-space: nowrap;
    overflow: hidden;
    transition: color 150ms ease;
    position: relative;
}

.sidebar-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: stroke 150ms ease;
}

.sidebar-item:hover {
    color: var(--accent-muji-red);
}

.sidebar-item:hover svg {
    stroke: var(--accent-muji-red);
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-muji-red);
    border-radius: 0 2px 2px 0;
}

.sidebar-label {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 200ms ease;
}

.sidebar-expanded .sidebar-label {
    opacity: 1;
}

/* Bottom section */
.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid var(--border-natural);
    padding-top: 8px;
}

/* ========================================
   Main Content
   ======================================== */
.content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-unbleached);
}

/* Header */
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px 16px;
    flex-shrink: 0;
}

.project-title {
    font-family: 'Noto Sans JP', 'Noto Sans', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-sumi);
}

.project-description {
    font-size: 0.95rem;
    color: var(--muted-kraft);
    margin-top: 2px;
}

.header-meta {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted-kraft);
}

/* ========================================
   Kanban Board
   ======================================== */
.board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 32px 32px;
    flex: 1;
    align-items: flex-start;
}

.board::-webkit-scrollbar {
    height: 6px;
}

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

.board::-webkit-scrollbar-thumb {
    background: var(--border-natural);
    border-radius: 3px;
}

/* Column */
.column {
    min-width: 280px;
    max-width: 320px;
    flex-shrink: 0;
    flex-grow: 1;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 12px;
}

.column-title {
    font-family: 'Noto Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted-kraft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.column-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-kraft);
    background: var(--sidebar-craft);
    padding: 1px 8px;
    border-radius: 10px;
}

/* Cards container */
.column-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========================================
   Task Card
   ======================================== */
.card {
    background: var(--card-white);
    border: 1px solid var(--border-natural);
    border-radius: 4px;
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color 150ms ease;
}

.card:hover {
    border-color: var(--accent-muji-red);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-sumi);
    line-height: 1.3;
}

.card-body {
    font-size: 0.85rem;
    color: var(--muted-kraft);
    line-height: 1.5;
    margin-bottom: 10px;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-kraft);
    background: var(--bg-unbleached);
    padding: 2px 8px;
    border-radius: 3px;
}

.card-date {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-kraft);
}

/* ========================================
   Status Dots
   ======================================== */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.status-active {
    background: var(--accent-muji-red);
}

.status-dot.status-done {
    background: var(--success-green);
}

.status-dot.status-pending {
    background: var(--muted-kraft);
}

/* ========================================
   Focus Mode
   ======================================== */
.focus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(51, 51, 51, 0.15);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.focus-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.focus-panel {
    background: var(--card-white);
    border: 1px solid var(--border-natural);
    border-radius: 4px;
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 300ms ease;
}

.focus-overlay.active .focus-panel {
    transform: translateY(0);
}

.focus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-natural);
}

.focus-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.focus-title {
    font-family: 'Noto Sans JP', 'Noto Sans', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-sumi);
}

.focus-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--muted-kraft);
    transition: color 150ms ease;
}

.focus-close:hover {
    color: var(--accent-muji-red);
}

.focus-close svg {
    width: 18px;
    height: 18px;
}

.focus-body {
    padding: 24px;
}

.focus-description {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-sumi);
    margin-bottom: 24px;
}

.focus-details {
    border-top: 1px solid var(--border-natural);
    padding-top: 16px;
    margin-bottom: 24px;
}

.focus-detail-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
}

.focus-detail-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted-kraft);
    width: 80px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.focus-detail-value {
    font-size: 0.9rem;
    color: var(--text-sumi);
}

.focus-notes {
    border-top: 1px solid var(--border-natural);
    padding-top: 16px;
}

.focus-notes-heading {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted-kraft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.focus-notes-area {
    font-family: 'Noto Sans', sans-serif;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-sumi);
    background: var(--bg-unbleached);
    border: 1px solid var(--border-natural);
    border-radius: 4px;
    padding: 12px 16px;
    min-height: 100px;
    outline: none;
    transition: border-color 150ms ease;
}

.focus-notes-area:focus {
    border-color: var(--accent-muji-red);
}

/* ========================================
   Board dimmed state (focus mode active)
   ======================================== */
.board.dimmed .card {
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 300ms ease;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .workspace {
        grid-template-columns: 0 1fr;
    }

    .sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        bottom: 0;
        width: 240px;
        transition: left 300ms ease;
        z-index: 50;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar.mobile-open .sidebar-label {
        opacity: 1;
    }

    .content-header {
        padding: 16px 20px 12px;
    }

    .board {
        padding: 8px 20px 20px;
    }

    .column {
        min-width: 260px;
    }
}
