/* =============================================
   MOII Architekci — site.css
   ============================================= */

/* =============================================
   INTRO ANIMATION
   ============================================= */

.intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #010101;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.intro.exit {
  opacity: 0;
  pointer-events: none;
}

.intro.hidden { display: none; }

.intro-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  transform: translateY(-10px);
}

/* Logo */
.intro-logo-wrap {
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  animation: introLogoIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.intro-logo {
  height: 80px;
  width: auto;
  display: block;
}

@keyframes introLogoIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Horizontal line */
.intro-line {
  width: 280px;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  margin: 24px 0 20px;
  transform: scaleX(0);
  animation: introLineIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards;
}

@keyframes introLineIn {
  to {
    transform: scaleX(1);
  }
}

/* Text — each letter staggered */
.intro-text {
  display: flex;
  gap: 0;
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.35rem;
  color: rgba(255, 255, 255, 0.55);
}

.intro-text span {
  opacity: 0;
  transform: translateY(10px);
  animation: introLetterIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.intro-text span:nth-child(1)  { animation-delay: 1.0s; }
.intro-text span:nth-child(2)  { animation-delay: 1.04s; }
.intro-text span:nth-child(3)  { animation-delay: 1.08s; }
.intro-text span:nth-child(4)  { animation-delay: 1.12s; }
.intro-text span:nth-child(5)  { animation-delay: 1.16s; }
.intro-text span:nth-child(6)  { animation-delay: 1.20s; }
.intro-text span:nth-child(7)  { animation-delay: 1.24s; }
.intro-text span:nth-child(8)  { animation-delay: 1.28s; }
.intro-text span:nth-child(9)  { animation-delay: 1.32s; }
.intro-text span:nth-child(10) { animation-delay: 1.36s; }

@keyframes introLetterIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* After intro exits, ensure body can scroll */
.intro-active { overflow: hidden; }

/* Responsive intro */
@media (max-width: 600px) {
  .intro-logo { height: 56px; }
  .intro-line { width: 200px; }
  .intro-text { font-size: 0.6875rem; letter-spacing: 0.25rem; }
}

/* Skip animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Palette (dark default) ---------- */
:root {
  --bg: #010101;
  --fg: #ffffff;
  --fg-muted: rgba(255, 255, 255, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --header-h: 130px;
  --pad: 20px;
  --margin: 60px;
}

html.light-mode {
  --bg: #ffffff;
  --fg: #151515;
  --fg-muted: rgba(21, 21, 21, 0.72);
  --border: rgba(21, 21, 21, 0.1);
}

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

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Anaheim', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 var(--margin);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }

/* Smooth theme transition (class added by JS after first paint) */
html.theme-ready,
html.theme-ready body,
html.theme-ready header,
html.theme-ready footer,
html.theme-ready .header-controls button {
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* =============================================
   HEADER
   ============================================= */

header {
  position: fixed;
  top: 0; left: var(--margin); right: var(--margin);
  height: var(--header-h);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  z-index: 200;
  border-bottom: 1px solid var(--border);
}

.logo img { height: 90px; width: auto; }
html:not(.light-mode) .logo img { filter: invert(1); }

nav { display: flex; align-items: center; }

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

nav a {
  display: block;
  padding: 0.5rem 1rem;
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.15rem;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color 0.2s;
}

nav a:hover { color: var(--fg); }
nav a[aria-current="page"] { color: var(--fg); }

/* Header controls (theme + lang) */
.header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
}

.header-controls button {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 2px;
  line-height: 1;
  transition: color 0.2s, border-color 0.2s;
}

.header-controls button:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
}

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: 16px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--fg);
  transition: transform 0.3s, opacity 0.3s;
}

.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* =============================================
   MAIN
   ============================================= */

main { padding-top: var(--header-h); min-height: 100vh; }

/* =============================================
   HOMEPAGE — filter
   ============================================= */

.filter-bar {
  display: flex;
  gap: 0;
  padding: 50px var(--pad) 2rem;
  flex-wrap: wrap;
}

.filter-bar button {
  background: none;
  border: none;
  font-family: 'Quattrocento Sans', sans-serif;
  color: var(--fg);
  font-size: 0.925rem;
  font-weight: 400;
  text-transform: uppercase;
  cursor: pointer;
  padding: 2px 6px;
  transition: background 0.2s, color 0.2s;
  position: relative;
}

.filter-bar button:hover {
  opacity: 0.7;
}

.filter-bar button.active {
  background: var(--fg);
  color: var(--bg);
}

/* =============================================
   HOMEPAGE — masonry grid
   ============================================= */

.portfolio-grid { position: relative; }

.portfolio-item {
  position: absolute;
  top: 0; left: 0;
  overflow: hidden;
  opacity: 0;
  line-height: 0;
  font-size: 0;
  transition: transform 0.6s ease, opacity 0.35s ease;
}

.portfolio-item::before,
.portfolio-item::after {
  content: '';
  position: absolute;
  top: 10px; right: 10px; bottom: 10px; left: 10px;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.35s, transform 0.6s;
}

.portfolio-item::before {
  border-top: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: scaleX(0);
}

.portfolio-item::after {
  border-left: 2px solid #fff;
  border-right: 2px solid #fff;
  transform: scaleY(0);
}

.portfolio-item:hover::before,
.portfolio-item:hover::after {
  opacity: 1;
  transform: scale(1);
}

.portfolio-item img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease;
}

.portfolio-item:hover img { transform: scale(1.04); }

.portfolio-item .overlay {
  position: absolute;
  inset: 0;
  background: rgba(21, 21, 21, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 1;
  transition: opacity 0.4s ease;
}

.portfolio-item:hover .overlay { opacity: 1; }

.portfolio-item .overlay span {
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: normal;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  transform: translateY(8px);
  transition: transform 0.3s ease;
}

.portfolio-item:hover .overlay span { transform: translateY(0); }

/* =============================================
   PROJECT DETAIL
   ============================================= */

.project-images img {
  width: 100%;
  margin-bottom: 2px;
}

.project-images img:last-child { margin-bottom: 0; }

.related-section { padding: 60px var(--pad) 0; }

.related-section h4 {
  text-align: center;
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 0.875rem;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--fg-muted);
  margin-bottom: 8px;
  padding-bottom: 12px;
  position: relative;
}

.related-section h4::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 1px;
  background: var(--fg);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 28px;
}

.related-item {
  position: relative;
  overflow: hidden;
}

.related-item img { transition: transform 0.4s ease; }
.related-item:hover img { transform: scale(1.04); }

.related-item .overlay {
  position: absolute;
  inset: 0;
  background: rgba(21, 21, 21, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.related-item:hover .overlay { opacity: 1; }

.related-item .overlay span {
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
}

/* =============================================
   ABOUT
   ============================================= */

.about-intro {
  padding: 48px var(--pad) 40px;
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--fg-muted);
  max-width: 960px;
  margin: 0 auto;
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding-bottom: 60px;
  max-width: 960px;
  margin: 0 auto;
}

.team-member img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
}

.team-member-bio {
  padding: 20px 4px;
  font-size: 0.9375rem;
  line-height: 1.85;
  color: var(--fg-muted);
}

/* =============================================
   ARCHITECTURE
   ============================================= */

.arch-hero {
  padding: 80px var(--pad) 60px;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.arch-hero h1 {
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.5;
  max-width: 700px;
  margin: 0 auto;
}

.arch-hero p {
  margin-top: 24px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--fg-muted);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.arch-services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  max-width: 960px;
  margin: 0 auto;
}

.arch-service {
  padding: 48px var(--pad);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.arch-service:last-child { border-right: none; }

.arch-service h3 {
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 0.8125rem;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 20px;
}

.arch-service p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--fg-muted);
}

.arch-process {
  padding: 60px var(--pad) 80px;
  max-width: 960px;
  margin: 0 auto;
}

.arch-process h2 {
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 0.8125rem;
  letter-spacing: 0.15rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--fg-muted);
  margin-bottom: 48px;
  text-align: center;
}

.arch-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.arch-step-num {
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--border);
  margin-bottom: 16px;
  line-height: 1;
}

.arch-step h4 {
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  font-weight: 700;
  margin-bottom: 12px;
}

.arch-step p {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--fg-muted);
}

/* =============================================
   CONTACT
   ============================================= */

.contact-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - var(--header-h) - 120px);
  padding: 80px var(--pad);
}

.contact-header {
  margin-bottom: 64px;
}

.contact-header h2 {
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.contact-subtitle {
  font-size: 1rem;
  color: var(--fg-muted);
  line-height: 1.8;
}

.contact-fields {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.contact-divider {
  width: 1px;
  height: 60px;
  background: var(--border);
  align-self: center;
}

.contact-field {
  padding: 0 48px;
}

.contact-field h3 {
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15rem;
  color: var(--fg-muted);
  margin-bottom: 10px;
}

.contact-field p {
  font-size: 1.0625rem;
  line-height: 1.6;
}

.contact-field a {
  color: var(--fg);
  transition: color 0.2s;
}

.contact-field a:hover {
  color: var(--fg-muted);
}

.contact-social {
  margin-top: 64px;
}

.contact-social a {
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15rem;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  transition: color 0.2s, border-color 0.2s;
}

.contact-social a:hover {
  color: var(--fg);
  border-color: var(--fg);
}

/* =============================================
   FOOTER
   ============================================= */

footer {
  border-top: 1px solid var(--border);
  padding: 40px var(--pad);
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Quattrocento Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.footer-right { display: flex; gap: 24px; align-items: center; }

footer a { color: var(--fg-muted); transition: color 0.2s; }
footer a:hover { color: var(--fg); }

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 900px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: 1fr; }
  .arch-services { grid-template-columns: 1fr; }
  .arch-service { border-right: none; }
  .arch-steps { grid-template-columns: repeat(2, 1fr); }
  .contact-fields { flex-direction: column; align-items: center; }
  .contact-divider { width: 40px; height: 1px; }
  .contact-field { padding: 24px 0; }
}

@media (max-width: 768px) {
  :root { --margin: 0px; --header-h: 70px; }
  header { left: 0; right: 0; padding: 0 16px; }
  .logo img { height: 50px; }

  nav ul {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0; bottom: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    overflow-y: auto;
    z-index: 199;
    border-top: 1px solid var(--border);
    padding: 8px 0;
  }

  nav ul.open { display: flex; }
  nav ul li { width: 100%; }
  nav a {
    padding: 14px 20px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
  }

  .menu-toggle { display: flex; }

  .header-controls {
    margin-left: auto;
    margin-right: 12px;
  }

  .filter-bar {
    padding: 12px 0 12px 16px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-bar button { flex-shrink: 0; font-size: 0.8125rem; }

  .related-grid { grid-template-columns: 1fr; }
  .arch-steps { grid-template-columns: 1fr; }

  footer { flex-direction: column; gap: 10px; text-align: center; }
  .footer-right { flex-direction: column; gap: 6px; }
}
