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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #000;
}

/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

#hero h1 {
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 3rem;
}

#hero h1 a {
    color: #000;
    text-decoration: none;
}

#hero h1 a:hover {
    text-decoration: underline;
}

#hero h1 a {
    color: #000;
    text-decoration: none;
}

#hero h1 a:hover {
    text-decoration: underline;
}

.hero-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 4rem;
    margin-bottom: 2rem;
}

.hero-nav a {
    font-size: 1.125rem;
    font-weight: 500;
    text-decoration: none;
    color: #000;
    letter-spacing: 0.02em;
    transition: opacity 0.2s;
}

.hero-nav a:hover {
    opacity: 0.6;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-icons a {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    transition: opacity 0.2s;
}

.social-icons a:hover {
    opacity: 0.6;
}

.social-icons svg {
    width: 24px;
    height: 24px;
}

/* About Section with Sidebar */
#about {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
}

.sidebar {
    background-color: #fff;
    padding: 3rem 2rem;
    border-right: 1px solid #e0e0e0;
}

.logo {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* The left rule hangs in the sidebar gutter so link text stays aligned with the logo */
.main-nav a {
    --rule-width: 3px;
    --rule-gap: 0.75rem;
    margin-left: calc(-1 * (var(--rule-width) + var(--rule-gap)));
    padding-left: var(--rule-gap);
    border-left: var(--rule-width) solid transparent;
    text-decoration: none;
    color: #111;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: color 150ms ease-out, border-color 150ms ease-out;
}

.main-nav .nav-child {
    margin-left: calc(1rem - (var(--rule-width) + var(--rule-gap)));
    color: #666;
    font-weight: 400;
    margin-top: 0.5rem;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    color: #111;
    border-left-color: #111;
}

.main-nav a:focus-visible {
    outline: 2px solid #111;
    outline-offset: 3px;
}

.main-nav a[aria-current="page"] {
    color: #111;
    font-weight: 700;
    border-left-color: #111;
}

/* Parent category of the current project page */
.main-nav :where(.nav-section:has(.nav-child[aria-current="page"])) .nav-parent {
    font-weight: 700;
    border-left-color: #888;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-utility {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.nav-utility a {
    color: #666;
    font-weight: 400;
}

/* Content Area */
.content {
    padding: 4rem 6rem;
    max-width: 900px;
}

.content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    letter-spacing: 0.02em;
}

.content h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.intro, .education, .experience {
    margin-bottom: 3rem;
}

.greeting {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.content p {
    line-height: 1.7;
    margin-bottom: 1rem;
    color: #333;
}

.edu-item, .exp-item {
    color: #999;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
    #about {
        grid-template-columns: 250px 1fr;
    }

    .content {
        padding: 3rem 3rem;
    }
}

@media (max-width: 768px) {
    #about {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .content {
        padding: 2rem 1.5rem;
    }

    .hero-nav {
        gap: 2rem;
    }
}
/* Photo Grid for Portfolio Pages */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0;
  }
  
  .photo-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
    transition: transform 200ms ease-out, box-shadow 200ms ease-out;
  }
  
  .photo-grid > img:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
  
  @media (min-width: 769px) {
    .photo-grid.compact-grid {
      max-width: 80%;
    }
  }

  /* Lightbox */
  .photo-grid > img {
    cursor: zoom-in;
  }

  .lightbox {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    padding: 3rem 2rem;
    border: none;
    background: transparent;
  }

  .lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .lightbox::backdrop {
    background: rgba(0, 0, 0, 0.85);
  }

  .lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  }

  .lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
  }

  body:has(.lightbox[open]) {
    overflow: hidden;
  }

  /* Update existing .content for portfolio grid pages */
  .content.portfolio-grid {
    max-width: 1400px;
    padding: 4rem 3rem;
  }
  
  .content.portfolio-grid h2 {
    text-align: left;
    margin-bottom: 3rem;
  }

/* Thumbnail Card */
.thumbnail-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}

.thumbnail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.thumbnail-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.thumbnail-card .card-title {
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    line-height: 1.4;
}

.thumbnail-card .card-summary {
    padding: 0 1rem 1rem;
    margin: -0.5rem 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
}

.thumbnail-card .card-media {
    position: relative;
}

.thumbnail-card .card-lock-label {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    background: #111;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.image-placeholder {
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: #e6e6e6;
    color: #666;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-align: center;
}

.content .section-intro {
    max-width: 640px;
    margin: -1.5rem 0 3rem;
    font-size: 1.125rem;
}

/* Case Study Pages */
.content.case-study h2 {
    margin-bottom: 1.5rem;
}

.content .case-intro {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #111;
    margin-bottom: 2.5rem;
}

.case-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 0;
    margin-bottom: 3rem;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.case-meta dt {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #666;
    margin-bottom: 0.35rem;
}

.case-meta dd {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #111;
}

.case-section {
    margin-bottom: 3.5rem;
}

.case-section ul {
    padding-left: 1.25rem;
    line-height: 1.7;
    color: #333;
}

.case-section li {
    margin-bottom: 0.5rem;
}

.case-section ul + p {
    margin-top: 1rem;
}

.case-section h4 {
    margin: 2rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #111;
}

.case-section h3 + h4 {
    margin-top: 0;
}

.case-callout {
    margin: 2rem 0 0;
    padding-left: 1.25rem;
    border-left: 3px solid #111;
    font-size: 1.25rem;
    line-height: 1.5;
    color: #111;
}

.case-areas {
    margin: 1.5rem 0;
    border-top: 1px solid #e0e0e0;
}

.case-areas div {
    display: grid;
    grid-template-columns: minmax(0, 13rem) 1fr;
    gap: 0.35rem 1.5rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.case-areas dt {
    font-weight: 600;
    color: #111;
}

.case-areas dd {
    line-height: 1.6;
    color: #555;
}

@media (max-width: 560px) {
    .case-areas div {
        grid-template-columns: 1fr;
    }
}

.case-figure {
    margin: 0 0 3rem;
}

.case-section .case-figure {
    margin: 2rem 0 0;
}

.case-figure img {
    display: block;
}

.case-figure img,
.case-figure .image-placeholder {
    width: 100%;
    border-radius: 4px;
}

.case-figure figcaption {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #666;
}

.case-pager {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.case-pager a {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-decoration: none;
    color: #111;
    font-weight: 600;
    transition: opacity 0.2s;
}

.case-pager a:hover {
    opacity: 0.6;
}

.case-pager a:focus-visible {
    outline: 2px solid #111;
    outline-offset: 4px;
}

.case-pager .case-pager-next {
    margin-left: auto;
    text-align: right;
}

.case-pager-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #666;
}
  
  /* Hide checkbox */
.menu-toggle {
    display: none;
  }
  
  /* Hamburger icon (hidden by default) */
  .hamburger {
    display: none;
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1000;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
  }
  
  .hamburger span {
    width: 28px;
    height: 3px;
    background: #000;
    border-radius: 2px;
    transition: all 0.3s ease;
  }
  
  /* Mobile styles */
  @media (max-width: 768px) {
    /* Show hamburger on mobile */
    .hamburger {
      display: flex;
    }

    /* Visually hidden but still focusable, so keyboard users can toggle the menu */
    .menu-toggle {
      display: block;
      position: fixed;
      top: 1.5rem;
      left: 1.5rem;
      width: 1px;
      height: 1px;
      margin: 0;
      opacity: 0;
    }

    .menu-toggle:focus-visible ~ .hamburger {
      outline: 2px solid #111;
      outline-offset: 6px;
    }
  
    /* Hide sidebar by default on mobile; visibility keeps off-screen links out of the tab order */
    .sidebar {
      position: fixed;
      left: -100%;
      top: 0;
      height: 100vh;
      width: 280px;
      overflow-y: auto;
      z-index: 999;
      visibility: hidden;
      transition: left 0.3s ease, visibility 0.3s;
      box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
  
    /* Show sidebar when checkbox is checked */
    .menu-toggle:checked ~ #about .sidebar {
      left: 0;
      visibility: visible;
    }
  
    /* Animate hamburger to X when open */
    .menu-toggle:checked ~ .hamburger span:nth-child(1) {
      transform: rotate(45deg) translate(6px, 6px);
    }
  
    .menu-toggle:checked ~ .hamburger span:nth-child(2) {
      opacity: 0;
    }
  
    .menu-toggle:checked ~ .hamburger span:nth-child(3) {
      transform: rotate(-45deg) translate(6px, -6px);
    }
  
    /* Adjust content area */
    .content {
      margin-left: 0;
      padding: 4rem 1.5rem;
    }
  }


/* Case study layout (Astro content collection) */
.case-hero {
    margin-bottom: 3rem;
}

.case-hero-figure {
    margin-top: 2rem;
}

.case-layout {
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
    margin-bottom: 2rem;
}

.case-meta-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0;
    margin: 0;
    border: none;
}

.case-meta-stack > div {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e0e0e0;
}

.case-body {
    min-width: 0;
}

.case-body .case-section:first-child {
    margin-top: 0;
}

.case-figure-full {
    width: 100%;
}

.case-figure-full img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

@media (max-width: 900px) {
    .case-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .case-meta-stack {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 1.25rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid #e0e0e0;
    }

    .case-meta-stack > div {
        padding-bottom: 0;
        border-bottom: none;
    }
}
