:root {
    --primary: #5D71B2;
    --text-light: #dadada;
    --text-gray: #848484;
    --background: #000;
    --radius: 12px;
    --transition: 0.3s ease-in-out;
    --hover-bg-start: rgba(255, 255, 255, 0.08);
    --hover-bg-end: rgba(255, 255, 255, 0.15);
    --font-header: 'DM Mono', monospace;
    --font-body: 'Roboto Mono', monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    font-family: var(--font-header);
    color: var(--text-light);
    display: flex;
    justify-content: center;
    padding: 2rem;
    margin: 0 auto;
    overflow-x: hidden;
}

.index-body {
  overflow: hidden;   
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    max-width: 1200px;
    width: 100%;
    padding: 4rem 2rem;
    height: 100vh;
}

.left-side {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
}

.title-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.logo {
    width: 60px;
    height: auto;
}

h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 200;
}

.title-block p {
    margin: 0.25rem 0 0;
    color: var(--primary);
    font-size: 0.95rem;
}

.home-image {
    width: 100%;
    max-width: 350px;
    height: auto;
}

.right-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    height: 100%;
    text-align: right;
}

.footer-line {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.footer-line2 {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
}

.chapter-title {
    font-size: 2rem;
    font-weight: 200;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 1rem;
    width: fit-content;
    align-self: flex-end;
}

.chapter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: var(--font-body);
    width: 100%;
}

.chapter-list li {
    margin: 0.3rem 0;
}

.chapter-list a {
    position: relative;
    display: inline-block;
    text-align: right;
    width: 100%;
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.25rem 0;
    transition: color var(--transition);
    overflow: hidden;
}

.chapter-list a span {
    float: left;
    color: var(--primary);
    margin-right: 1rem;
}

.chapter-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 100%;
    width: 0%;
    height: 100%;
    background: var(--hover-bg-start);
    z-index: -1;
    border-radius: 0.2rem;
    transition:
        left 0.6s cubic-bezier(0.77, 0, 0.175, 1),
        width 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    pointer-events: none;
}

.chapter-list a:hover {
    color: var(--primary);
}

.chapter-list a:hover::after {
    left: 0%;
    width: 100%;
    animation: pulse 1.4s ease-in-out infinite alternate;
}

.chapter-menu {
    position: fixed;
    top: 1.5rem;
    left: 2rem;
    z-index: 100;
}

.menu-checkbox {
    display: none;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.fox-icon {
    width: 36px;
    height: 36px;
    transition: transform 0.2s ease;
}

.menu-toggle:hover .fox-icon {
    transform: scale(1.05);
}

.menu-label {
    font-size: 1rem;
    color: var(--text-light);
    font-family: var(--font-body);
    margin-top: 0.25rem;
    letter-spacing: 0.03em;
}

.chapter-dropdown {
    margin-top: 0.5rem;
    position: absolute;
    top: 100%;
    left: 0;
    background: #111;
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 0.5rem 0;
    list-style: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    width: 240px;
}

.menu-checkbox:checked + .menu-toggle + .chapter-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.chapter-dropdown li {
    padding: 0;   
}

.chapter-dropdown a {
    display: block;
    padding: 0.6rem 1rem;
    color: white;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.chapter-dropdown a:hover {
    background: var(--primary);
    color: black;
}

@keyframes pulse {
    0% { background-color: var(--hover-bg-start); }
    100% { background-color: var(--hover-bg-end); }
}

/* page layout */
.page-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
    max-width: 1200px;
    width: 100%;
    margin-left: 10%;
    position: relative;
}

.page-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.ch-title h1 {
    font-size: 2rem;
    font-weight: 300;
    color: var(--primary);
    margin: 0;
}

.ch-title p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.page-left .content {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.75;
    max-width: 100%;
}

.page-left .content a {
    display: inline-block;
    /*margin-top: 1.5rem;*/
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
}

.page-right {
    position: sticky;
    top: 2rem;  
    align-self: start;
    padding: 2rem 0;
}

.page-right img {
    position: sticky;
    max-width: 100%;
    height: auto;
    top: 6rem;
    z-index: 5;
    transform: translateX(30%);
}

.block-button {
    display: inline-block;
    background: white;
    color: black !important;
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    text-decoration: none !important;
    border: none;
    margin-top: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: background 0.2s ease, color 0.2s ease;
}

.block-button:hover {
    background: var(--primary);
    color: white !important;
    text-decoration: none !important;
}

/* timeline for exp */
.timeline {
    position: relative;
    margin-left: 1rem;
    padding-left: 2rem;
    border-left: 2px solid var(--text-light);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-marker {
    position: absolute;
    top: 0.25rem;
    left: -1.25rem;
    width: 0.6rem;
    height: 0.6rem;
    background: var(--primary);
    transform: rotate(45deg);
    border-radius: 0.1rem;
}


.timeline-content {
    font-family: var(--font-body);
}

.timeline-date {
    display: block;
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-style: italic;
}

.timeline-role {
    font-size: 1.25rem;
    font-weight: 400;
    margin: 0 0 0.25rem;
    color: var(--text-light);
}

.timeline-company {
    font-size: 1rem;
    font-weight: 300;
    margin: 0 0 0.75rem;
    color: var(--text-light);
}

@media (max-width: 770px) {
    .timeline {
        margin-left: 0.5rem;
        padding-left: 1.5rem;
    }
    .timeline-marker {
        left: -1rem;
    }
    .timeline-date {
        font-size: 0.8rem;
    }
    .timeline-role {
        font-size: 1.1rem;
    }
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 360px;
  background: #111;
  padding: 2rem;
  border: 1px solid var(--primary);
}

.contact-form label {
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-light);
}

.contact-form label span {
  margin-bottom: 0.25rem;
  color: var(--primary);
  font-weight: 500;
}

.contact-form input,
.contact-form textarea {
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid var(--text-gray);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.contact-form button {
  align-self: flex-end;
  margin-top: 1rem;
}

.projects-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}
.projects-filter {
  text-align: center;
  margin-bottom: 2rem;
}
.projects-filter button {
  background: transparent;
  border: 2px solid var(--text-light);
  color: var(--text-light);
  padding: 0.5rem 1rem;
  margin: 0 0.5rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.projects-filter button.active,
.projects-filter button:hover {
  background: var(--primary);
  color: black;
  border-color: var(--primary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(800px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.project-card {
  background: #111;
  border: 1px solid var(--text-gray);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}
.project-card:hover {
  transform: translateY(-4px);
}
.project-card img {
  width: 100%;
  height: auto;
  display: block;
}
.card-content {
  padding: 1rem;
  position: relative;
}
.project-title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  color: var(--text-light);
}
.project-date {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--primary);
}
.project-tags {
  margin-bottom: 1rem;
}
.tag {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  margin: 0 0.25rem 0.25rem 0;
  background: #111;
  border: 1px solid white;
  border-radius: 0.4rem;
  color: white;
}
.tag-spec {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  margin: 0 0.25rem 0.25rem 0;
  background: var(--primary);
  border-radius: 0.4rem;
  color: black;
}
.project-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: white;
}
.project-badge.cs {
  background: #d039aa;
}
.project-badge.design {
  background: #ffb70e;
}

@media (max-width: 770px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    width: 100%;
  }
}


@media (max-width: 770px) {
    .chapter-num {
        display: none;
    }
    .chapter-list{
        margin-top: 5rem;
    }
        .chapter-list a {
        color: var(--primary);
    }
    .chapter-list a:hover {
        color: white;
    }
}

@media (max-width: 770px) {
    .chapter-menu {
        top: 1rem;
        left: 1rem;
        right: auto;
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .menu-toggle {
        flex-direction: row;
    }

    .fox-icon {
        display: none;
    }

    .menu-label {
        font-size: 0.9rem;
        color: var(--text-light);
    }
}


@media (max-width: 770px) {
    .page-layout {
        display: flex;
        flex-direction: column;
        margin-left: 0;
        padding: 1.5rem;
    }

    .page-left {
        width: 100%;
    }

    .page-right {
        display: block;
        width: 100%;
        margin-top: 2rem;  
        transform: none;  
    }

    .page-left .content p,
    .page-left .content li {
        font-size: 0.8rem;
        max-width: 100%;
    }

    .ch-title h1 {
        font-size: 1.5rem;
    }

    .ch-title p {
        font-size: 0.85rem;
    }
}