/* =========================================
   JastaBrick — Stylesheet
   ========================================= */

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

:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --muted-2: #9a9a96;
  --line: #e6e4df;
  --line-strong: #1a1a1a;
  --hover: #efedea;
  --radius: 4px;
  --max-w: 1400px;
  --pad-x: clamp(20px, 4vw, 32px);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* --- Typography --- */
.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.serif {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* --- Layout helpers --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* --- Site Header --- */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(247, 246, 243, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}

.site-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo svg {
  display: block;
  flex-shrink: 0;
}

.logo__text {
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  transition: opacity var(--transition);
  position: relative;
  padding: 4px 0;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ink);
  opacity: 0;
  transition: opacity var(--transition);
}

.nav a:hover { opacity: 0.6; }
.nav a.is-active::after { opacity: 1; }

@media (max-width: 540px) {
  .nav { gap: 18px; }
  .nav a { font-size: 13px; }
  .logo__text { font-size: 15px; }
}

/* --- Site Footer --- */
.site-footer {
  padding: 56px var(--pad-x) 32px;
  margin-top: 96px;
  background: var(--bg);
}

.site-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}

@media (min-width: 720px) {
  .site-footer__inner {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
  }
}

.site-footer h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 16px;
}

.site-footer a {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--ink);
  transition: opacity var(--transition);
}

.site-footer a:hover { opacity: 0.5; }

.site-footer__about p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 420px;
}

.site-footer__bottom {
  max-width: var(--max-w);
  margin: 36px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.site-footer__bottom-links {
  display: flex;
  gap: 24px;
}

.site-footer__bottom-links a {
  display: inline;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

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

/* --- Homepage: Intro --- */
.intro {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 72px var(--pad-x) 56px;
}

.intro__tag {
  margin-bottom: 18px;
}

.intro__title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  max-width: 760px;
}

.intro__title em {
  font-style: italic;
  color: var(--muted);
}

.intro__meta {
  margin-top: 28px;
  font-size: 15px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.65;
}

/* --- Homepage: Work grid --- */
.work {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px var(--pad-x) 80px;
}

/* Extra top padding when work is at the very top (no intro above) */
.work--top {
  padding-top: 24px;
}

.work__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
  flex-wrap: wrap;
}

.work__title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.work__count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 620px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}

@media (min-width: 1024px) {
  .grid { grid-template-columns: 1fr 1fr 1fr; gap: 28px 24px; }
}

.project-card {
  display: block;
  color: var(--ink);
  cursor: pointer;
  transition: opacity var(--transition);
}

.project-card__image-wrap {
  aspect-ratio: 1 / 1;
  background: var(--hover);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.project-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.project-card__meta {
  margin-top: 14px;
  padding: 0 2px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.project-card__title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.project-card__year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.project-card__subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  padding: 0 2px;
}

/* --- Project Detail Page --- */
.project-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px var(--pad-x) 80px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 64px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 48px;
  transition: color var(--transition);
}

.back-link:hover { color: var(--ink); }

.back-link svg {
  width: 12px;
  height: 12px;
  transition: transform var(--transition);
}

.back-link:hover svg { transform: translateX(-3px); }

.project-hero {
  margin-bottom: 48px;
}

.project-hero__meta {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.project-hero__meta span + span::before {
  content: '·';
  margin-right: 14px;
}

.project-hero__title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.0;
  letter-spacing: -0.015em;
  margin-bottom: 0;
}

.project-hero__image {
  margin-top: 40px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--hover);
}

.project-hero__image img {
  width: 100%;
  height: auto;
}

.project-description {
  max-width: 640px;
  margin: 56px auto;
  padding: 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}

.project-description p {
  margin-bottom: 1em;
}

.project-description p:last-child { margin-bottom: 0; }

.project-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 56px;
}

@media (min-width: 700px) {
  .project-gallery.cols-2 { grid-template-columns: 1fr 1fr; }
}

.project-gallery__image {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--hover);
}

.project-gallery__image img { width: 100%; height: auto; display: block; }

.project-video {
  margin-top: 56px;
  aspect-ratio: 16 / 9;
  background: var(--hover);
  border-radius: var(--radius);
  overflow: hidden;
}

.project-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Text Pages (About, Contact, Privacy) --- */
.text-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px var(--pad-x) 80px;
}

.text-page__eyebrow {
  margin-bottom: 16px;
}

.text-page__title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 48px;
}

.text-page__title em {
  font-style: italic;
  color: var(--muted);
}

.text-page h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 24px;
  margin: 40px 0 16px;
  letter-spacing: -0.01em;
}

.text-page h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 32px 0 12px;
}

.text-page p {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 1em;
  color: var(--ink);
}

.text-page a {
  border-bottom: 1px solid var(--ink);
  transition: opacity var(--transition);
}

.text-page a:hover { opacity: 0.6; }

.text-page ul, .text-page ol {
  margin: 0 0 1em 1.5em;
  font-size: 16px;
  line-height: 1.7;
}

.text-page li { margin-bottom: 0.5em; }

.text-page hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 48px 0;
}

/* --- 404 / Not Found --- */
.not-found {
  max-width: 560px;
  margin: 0 auto;
  padding: 120px var(--pad-x);
  text-align: center;
}

.not-found__code {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 120px;
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 16px;
}

.not-found__title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 12px;
}

.not-found__meta {
  color: var(--muted);
  margin-bottom: 32px;
  font-size: 15px;
}

.not-found__link {
  display: inline-block;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  font-size: 14px;
}

/* --- Loading state --- */
.loading {
  text-align: center;
  padding: 120px var(--pad-x);
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

/* --- Reveal on load animation --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0, 0.2, 1) backwards;
}

.grid .project-card:nth-child(1) { animation-delay: 0.05s; }
.grid .project-card:nth-child(2) { animation-delay: 0.10s; }
.grid .project-card:nth-child(3) { animation-delay: 0.15s; }
.grid .project-card:nth-child(4) { animation-delay: 0.20s; }
.grid .project-card:nth-child(5) { animation-delay: 0.25s; }
.grid .project-card:nth-child(6) { animation-delay: 0.30s; }
.grid .project-card:nth-child(n+7) { animation-delay: 0.35s; }

/* --- Print styles --- */
@media print {
  .site-header, .site-footer, .back-link { display: none; }
}

/* --- Social icons in header --- */
.nav-social {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-left: auto;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.nav-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--ink);
  transition: opacity 0.2s;
}

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

.nav-social svg {
  width: 100%;
  height: 100%;
}

/* --- Navigation Base --- */
.nav--desktop {
  display: none;
}

.nav--mobile {
  display: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  gap: 5px;
  margin-left: auto;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition: all 0.3s;
}

.hamburger.is-open span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-open span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.nav-social--mobile {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  gap: 20px;
  margin-top: 24px;
}

.nav-social--mobile a {
  width: 28px;
  height: 28px;
}

/* --- MOBILE (default) --- */
@media (max-width: 767px) {
  .nav--desktop {
    display: none !important;
  }

  .hamburger {
    display: flex !important;
  }

  .nav--mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
    flex-direction: column;
    padding: 32px var(--pad-x);
    gap: 24px;
    z-index: 999;
  }

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

  .nav--mobile a {
    display: block;
    padding: 8px 0;
    color: var(--ink);
    text-decoration: none;
    font-size: 16px;
  }

  .nav--mobile a.is-active {
    opacity: 0.6;
  }

  .site-header__inner {
    gap: 16px;
  }
}

/* --- DESKTOP (768px+) --- */
@media (min-width: 768px) {
  .nav--desktop {
    display: flex !important;
  }

  .hamburger {
    display: none !important;
  }

  .nav--mobile {
    display: none !important;
  }

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

  .nav a {
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.2s;
  }

  .nav a:hover {
    opacity: 0.6;
  }

  .nav a.is-active {
    border-bottom: 1px solid var(--ink);
    padding-bottom: 2px;
  }
}

/* --- Social Icons --- */
.nav-social {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-left: auto;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.nav-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--ink);
  transition: opacity 0.2s;
}

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

.nav-social svg {
  width: 100%;
  height: 100%;
}