
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-soft: #efebe4;
  --ink: #111111;
  --muted: #68615a;
  --border: rgba(17, 17, 17, 0.12);
  --dark: #111111;
  --light: #ffffff;
  --accent: #c7462f;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(17, 17, 17, 0.13);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--light);
  padding: .75rem 1rem;
  border-radius: 999px;
}
.skip-link:focus { top: 1rem; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(246, 244, 239, 0.86);
  border-bottom: 1px solid var(--border);
}
.nav-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.brand img { width: 42px; height: 42px; object-fit: contain; border-radius: 50%; }
.site-nav {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.site-nav a {
  text-decoration: none;
  padding: .65rem .9rem;
  border-radius: 999px;
  font-size: .95rem;
  color: var(--muted);
  transition: color .2s ease, background .2s ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--ink);
  background: rgba(17,17,17,.08);
}
.menu-toggle { display: none; }
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) 1.25rem 3rem;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.hero.compact { grid-template-columns: 1fr; max-width: 900px; text-align: center; }
.eyebrow {
  margin: 0 0 .85rem;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.05; margin: 0; letter-spacing: -.045em; }
h1 { font-size: clamp(2.8rem, 8vw, 6.9rem); }
h2 { font-size: clamp(2rem, 5vw, 4rem); }
h3 { font-size: clamp(1.35rem, 3vw, 2.2rem); }
.lede { font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--muted); max-width: 720px; }
.hero.compact .lede { margin-left: auto; margin-right: auto; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.hero.compact .actions { justify-content: center; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .8rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--light);
  font-weight: 750;
}
.button.secondary { background: transparent; color: var(--ink); }
.hero-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface-soft);
}
.hero-media img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.logo-hero { max-width: 360px; margin: 0 auto; padding: 2rem; background: #fff; }
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.75rem 1.25rem;
}
.section-header { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 1.6rem; }
.section-header p { color: var(--muted); max-width: 520px; margin: .65rem 0 0; }
.project-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .85rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(17,17,17,.08);
}
.project-card {
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease;
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.project-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  background: #fff;
  padding: .65rem;
}
.card-body { padding: .95rem; }
.card-body h3 { font-size: 1.08rem; letter-spacing: -.025em; }
.card-body p { color: var(--muted); margin: .4rem 0 0; font-size: .88rem; }
.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.case-card { padding: 1.4rem; }
.case-card img, .gallery-item img { border-radius: calc(var(--radius) - 8px); margin-bottom: 1rem; width: 100%; object-fit: cover; }
.case-card img { aspect-ratio: 16/10; }
.case-card p { color: var(--muted); }
.link-list { display: flex; flex-wrap: wrap; gap: .55rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.link-list a {
  display: inline-flex;
  padding: .45rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.gallery.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery-item { background: var(--surface); padding: .65rem; border: 1px solid var(--border); border-radius: var(--radius); }
.gallery-item img { margin: 0; aspect-ratio: 4/3; }
.gallery-item.portrait img { aspect-ratio: 3/4; }
.gallery-item.contain img { object-fit: contain; background: #fff; }
.gallery-item.cover img { object-fit: cover; }
.about-panel {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 2rem;
  align-items: start;
  background: var(--dark);
  color: var(--light);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 3rem);
}
.about-panel p { color: rgba(255,255,255,.78); }
.about-panel img { border-radius: var(--radius); box-shadow: var(--shadow); }
.cv-frame { background: var(--surface); padding: 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.cv-frame img { border-radius: 14px; margin: 0 auto; }
.site-footer {
  margin-top: 4rem;
  background: var(--dark);
  color: var(--light);
}
.footer-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.footer-wrap a { color: var(--light); }
.small { font-size: .92rem; color: var(--muted); }
.dark-page { background: #111; color: #fff; }
.dark-page .site-header { background: rgba(17,17,17,.85); border-color: rgba(255,255,255,.13); }
.dark-page .site-nav a { color: rgba(255,255,255,.72); }
.dark-page .site-nav a:hover, .dark-page .site-nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.1); }
.dark-page .brand { color: #fff; }
.dark-page .lede, .dark-page .section-header p, .dark-page .case-card p, .dark-page .card-body p { color: rgba(255,255,255,.72); }
.dark-page .card, .dark-page .case-card, .dark-page .gallery-item, .dark-page .cv-frame { background: #1b1b1b; border-color: rgba(255,255,255,.12); }
.dark-page .button.secondary { color: #fff; border-color: #fff; }
@media (max-width: 920px) {
  .hero, .about-panel { grid-template-columns: 1fr; }
  .project-grid, .gallery { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .case-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .menu-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: inherit;
  }
  .menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    position: relative;
    content: "";
  }
  .menu-toggle span::before { position: absolute; top: -6px; }
  .menu-toggle span::after { position: absolute; top: 6px; }
  .site-nav {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: .75rem;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .dark-page .site-nav { background: #1b1b1b; }
  .site-nav[data-open="true"] { display: flex; }
  .site-nav a { text-align: center; }
  .project-grid, .gallery, .gallery.two { grid-template-columns: 1fr; }
  .section-header { display: block; }
  .footer-wrap { display: block; }
}

/* Revised text-only page intros */
.hero {
  display: block;
  max-width: 980px;
  text-align: center;
  padding: clamp(3rem, 7vw, 5.5rem) 1.25rem 2.25rem;
}
.hero.compact {
  max-width: 980px;
  text-align: center;
}
.hero.compact h1 {
  font-size: clamp(2.45rem, 6vw, 5.1rem);
}
.hero .lede {
  margin-left: auto;
  margin-right: auto;
}
.hero .actions {
  justify-content: center;
}

/* Click-to-enlarge image viewer */
.expandable-image {
  cursor: zoom-in;
  transition: transform .2s ease, filter .2s ease;
}
.expandable-image:hover,
.expandable-image:focus-visible {
  transform: scale(1.015);
  filter: brightness(.96);
  outline: 3px solid rgba(199,70,47,.35);
  outline-offset: 3px;
}
body.lightbox-open {
  overflow: hidden;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(0, 0, 0, .88);
}
.lightbox[aria-hidden="false"] {
  display: flex;
}
.lightbox img {
  max-width: min(1200px, 94vw);
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  background: #fff;
}
.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 201;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: rgba(255,255,255,.22);
  outline: 3px solid rgba(255,255,255,.35);
}


/* Optimal case-study page */
.optimal-case-grid {
  align-items: start;
}
.optimal-case-card img {
  aspect-ratio: auto;
  max-height: none;
  object-fit: contain;
  background: #fff;
}
.optimal-wide-card {
  grid-column: 1 / -1;
}
.optimal-wide-card img {
  width: 100%;
}
@media (min-width: 921px) {
  .optimal-case-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .optimal-case-card:first-child {
    grid-column: 1 / -1;
  }
}


/* Home page project cards */
#projects.section { max-width: 1680px; }

@media (max-width: 1180px) {
  .project-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 920px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .project-grid { grid-template-columns: 1fr; }
}
