:root {
    --bg-color: #E3E6EB;
    --card-bg: #EAEBED;
    --line-color: #BFC2C9;
    --text-primary: #2C3036;
    --text-secondary: #6B707A;
    --accent-red: #F05650;
    --accent-blue: #2E2EFF;
    --font-main: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', 'Courier New', monospace;
    --shadow: 0 20px 40px rgba(0,0,0,0.06);
}

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

body {
    background-color: var(--bg-color);
    font-family: var(--font-main);
    color: var(--text-primary);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* --- Grid Lines --- */
.grid-line-h {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--line-color);
    z-index: 0;
    pointer-events: none;
}

.grid-line-v {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--line-color);
    z-index: 0;
    pointer-events: none;
}

/* --- Nav --- */
nav {
    height: 60px;
    width: 100%;
    display: flex;
    border-bottom: 1px solid var(--line-color);
    background-color: var(--bg-color);
    z-index: 100;
    position: relative;
}

.nav-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--line-color);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.nav-icon { width: 60px; cursor: pointer; }
.nav-logo { flex-grow: 1; font-weight: 700; font-size: 16px; color: var(--text-secondary); letter-spacing: -0.5px; }
.nav-action { padding: 0 30px; cursor: pointer; transition: background 0.2s; }
.nav-action:hover { background-color: rgba(255,255,255,0.3); }
.nav-action.active { background-color: var(--card-bg); font-weight: 700; }

.hamburger {
    width: 18px;
    height: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
}

/* --- Main --- */
main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 40px;
}

/* --- Background Watermark --- */
.bg-watermark {
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    font-size: 400px;
    font-weight: 700;
    color: rgba(0,0,0,0.03);
    pointer-events: none;
    z-index: 0;
    line-height: 0.8;
    font-family: 'Arial', sans-serif;
    writing-mode: vertical-rl;
}

/* --- Vertical Bars --- */
.vertical-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--line-color);
    font-size: 13px;
    text-transform: lowercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}
.vertical-bar.right {
    border-right: none;
    border-left: 1px solid var(--line-color);
}
.vertical-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
}

/* --- Controls --- */
.controls {
    position: absolute;
    bottom: 40px;
    left: 40px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.control-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    background: transparent;
    transition: all 0.2s;
    text-decoration: none;
}
.control-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

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

.portfolio-card {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    border: 1px solid var(--line-color);
    position: relative;
    z-index: 10;
}

.portfolio-card--home {
    width: min(1250px, 95vw);
    height: 750px;
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    grid-template-rows: 1fr;
}

/* Left content panel */
.content-left {
    position: relative;
    border-right: 1px solid var(--line-color);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.content-right {
    display: flex;
    flex-direction: column;
}

h1 {
    font-size: 64px;
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -2px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hero-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 40px;
    border-bottom: 1px solid var(--line-color);
    padding-bottom: 10px;
}

.bio-text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    max-width: 320px;
    margin-top: auto;
    font-weight: 500;
}

.graphic-container {
    position: absolute;
    bottom: 100px;
    right: -80px;
    width: 280px;
    height: 280px;
    z-index: 1;
}
.shape-circle {
    width: 260px;
    height: 260px;
    background-color: var(--accent-red);
    border-radius: 50%;
}

.shape-circle--blue {
    background-color: var(--accent-blue);
}

/* Project List */
.list-header {
    height: 80px;
    border-bottom: 1px solid var(--line-color);
    display: flex;
    align-items: center;
    padding: 0 30px;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
}

.project-row {
    flex-grow: 1;
    display: flex;
    border-bottom: 1px solid var(--line-color);
    transition: background-color 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

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

.project-row:hover {
    background-color: #F5F6F8;
}

.row-date {
    width: 80px;
    padding: 25px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    border-right: 1px solid var(--line-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.3;
}

.row-date span {
    font-weight: 400;
    color: var(--text-secondary);
}

.row-info {
    flex-grow: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.project-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: lowercase;
}

.project-client {
    font-size: 12px;
    color: var(--text-secondary);
}

.action-cell {
    width: 80px;
    border-left: 1px solid var(--line-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-triangle {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid var(--accent-blue);
}

.tag-vertical {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: var(--accent-red);
    font-size: 10px;
    font-weight: 700;
    margin-right: 15px;
    letter-spacing: 1px;
}

/* ================================================
   CASE STUDY PAGE
   ================================================ */

.case-study-card {
    width: 1100px;
    height: 780px;
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    border: 1px solid var(--line-color);
    display: grid;
    grid-template-columns: 60px 300px 1fr 60px;
    position: relative;
    z-index: 10;
}

.sidebar-nav {
    border-right: 1px solid var(--line-color);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-weight: 700;
}

.sidebar-item {
    margin-bottom: 25px;
}

.sidebar-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.sidebar-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-desc {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-top: 15px;
}

.main-stage {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.stage-header {
    height: 120px;
    padding: 40px;
    border-bottom: 1px solid var(--line-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.stage-title h2 {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1;
}

.stage-content {
    padding: 40px;
    flex-grow: 1;
}

.mockup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.mockup-container {
    border: 1px solid var(--line-color);
    background: #fff;
    padding: 20px;
    position: relative;
}

.mockup-img {
    width: 100%;
    height: 240px;
    background: #F0F2F5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--line-color);
    position: relative;
}

.annotation {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent-blue);
    border-radius: 50%;
}

.annotation::after {
    content: attr(data-num);
    position: absolute;
    left: 10px;
    top: -5px;
    font-size: 9px;
    font-weight: 700;
    color: var(--accent-blue);
}

.specs-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--line-color);
    margin-top: 20px;
    padding-top: 40px;
}

.spec-item {
    margin-bottom: 30px;
}

.spec-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.type-spec {
    font-family: 'Helvetica Neue', Helvetica;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.5px;
}

.color-palette {
    display: flex;
    gap: 5px;
}

.color-swatch {
    width: 30px;
    height: 30px;
    border: 1px solid var(--line-color);
}

.marker-tag {
    font-size: 9px;
    font-weight: 700;
    color: var(--accent-red);
    margin-bottom: 5px;
    display: block;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-color); }

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

.portfolio-card--process {
    width: min(1250px, 95vw);
    height: 750px;
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    grid-template-rows: 1fr;
}

.content-area {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page-header {
    height: 80px;
    border-bottom: 1px solid var(--line-color);
    display: flex;
    align-items: center;
    padding: 0 40px;
    justify-content: space-between;
}

.page-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.page-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

.process-grid {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 100%;
}

.process-column {
    border-right: 1px solid var(--line-color);
    display: flex;
    flex-direction: column;
    position: relative;
}

.process-column:last-child {
    border-right: none;
}

.phase-num {
    padding: 30px 30px 10px 30px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-red);
    font-weight: 700;
}

.phase-title {
    padding: 0 30px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 20px;
    text-transform: lowercase;
}

.phase-content {
    padding: 20px 30px;
    flex-grow: 1;
    border-top: 1px solid var(--line-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.phase-annotation {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
    text-transform: uppercase;
    font-weight: 600;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-dot {
    width: 5px;
    height: 5px;
    background-color: var(--accent-blue);
    border-radius: 50%;
    flex-shrink: 0;
}

.step-text {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

.visual-indicator {
    height: 120px;
    margin-top: auto;
    border-top: 1px solid var(--line-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(255,255,255,0.1);
}

.v-label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    font-size: 8px;
    font-family: var(--font-mono);
    color: var(--line-color);
    white-space: nowrap;
}

.flow-line {
    position: absolute;
    right: -1px;
    top: 50%;
    width: 20px;
    height: 1px;
    background: var(--line-color);
    z-index: 5;
}

.accent-shape {
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent-red);
    opacity: 0.3;
}

.accent-shape.circle { border-radius: 50%; }

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

.portfolio-card--contact {
    width: min(1250px, 95vw);
    height: 750px;
    display: grid;
    grid-template-columns: 60px 1fr 1fr 60px;
    grid-template-rows: 1fr;
}

.contact-left {
    border-right: 1px solid var(--line-color);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.contact-heading {
    font-size: 64px;
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -2px;
    color: var(--text-primary);
    text-transform: lowercase;
    margin-bottom: 20px;
}

.contact-sub {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 500;
    max-width: 320px;
    margin-top: 20px;
}

.contact-right {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
}

.contact-block {
    border-bottom: 1px solid var(--line-color);
    padding-bottom: 25px;
}

.contact-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.contact-block-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.contact-block-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.contact-block-value:hover {
    color: var(--accent-blue);
}

.contact-avail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 40px;
}

.avail-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
}

/* ================================================
   RESPONSIVE — TABLET (max 1300px)
   Card scales in width, keeps aspect ratio feel
   ================================================ */

@media (max-width: 1300px) {
    main {
        padding: 20px;
    }

    .portfolio-card--home {
        height: auto;
        min-height: 600px;
    }

    .content-left {
        min-height: 400px;
    }
}

/* ================================================
   RESPONSIVE — MOBILE (max 768px)
   Stack layout, scrollable, readable fonts
   ================================================ */

@media (max-width: 768px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    main {
        padding: 24px 20px;
        align-items: flex-start;
        flex-direction: column;
    }

    /* Keep watermark hidden — too large on small screens */
    .bg-watermark {
        display: none;
    }

    /* Restore grid lines on mobile for the background feel */
    .grid-line-h,
    .grid-line-v {
        display: block;
    }

    /* Nav */
    nav {
        height: 52px;
    }

    .nav-icon {
        width: 52px;
    }

    .nav-action {
        padding: 0 16px;
        font-size: 13px;
    }

    /* Controls hidden — no fixed positioning on mobile */
    .controls {
        display: none;
    }

    /* ---- Home card ---- */
    .portfolio-card--home {
        width: 100%;
        height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    /* Hide left vertical bar on mobile */
    .portfolio-card--home .vertical-bar {
        display: none;
    }

    .content-left {
        border-right: none;
        border-bottom: 1px solid var(--line-color);
        padding: 36px 28px 240px 28px;
        min-height: unset;
        gap: 28px;
    }

    /* Circle: sits below bio text in the reserved bottom zone, bleeds right edge */
    .graphic-container {
        display: block;
        position: absolute;
        bottom: 20px;
        right: -60px;
        top: unset;
        width: 180px;
        height: 180px;
    }

    .shape-circle {
        width: 160px;
        height: 160px;
    }

    h1 {
        font-size: 48px;
        letter-spacing: -1.5px;
    }

    .hero-meta {
        flex-direction: column;
        gap: 4px;
        margin-bottom: 28px;
    }

    .bio-text {
        max-width: 100%;
        margin-top: 0;
        font-size: 14px;
    }

    .content-right {
        min-height: 380px;
    }

    .list-header {
        height: 64px;
        padding: 0 24px;
        font-size: 14px;
    }

    .row-date {
        width: 68px;
        padding: 20px 14px;
    }

    .row-info {
        padding: 20px 18px;
    }

    .action-cell {
        width: 52px;
    }

    /* ---- Contact card ---- */
    .portfolio-card--contact {
        width: 100%;
        height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .portfolio-card--contact .vertical-bar {
        display: none;
    }

    .contact-left {
        border-right: none;
        border-bottom: 1px solid var(--line-color);
        padding: 36px 28px 240px 28px;
        gap: 28px;
    }

    .contact-heading {
        font-size: 48px;
        letter-spacing: -1.5px;
    }

    .contact-sub {
        font-size: 14px;
        max-width: 100%;
    }

    .contact-right {
        padding: 36px 28px;
        gap: 24px;
    }

    .contact-block-value {
        font-size: 14px;
        word-break: break-all;
    }

    /* ---- Process card ---- */
    .portfolio-card--process {
        width: 100%;
        height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .portfolio-card--process .vertical-bar {
        display: none;
    }

    .content-area {
        overflow: visible;
    }

    .page-header {
        height: auto;
        padding: 24px 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .page-meta {
        font-size: 10px;
    }

    .process-grid {
        grid-template-columns: repeat(2, 1fr);
        height: auto;
    }

    .process-column {
        border-bottom: 1px solid var(--line-color);
    }

    .process-column:nth-child(odd) {
        border-right: 1px solid var(--line-color);
    }

    .process-column:nth-child(even) {
        border-right: none;
    }

    .process-column:nth-last-child(-n+2) {
        border-bottom: none;
    }

    .phase-num {
        padding: 20px 20px 8px 20px;
        font-size: 11px;
    }

    .phase-title {
        padding: 0 20px;
        font-size: 20px;
        margin-bottom: 14px;
    }

    .phase-content {
        padding: 16px 20px;
        gap: 14px;
    }

    .visual-indicator {
        height: 90px;
    }
}

@media (max-width: 400px) {
    h1 {
        font-size: 38px;
    }

    .nav-action {
        padding: 0 12px;
        font-size: 12px;
    }
}
