/* ================================================================
   TANSO.BAR - CSS STYLES
   Hand-drawn Zen aesthetic with visible grid motif
   ================================================================ */

/* Color Palette */
:root {
    --bg-washi: #f5f0e8;
    --bg-parchment: #ede6da;
    --text-sumi: #3a3632;
    --gradient-indigo: #4a5568;
    --gradient-stone: #a89f91;
    --accent-red: #c4453c;
    --grid-gray: #c8bfb0;
    --hover-ink: #6b6259;
    --dark-bokuju: #1e1c1a;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    background: var(--bg-washi);
    color: var(--text-sumi);
    font-family: 'Karla', sans-serif;
    font-size: clamp(0.9rem, 1.3vw, 1.05rem);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ================================================================
   HERO ZONE
   ================================================================ */

.hero-zone {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 5%;
    background: var(--bg-washi);
    position: relative;
    overflow: hidden;
}

.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hero-grid {
    opacity: 0;
    animation: grid-appear 3s ease-out 0.5s forwards;
}

@keyframes grid-appear {
    to {
        opacity: 1;
    }
}

.grid-v line, .grid-h line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: line-draw 1.2s ease-out forwards;
}

@keyframes line-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.grid-v line:nth-child(1) { animation-delay: 0.6s; }
.grid-v line:nth-child(2) { animation-delay: 0.68s; }
.grid-v line:nth-child(3) { animation-delay: 0.76s; }
.grid-v line:nth-child(4) { animation-delay: 0.84s; }
.grid-v line:nth-child(5) { animation-delay: 0.92s; }

.grid-h line:nth-child(1) { animation-delay: 1.0s; }
.grid-h line:nth-child(2) { animation-delay: 1.08s; }
.grid-h line:nth-child(3) { animation-delay: 1.16s; }

.hero-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 60px;
    align-items: flex-start;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-sumi);
    background: linear-gradient(135deg, var(--gradient-indigo) 0%, var(--gradient-stone) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: title-appear 0.8s ease-out 4s forwards;
}

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

.enso-circle {
    width: 180px;
    height: 180px;
    opacity: 0;
    animation: enso-appear 0.6s ease-out 3.5s forwards;
}

@keyframes enso-appear {
    to {
        opacity: 1;
    }
}

.enso-path {
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
    animation: enso-draw 2.2s cubic-bezier(0.4, 0, 0.2, 1) 3.7s forwards;
}

@keyframes enso-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.watermark-seal {
    position: absolute;
    bottom: 80px;
    right: 40px;
    width: 200px;
    height: 200px;
    pointer-events: none;
    z-index: 0;
}

/* ================================================================
   PORTFOLIO ZONE
   ================================================================ */

.portfolio-zone {
    width: 100%;
    min-height: 200vh;
    background: linear-gradient(180deg, var(--bg-washi) 0%, var(--bg-parchment) 100%);
    padding: 100px 5%;
    position: relative;
}

.portfolio-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2.5rem;
    grid-auto-rows: auto;
}

.portfolio-item {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(200, 191, 176, 0.3);
    border-radius: 2px;
    opacity: 0;
    animation: portfolio-appear 0.6s ease-out forwards;
}

.item-large {
    grid-column: span 2;
    grid-row: span 2;
}

.item-medium {
    grid-column: span 2;
}

.item-small {
    grid-column: span 2;
}

.portfolio-item:nth-child(1) { animation-delay: 0.3s; }
.portfolio-item:nth-child(2) { animation-delay: 0.5s; }
.portfolio-item:nth-child(3) { animation-delay: 0.7s; }
.portfolio-item:nth-child(4) { animation-delay: 0.9s; }
.portfolio-item:nth-child(6) { animation-delay: 1.3s; }
.portfolio-item:nth-child(7) { animation-delay: 1.5s; }

@keyframes portfolio-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-item:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.item-icon {
    width: 60px;
    height: 60px;
    opacity: 0.7;
}

.icon-path {
    stroke-dasharray: 150;
    stroke-dashoffset: 150;
    animation: icon-draw 0.8s ease-out forwards;
}

.portfolio-item:nth-child(1) .icon-path { animation-delay: 0.5s; }
.portfolio-item:nth-child(2) .icon-path { animation-delay: 0.7s; }
.portfolio-item:nth-child(3) .icon-path { animation-delay: 0.9s; }
.portfolio-item:nth-child(4) .icon-path { animation-delay: 1.1s; }
.portfolio-item:nth-child(6) .icon-path { animation-delay: 1.5s; }
.portfolio-item:nth-child(7) .icon-path { animation-delay: 1.7s; }

@keyframes icon-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.portfolio-item:hover .icon-path {
    stroke: var(--accent-red);
}

.portfolio-item h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    font-weight: 600;
    color: var(--text-sumi);
    margin-top: 10px;
}

.portfolio-item p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--hover-ink);
}

/* ================================================================
   BREATHING ZONES
   ================================================================ */

.breathing-zone {
    grid-column: span 6;
    height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.breathing-stroke {
    width: 50%;
    height: auto;
    opacity: 0;
    animation: stroke-appear 0.8s ease-out forwards;
}

.breathing-zone:nth-of-type(1) .breathing-stroke { animation-delay: 1.0s; }
.breathing-zone:nth-of-type(2) .breathing-stroke { animation-delay: 1.5s; }

@keyframes stroke-appear {
    from {
        opacity: 0;
        stroke-dashoffset: 400;
    }
    to {
        opacity: 1;
        stroke-dashoffset: 0;
    }
}

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

.colophon-footer {
    width: 100%;
    background: var(--bg-parchment);
    padding: 80px 5%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    position: relative;
    z-index: 10;
}

.hanko-seal {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    opacity: 0;
    animation: seal-appear 1s ease-out 0.5s forwards;
}

@keyframes seal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) rotate(-15deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.colophon-text {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.colophon-text p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-sumi);
}

.meta {
    font-family: 'Cutive Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--gradient-stone);
}

/* ================================================================
   NAVIGATION CLUSTER
   ================================================================ */

.nav-cluster {
    position: fixed;
    top: 40px;
    right: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1000;
    opacity: 0;
    animation: nav-appear 0.6s ease-out 1s forwards;
}

@keyframes nav-appear {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.nav-divider {
    width: 1px;
    height: 30px;
    background: var(--text-sumi);
    opacity: 0.6;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    text-decoration: none;
    transition: all 0.3s ease-out;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
}

.nav-icon:hover {
    transform: scale(1.2);
}

.nav-icon:hover svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

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

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .item-large,
    .item-medium,
    .item-small {
        grid-column: span 1;
        grid-row: auto;
    }

    .breathing-zone {
        grid-column: span 2;
        height: 20vh;
    }

    .nav-cluster {
        top: 20px;
        right: 20px;
        gap: 12px;
    }

    .nav-divider {
        height: 20px;
    }

    .colophon-footer {
        flex-direction: column;
        text-align: center;
    }

    .hanko-seal {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .breathing-zone {
        grid-column: span 1;
        height: 15vh;
    }

    .portfolio-item {
        padding: 1.5rem;
    }

    .hero-zone {
        padding-left: 3%;
    }

    .nav-cluster {
        top: 15px;
        right: 15px;
    }
}
