/* ============================================================
   Variables
   ============================================================ */
:root {
  --content-max: 1200px;
  --page-bg:    #0c0f0a;
  --card-bg:    #181b17;
  --card-hover: #222521;
  --text:       #cecfce;
  --text-muted: #8c8a82;
  --btn-bg:     #4c5a45;
  --green:      #7a9e72;
  --radius:     36px;
  --gap:        24px;
  --gutter:     56px;
}


/* ============================================================
   Reset
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}


/* ============================================================
   Base
   ============================================================ */
body {
  background-color: var(--page-bg);
  font-family: "DM Sans", sans-serif;
  font-size: 24px;
  font-weight: 300;
  color: var(--text);
}

.display {
  font-family: "Instrument Serif", serif;
  font-size: 136px;
  font-weight: 300;
  line-height: 1;
  color: var(--text);
}

h1 {
  font-family: "Instrument Serif", serif;
  font-size: 64px;
  font-weight: 300;
  line-height: 1.1;
  color: var(--text);
}

h2 {
  font-family: "Instrument Serif", serif;
  font-size: 44px;
  font-weight: 300;
  color: var(--text);
}

h3 {
  font-family: "DM Sans", sans-serif;
  font-size: 32px;
  font-weight: 500;
  color: var(--text);
}

h4 {
  font-family: "DM Sans", sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
}

p {
  font-size: 20px;
  line-height: 1.5;
  color: var(--text-muted);
}

a {
  color: var(--text);
  text-decoration: none;
}


/* ============================================================
   Navigation
   ============================================================ */
nav {
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 36px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 100;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}



/* ============================================================
   Button
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--btn-bg);
  border: none;
  padding: 0 24px;
  height: 56px;
  border-radius: 56px;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 20px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 200ms ease, transform 0ms, filter 0ms;
}

.btn:hover {
  filter: brightness(1.2);
}

.btn:active {
  transform: scale(0.95);
  filter: brightness(1.3);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: transparent;
  border: none;
  padding: 0 24px;
  height: 56px;
  border-radius: 56px;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 20px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 200ms ease, transform 0ms, filter 0ms;
}

.btn-ghost:hover {
  background-color: var(--card-hover);
}

.btn-ghost:active {
  transform: scale(0.95);
  filter: brightness(1.2);
}

.btn-ghost svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}


/* ============================================================
   Hero
   ============================================================ */
section.hero {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--content-max);
  margin: 0 auto 96px auto;
  height: 80vh;
  min-height: 600px;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}

#topo-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  display: block;
}

.topo-fade-edge {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 65% 55% at 50% 42%,
    transparent 0%,
    transparent 30%,
    rgba(24, 27, 23, 0.5) 60%,
    rgba(24, 27, 23, 0.88) 100%
  );
}

.topo-fade-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, var(--card-bg) 0%, var(--card-bg) 15%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-content p {
  max-width: 1200px;
}


/* ============================================================
   Work
   ============================================================ */
section.work,
section.about,
section.building {
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 96px 0;
}

section.work h2,
section.about h2,
section.building h2 {
  margin-bottom: 24px;
}

.grid-col-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.grid-col-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.work-items-grid + .work-items-grid {
  margin-top: var(--gap);
}

.work-item {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color 200ms ease;
}

a.work-item:hover {
  background-color: var(--card-hover);
}

.wi-header {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--card-hover);
  display: block;
  border-radius: var(--radius);
}

img.wi-header {
  object-fit: cover;
  object-position: top center;
}

.wi-desc {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}


/* ============================================================
   About
   ============================================================ */
.about-content {
  align-items: stretch;
}

img.profile-photo {
  width: 100%;
  height: 720px;
  object-fit: cover;
  object-position: center center;
  display: block;
  border-radius: var(--radius);
}

.about-grid-item {
  background-color: var(--card-bg);
  padding: 24px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-grid {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.about-desc {
  background-color: var(--card-bg);
  padding: 24px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: var(--gap);
  flex: 1;
}

.about-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}


/* ============================================================
   Mobile Nav
   ============================================================ */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
}

.nav-toggle svg {
  width: 28px;
  height: 28px;
}

.nav-toggle .icon-close { display: none; }

.nav-open .nav-toggle .icon-menu { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background-color: var(--card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.nav-overlay ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

.nav-overlay ul li {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 350ms ease, transform 350ms ease;
}

.nav-overlay.open ul li:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 80ms; }
.nav-overlay.open ul li:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 150ms; }
.nav-overlay.open ul li:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 220ms; }
.nav-overlay.open ul li:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 290ms; }


body.nav-open {
  overflow: hidden;
}


/* ============================================================
   Animations
   ============================================================ */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

nav          { animation: fade-up 600ms ease both; }
section.hero { animation: fade-up 700ms ease both 80ms; }
section.hero .hero-content .display { animation: fade-up 700ms ease both 160ms; }
section.hero .hero-content p  { animation: fade-up 700ms ease both 280ms; }

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   Responsive — Large (≤ 1200px)
   ============================================================ */
@media (max-width: 1200px) {
  .display { font-size: 104px; }
}


/* ============================================================
   Responsive — Tablet (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  .display { font-size: 88px; }
  h1 { font-size: 52px; }
  h2 { font-size: 36px; }
  h3 { font-size: 24px; }

  nav ul { display: none; }
  .nav-toggle { display: block; }

  .grid-col-2,
  .grid-col-3 {
    grid-template-columns: 1fr;
  }

  img.profile-photo {
    height: 480px;
  }
}


/* ============================================================
   Case Study
   ============================================================ */
.gate-back {
  position: fixed;
  top: 28px;
  left: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: background-color 200ms ease, transform 0ms, filter 0ms;
}

.gate-back:hover {
  background-color: var(--card-hover);
}

.gate-back:active {
  transform: scale(0.92);
  filter: brightness(1.2);
}


.cs-header {
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--content-max);
  margin: 0 auto 96px auto;
  background-color: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  height: 78vh;
  min-height: 620px;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.cs-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 15, 10, 0.95) 0%, rgba(12, 15, 10, 0.6) 50%, transparent 80%);
  z-index: 1;
}

.cs-header-content {
  position: relative;
  z-index: 2;
  padding-bottom: var(--gutter);
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cs-header-graphic {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cs-header-graphic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}


.cs-body {
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--content-max);
  margin: 0 auto;
  padding-bottom: 96px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.cs-section-inner,
.cs-text,
.cs-section--labeled,
.cs-card {
  max-width: 1000px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}


.cs-section {
  display: flex;
  flex-direction: column;
  gap: 48px;
}


.cs-section--labeled {
  gap: 24px;
}

.cs-section-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


.cs-col-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.cs-col-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

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


.cs-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-flow-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-flow-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--text-muted);
}

.cs-flow-list li svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 4px;
}

.cs-flow-list li svg {
  color: var(--text-muted);
}

.cs-flow-list .cs-flow-fail svg {
  color: #c0635a;
}

.cs-flow-list .cs-flow-success svg {
  color: var(--green);
}


.cs-image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: var(--card-hover);
  border-radius: var(--radius);
  overflow: hidden;
}

.cs-image-full {
  aspect-ratio: 16 / 7;
  border-radius: var(--radius);
}

.cs-image-placeholder img {
  display: block;
  width: 100%;
  height: auto;
}

.cs-image-placeholder:has(img) {
  aspect-ratio: unset;
}

.cs-stat-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-stat-card h2 {
  font-size: 64px;
  line-height: 1;
}



.cs-page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.cs-prev-link,
.cs-next-link {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text);
  transition: background-color 200ms ease;
}

.cs-prev-link:hover,
.cs-next-link:hover {
  background-color: var(--card-hover);
}

.cs-prev-link > p,
.cs-next-link > p {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-next-link:only-child {
  grid-column: 2;
}


.cs-prev-link > p svg,
.cs-next-link > p svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .cs-col-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .cs-header {
    height: 50vh;
    min-height: 400px;
    width: 100%;
    border-radius: 0;
  }

  .cs-header-content {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }

  .cs-body {
    gap: 36px;
  }

  .cs-prev-link,
  .cs-next-link {
    padding: 24px;
  }

}


/* ============================================================
   Password Gate
   ============================================================ */
#password-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: var(--page-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 400ms ease;
}

#password-gate.gate-exit {
  opacity: 0;
}

.gate-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 48px;
  max-width: 680px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gate-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--card-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  margin-bottom: 8px;
}

.gate-input-wrap {
  position: relative;
  margin-top: 8px;
}

.gate-input {
  width: 100%;
  height: 56px;
  border-radius: 56px;
  border: none;
  background-color: var(--card-hover);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 20px;
  font-weight: 300;
  padding: 0 68px 0 24px;
  outline: none;
  transition: background-color 200ms ease;
}

.gate-input:focus {
  background-color: #2a2e28;
}

.gate-input::placeholder {
  color: var(--text-muted);
}

.gate-submit {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--btn-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, filter 0ms;
}

.gate-submit.visible {
  opacity: 1;
  pointer-events: all;
}

.gate-submit:active {
  transform: translateY(-50%) scale(0.92);
  filter: brightness(1.3);
}

.gate-error {
  font-size: 16px;
  color: #c97b6a;
}

.gate-error:empty {
  display: none;
}

.gate-card p a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ============================================================
   Footer
   ============================================================ */
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 40px var(--gutter) 80px;
  text-align: center;
}


/* ============================================================
   Responsive — Mobile (≤ 600px)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --gutter: 24px;
    --radius: 24px;
    --gap:    12px;
  }

  nav {
    padding: 24px 0 12px;
  }

  .display { font-size: 68px; }
  h1 { font-size: 44px; }
  h2 { font-size: 32px; }
  h3 { font-size: 22px; }
  p  { font-size: 16px; }

  section.hero {
    min-height: 70vh;
  }

  .hero-content {
    gap: 12px;
  }

  section.work,
  section.about,
  section.building {
    padding: 56px 0;
  }


  img.profile-photo {
    height: 560px;
  }
}
