:root {
  --ink:        #1A1918;
  --charcoal:   #2F2E2E;
  --warm-white: #FAFAFA;
  --paper:      #F2F2F2;
  --paper-card: #FFFFFF;
  --line:       #E5E5E5;
  --muted:      #7E7C78;
  --fn-sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fn-serif:   "Cormorant Garamond", "Cormorant Garant", Georgia, serif;
}

html {
  scroll-behavior: smooth;
}

/* Custom Light Gray Text Selection Highlight */
::selection,
*::selection {
  background-color: #D4D4D0 !important;
  color: #1A1918 !important;
}

::-moz-selection,
*::-moz-selection {
  background-color: #D4D4D0 !important;
  color: #1A1918 !important;
}

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

body {
  font-family: var(--fn-sans);
  background: var(--warm-white);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.7;
  transition: background-color 0.3s ease;
}

img {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

/* -- NAV ------------------------------------------- */
.nav {
  position: sticky;
  top: 16px;
  z-index: 500;
  margin: 16px auto 0;
  width: fit-content;
  max-width: min(94vw, 980px);
  background: rgba(250, 250, 250, 0.88);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: 9999px;
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 22px;
  height: 54px;
  gap: 28px;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-brand img {
  height: 34px;
  width: auto;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-brand:hover img {
  opacity: 0.85;
  transform: scale(1.03);
}

.nav-links {
  display: flex;
  gap: 26px;
  list-style: none;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-links a {
  color: var(--charcoal);
  opacity: 0.65;
  position: relative;
  padding: 4px 0;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links a:hover {
  opacity: 1;
  color: var(--ink);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-links a:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
  opacity: 1;
}

.nav-links a.active {
  opacity: 1;
  color: var(--ink);
  font-weight: 500;
}

.nav-links .has-dropdown {
  position: relative;
}

.nav-dropdown {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--warm-white);
  border: 1px solid var(--line);
  min-width: 170px;
  list-style: none;
  padding: 6px 0;
  z-index: 550;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

.nav-dropdown::before {
  content: "";
  position: absolute;
  top: -16px;
  left: -20px;
  right: -20px;
  height: 20px;
  background: transparent;
  pointer-events: auto;
}

.has-dropdown:hover .nav-dropdown,
.has-dropdown:focus-within .nav-dropdown,
.nav-dropdown:hover {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown li a {
  display: block;
  padding: 9px 20px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--charcoal);
  opacity: 0.7;
  white-space: nowrap;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.nav-dropdown li a::after {
  display: none;
}

.nav-dropdown li a:hover {
  opacity: 1;
  background: var(--paper);
  color: var(--ink);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 32px;
}

.lang-toggle {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid rgba(26, 25, 24, 0.2);
  padding: 7px 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.lang-toggle:hover {
  background: var(--ink);
  color: var(--warm-white);
  border-color: var(--ink);
}

.lang-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 22px;
  height: 16px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.nav-toggle.is-active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.nav-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.nav-mobile-panel {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--warm-white);
  border-bottom: 1px solid var(--line);
  z-index: 199;
  padding: 6px 24px 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.nav-mobile-panel.is-open {
  display: flex;
}

.nav-mobile-panel a {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--charcoal);
  transition: padding-left 0.2s ease, color 0.2s ease;
}

.nav-mobile-panel a:hover {
  padding-left: 6px;
  color: var(--ink);
}

.nav-mobile-panel a:last-child {
  border-bottom: none;
}

.nav-mobile-panel a.active {
  color: var(--ink);
  font-weight: 500;
}

/* -- PAGE HEADER ----------------------------------- */
.page-header {
  padding: 90px 52px 80px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-header-frame {
  display: inline-block;
  width: 320px;
  max-width: 90%;
  border: 1px solid rgba(26, 25, 24, 0.15);
  padding: 16px 0 14px;
  margin-bottom: 22px;
  text-align: center;
  background: rgba(26, 25, 24, 0.005);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-header-frame:hover {
  border-color: var(--ink);
  background: rgba(26, 25, 24, 0.02);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.page-header-frame h1 {
  font-family: var(--fn-sans);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 500;
}

.page-header-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  font-weight: 500;
}

.page-header-subtitle {
  font-family: var(--fn-serif);
  font-size: 21px;
  font-style: italic;
  font-weight: 300;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

/* -- FOOTER ---------------------------------------- */
footer {
  border-top: 1px solid var(--line);
  padding: 36px 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

footer a {
  color: var(--muted);
  position: relative;
  transition: color 0.25s ease;
}

footer a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

footer a:hover {
  color: var(--ink);
}

footer a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.footer-links {
  display: flex;
  gap: 28px;
}

/* -- LIGHTBOX -------------------------------------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(18, 17, 16, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 32px;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 95vh;
  gap: 24px;
}

.lightbox-img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
  transform: scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.is-open .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
  color: #fff;
  transform: scale(1.05);
}

.lightbox-caption {
  text-align: center;
}

.lightbox-caption-title {
  font-family: var(--fn-serif);
  font-size: 21px;
  font-style: italic;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 6px;
}

.lightbox-caption-meta {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.drawing-img-wrap {
  cursor: zoom-in;
}

/* -- RESPONSIVE BASE -------------------------------- */
@media (max-width: 900px) {
  .nav { padding: 0 24px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .page-header { padding: 60px 24px 56px; }
  footer { padding: 28px 24px; flex-direction: column; gap: 16px; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
}

/* -- ENTRANCE ANIMATIONS ----------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-category,
.timeline-entry,
.section-featured,
.section-intro,
.section-steps,
.section-method,
.section-video,
.section-closing,
.hero-image,
.page-header {
  animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Stagger card load in portfolio */
.drawing-grid > *:nth-child(1) { animation-delay: 0.04s; }
.drawing-grid > *:nth-child(2) { animation-delay: 0.08s; }
.drawing-grid > *:nth-child(3) { animation-delay: 0.12s; }
.drawing-grid > *:nth-child(4) { animation-delay: 0.16s; }
.drawing-grid > *:nth-child(5) { animation-delay: 0.2s; }
.drawing-grid > *:nth-child(6) { animation-delay: 0.24s; }
.drawing-grid > *:nth-child(7) { animation-delay: 0.28s; }
.drawing-grid > *:nth-child(8) { animation-delay: 0.32s; }

