/* ── Shared project page styles ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F5F2EE;
  --ink: #2d2d2d;
  --orange: #E85D26;
  --navy: #1A3A5C;
  --green: #1B7F5E;
  --yellow: #F5C842;
  --red: #CC2B2B;
  --forest: #22421f;
  --sidebar-w: 56px;
  --sans: 'Work Sans', sans-serif;
}

html { scroll-behavior: smooth; }

/* Suppress menu transition during window resize to prevent breakpoint flash */
body.is-resizing .menu-overlay { transition: none !important; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  z-index: 300;
  background: #e3dfd0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 40px;
  border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-name {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #2d2d2d;
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
}

/* MENU OVERLAY — slides from left */
.menu-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  left: var(--sidebar-w);
  z-index: 200;
  background: #e3dfd0;
  display: flex;
  align-items: flex-start;
  padding: 80px 72px 72px;
  transform: translateX(-100%);
  transition: transform 0.5s cubic-bezier(0.77,0,0.175,1);
  pointer-events: none;
  overflow-y: auto;
}

.menu-overlay.open { transform: translateX(0); pointer-events: all; }

.menu-inner { 
  width: 100%; 
  min-height: min-content;
}

.menu-nav { display: flex; flex-direction: column; }

.menu-nav a {
  font-size: clamp(44px, 7.5vw, 96px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid rgba(45,45,45,0.1);
  transition: color 0.2s;
}

.menu-nav a:last-child { border-bottom: 1px solid rgba(45,45,45,0.1); }
.menu-nav a:hover { color: #1B7F5E; }

.menu-nav-arrow {
  font-size: 40px;
  font-weight: 300;
  opacity: 0.3;
  transition: opacity 0.2s, transform 0.2s;
}

.menu-nav a:hover .menu-nav-arrow { opacity: 1; transform: translate(6px,-6px); }

/* CONTACT FORM BUTTON */
.contact-menu-btn {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  text-align: left;
  width: 100%;
  font-size: clamp(44px, 7.5vw, 96px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid rgba(45,45,45,0.1);
  border-bottom: 1px solid rgba(45,45,45,0.1);
  transition: color 0.2s;
}

.contact-menu-btn:hover {
  color: #1B7F5E;
}

/* CONTACT FORM */
.contact-form-wrap {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
  padding: 0;
  border-bottom: 1px solid rgba(45,45,45,0.1);
}

.contact-form-wrap.active {
  max-height: 600px;
  opacity: 1;
  padding: 24px 0 16px;
}

.contact-form {
  max-width: 600px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  padding: 12px 16px;
  border: 1px solid rgba(45,45,45,0.2);
  background: rgba(255,255,255,0.5);
  color: var(--ink);
  border-radius: 4px;
  transition: border-color 0.2s, background 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green);
  background: rgba(255,255,255,0.8);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 32px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.form-submit:hover {
  background: var(--green);
  transform: translateY(-2px);
}

.form-submit:active {
  transform: translateY(0);
}

.form-status {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 400;
  text-align: center;
}

/* PAGE WRAP */
.page { margin-left: var(--sidebar-w); }

/* BACK LINK */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.4;
  transition: opacity 0.2s;
  padding: 40px 60px 0;
}

.back-link:hover { opacity: 1; }

/* PROJECT HERO */
.project-hero {
  padding: 40px 60px 80px;
  border-bottom: 1px solid rgba(26,26,26,0.1);
}

.project-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.project-index {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.35;
}

.project-type-tag {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid rgba(26,26,26,0.2);
  opacity: 0.6;
}

.project-hero h1 {
  font-size: clamp(52px, 7vw, 112px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.93;
  max-width: 16ch;
  margin-bottom: 40px;
}

.project-hero h1 em {
  font-weight: 400;
}

.project-details-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-top: 40px;
  border-top: 1px solid rgba(26,26,26,0.1);
}

.detail-block label {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.35;
  margin-bottom: 6px;
}

.detail-block span {
  font-size: 15px;
  font-weight: 400;
}

/* COVER IMAGE */
.project-cover {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}

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

/* PROJECT VIDEO */
.project-video {
  width: 100%;
}

.project-video video {
  width: 100%;
  display: block;
}

/* OVERVIEW */
.project-overview {
  padding: 80px 60px;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 80px;
  border-bottom: 1px solid rgba(26,26,26,0.1);
}

.overview-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.35;
  padding-top: 6px;
}

.overview-body p {
  font-size: 19px;
  line-height: 1.65;
  font-weight: 300;
  opacity: 0.8;
  margin-bottom: 20px;
}

.overview-body p:last-child { margin-bottom: 0; }

/* GALLERY */
.project-gallery { padding: 0; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px;
}

.gallery-grid.cols-1 { grid-template-columns: 1fr; }
.gallery-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.gallery-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.gallery-full { width: 100%; display: block; margin-bottom: 16px; }

.gallery-full img {
  width: 100%;
  object-fit: cover;
  display: block;
  max-height: 1000px;
}

/* NEXT PROJECT */
.next-project {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 60px;
  background: var(--ink);
  color: var(--bg);
  transition: background 0.3s;
}

.next-project:hover { background: #2a2a2a; }

.next-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-bottom: 16px;
}

.next-name {
  font-size: clamp(32px, 5vw, 72px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.next-arrow {
  font-size: 48px;
  font-weight: 300;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
}

.next-project:hover .next-arrow { opacity: 1; transform: translateX(12px); }

/* MOTH MIXED GRID — 2 verticals + 2 stacked squares */
.gallery-moth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  padding: 32px;
  aspect-ratio: 27 / 16;
}

.gallery-moth-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-moth-grid .moth-vert {
  grid-row: span 2;
}

/* RESPONSIVE — shared (sidebar, menu, page) + project pages */
@media (max-width: 900px) {
  :root { --sidebar-w: 44px; --topbar-h: 52px; }

  /* Sidebar → horizontal top bar */
  .sidebar {
    width: 100%;
    height: var(--topbar-h);
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0 16px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    bottom: auto;
  }

  /* Name: remove vertical writing mode, center horizontally */
  .sidebar-name {
    writing-mode: horizontal-tb;
    text-orientation: initial;
    transform: translateX(-50%);
    position: absolute;
    left: 50%;
    font-size: 30px;
    letter-spacing: 0;
  }

  /* Menu → slides down from top bar */
  .menu-overlay {
    top: var(--topbar-h);
    left: 0;
    transform: translateY(-100%);
    padding: 40px 36px 56px;
  }

  .menu-overlay.open { transform: translateY(0); }

  /* Page offset from top bar instead of left sidebar */
  .page { margin-left: 0; margin-top: var(--topbar-h); }

  .back-link { padding: 32px 28px 0; }
  .project-hero { padding: 32px 28px 56px; }
  .project-details-row { grid-template-columns: repeat(2,1fr); gap: 20px; }
  .project-overview { padding: 56px 28px; grid-template-columns: 1fr; gap: 24px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid.cols-3 { grid-template-columns: 1fr; }
  .gallery-moth-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    aspect-ratio: auto;
  }
  .gallery-moth-grid .moth-vert {
    grid-row: span 1;
    aspect-ratio: 9 / 16;
  }
  .gallery-moth-grid .moth-sq {
    aspect-ratio: 1;
  }
  .next-project { padding: 48px 28px; }
  .menu-nav a,
  .contact-menu-btn { font-size: clamp(36px, 9vw, 64px); padding: 12px 0; }
}

/* ══════════════════════════════
   TYPEWRITER HERO
══════════════════════════════ */
.type-hero {
  padding: 80px 30px 0 28px;
}

.type-line-wrap {
  display: block;
  height: calc(clamp(40px, 6.5vw, 100px) * 1.05 * 3 + 10px);
  overflow: hidden;
}

.type-text {
  font-size: clamp(40px, 6.5vw, 100px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.type-cursor {
  font-size: clamp(40px, 6.5vw, 100px);
  font-weight: 300;
  color: var(--green);
  margin-left: 4px;
  line-height: 1.05;
  animation: blink 0.75s step-end infinite;
  flex-shrink: 0;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ══════════════════════════════
   WORK GRID
══════════════════════════════ */
#work { padding: 0; }

.work-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 20px 60px 16px 28px;
}

.work-header h2 {
  font-size: clamp(22px, 2.8vw, 42px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: rgba(45, 45, 45, 0.5);
}

.work-header h2 em { font-weight: 400; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 0 20px;
}

.project-card {
  overflow: hidden;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
  padding: 8px;
  border-radius: 8px;
}

.project-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  transition: transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94);
}

.project-card:hover .project-img-wrap img { transform: scale(1.05); }

.img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
}

.project-card:hover .img-overlay { opacity: 1; }

.overlay-type {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 10px;
}

.overlay-desc {
  display: block;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  color: #fff;
}

.project-info {
  padding: 2px 16px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.project-name {
  font-size: clamp(16px, 1.8vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.project-arrow {
  font-size: 24px;
  font-weight: 300;
  opacity: 0.3;
  transition: opacity 0.2s, transform 0.2s;
  flex-shrink: 0;
  margin-left: 12px;
}

.project-card:hover .project-arrow {
  opacity: 1;
  transform: translate(4px, -4px);
}

/* color classes */
.c-orange      { color: var(--orange); }
.c-navy        { color: var(--navy); }
.c-green       { color: var(--green); }
.c-red         { color: var(--red); }
.c-yellow-dark { color: #a8771e; }

/* ══════════════════════════════
   ABOUT + CONTACT FOOTER
══════════════════════════════ */
#contact {
  border-top: 1px solid rgba(45,45,45,0.1);
  padding: 80px 60px 56px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-bottom: 80px;
}

.contact-section-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-bottom: 24px;
}

.contact-bio {
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.7;
  font-weight: 300;
  color: var(--ink);
  max-width: 480px;
}

.contact-bio a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(45,45,45,0.25);
  transition: opacity 0.2s;
}

.contact-bio a:hover { opacity: 0.5; }

.contact-links { display: flex; flex-direction: column; }

.contact-link {
  font-size: clamp(15px, 1.4vw, 22px);
  font-weight: 400;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(45,45,45,0.1);
  padding: 18px 0;
  transition: opacity 0.2s;
}

.contact-link:first-of-type { border-top: 1px solid rgba(45,45,45,0.1); }
.contact-link:hover { opacity: 0.45; }

.contact-link-arrow {
  font-size: 18px;
  opacity: 0.3;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.contact-link:hover .contact-link-arrow {
  opacity: 1;
  transform: translate(4px, -4px);
}

.contact-foot {
  font-size: 12px;
  font-weight: 300;
  opacity: 0.3;
  letter-spacing: 0.04em;
}

/* RESPONSIVE — portfolio */
@media (max-width: 900px) {
  .type-hero { padding: 56px 28px 0; }
  .work-header { padding: 30px 28px 8px; flex-wrap: wrap; gap: 16px; }
  .projects-grid { grid-template-columns: 1fr; padding: 0 20px; }
  .project-img-wrap { overflow: visible; }
  .project-info { padding: 2px 16px 20px; }
  .project-name { font-size: 24px; }
  #contact { padding: 56px 28px 40px; }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; margin-bottom: 48px; }
}

@media (max-width: 580px) {
  .type-line-wrap {
    height: auto;
    min-height: calc(clamp(40px, 6.5vw, 100px) * 1.05 * 2);
    overflow: visible;
  }
}

@media (max-width: 400px) {
  .type-line-wrap {
    min-height: calc(clamp(40px, 6.5vw, 100px) * 1.05 * 4);
  }
  .project-name { font-size: 18px; }
}

/* ══════════════════════════════
   ABOUT PAGE
══════════════════════════════ */

.about-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 100px);
}

.about-photo-col {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.about-photo-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(100%);
}

.about-text-col {
  padding: 60px 60px 80px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.about-text-inner { max-width: 520px; }

.about-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.35;
  margin-bottom: 28px;
}

.about-text-col h1 {
  font-size: clamp(40px, 4vw, 64px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.0;
  margin-bottom: 40px;
}

.about-text-col h1 em {
  font-weight: 400;
  color: var(--orange);
}

.about-body p {
  font-size: 18px;
  line-height: 1.75;
  opacity: 0.78;
  font-weight: 300;
  margin-bottom: 22px;
}

.about-body p:last-child { margin-bottom: 0; }

.about-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 2px solid var(--forest);
  padding-bottom: 2px;
  margin-top: 32px;
  transition: color 0.2s;
}

.about-cta:hover { color: var(--forest); }

/* About contact section */
.page-about #contact {
  background: #2a2a2a;
  padding: 48px 60px;
  border-top: none;
  color: #fff;
}

.contact-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.page-about #contact h2 {
  font-size: clamp(25px, 3.5vw, 50px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
}

.page-about #contact h2 em { font-weight: 400; }

.page-about .contact-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.page-about .contact-link {
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
  border-bottom: none;
  padding: 0;
}

.page-about .contact-link:hover { opacity: 0.55; }

/* Responsive — about page */
@media (max-width: 900px) {
  .about-wrap { grid-template-columns: 1fr; min-height: auto; }

  .about-photo-col {
    position: relative;
    height: 70vw;
    max-height: 480px;
  }

  .about-text-col { padding: 48px 28px 64px; }
  .about-text-inner { max-width: 100%; }
  .page-about #contact { padding: 34px 28px; }
  .contact-inner { flex-direction: column; align-items: flex-start; }
  .page-about .contact-links { align-items: flex-start; }
}
