:root {
  --background: #faf9f7;
  --foreground: #1c1a17;
  --accent: #9a5b32;
  --muted: #6b6560;
  --border: #e4e0da;
  --max: 1152px;
}

* { box-sizing: border-box; }

html { height: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }

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

::selection { background: var(--accent); color: #fff; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.muted { color: var(--muted); }
.accent { color: var(--accent); }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; }

h1, h2, h3 { line-height: 1.2; font-weight: 500; margin: 0; }
h1 { font-size: 36px; letter-spacing: -0.01em; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }

@media (min-width: 640px) {
  h1 { font-size: 48px; }
}

.section { border-bottom: 1px solid var(--border); padding: 80px 0; }
.section:last-of-type { border-bottom: none; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.page-title { padding: 80px 0; }
.page-title p { margin-top: 16px; max-width: 560px; color: var(--muted); }

/* header */
.site-header { border-bottom: 1px solid var(--border); background: var(--background); position: relative; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.logo { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.logo { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.logo-img { align-self: center; height: 50px; width: auto; max-width: none; mix-blend-mode: multiply; }
.tagline { margin-top: -4px; font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--muted); white-space: nowrap; }

.nav { display: none; gap: 24px; font-size: 16px; }
.nav a { color: rgba(28, 26, 23, .8); }
.nav a:hover, .nav a.active { color: var(--accent); }
@media (min-width: 768px) { .nav { display: flex; } }

.menu-toggle {
  width: 36px; height: 36px; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0;
}
.menu-toggle span { display: block; height: 1px; width: 20px; background: var(--foreground); }
@media (min-width: 768px) { .menu-toggle { display: none; } }

.mobile-nav { display: none; border-top: 1px solid var(--border); background: var(--background); }
.mobile-nav.open { display: block; }
@media (min-width: 768px) {
  .site-header .container { display: grid; grid-template-columns: 1fr auto 1fr; }
  .site-header .logo { justify-self: start; min-width: max-content; }
  .site-header .nav { justify-self: center; }
}
.search-toggle { margin-left: auto; margin-right: 12px; background: none; border: none; cursor: pointer; color: var(--foreground); padding: 6px; display: flex; }
@media (min-width: 768px) { .search-toggle { margin-right: 0; } }
.search-toggle:hover { color: var(--accent); }
.search-panel { border-top: 1px solid var(--border); background: var(--background); padding: 12px 0; }
.search-panel .container { display: flex; }
.search-panel input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 2px; background: transparent; font: inherit; color: inherit; }
.search-panel input:focus { outline: none; border-color: var(--accent); }
.mobile-nav a { display: block; padding: 12px 24px; border-bottom: 1px solid var(--border); font-size: 14px; color: rgba(28, 26, 23, .8); }
.mobile-nav a:last-child { border-bottom: none; }
@media (min-width: 768px) { .mobile-nav { display: none !important; } }

/* buttons */
.btn {
  display: inline-block; padding: 12px 24px; font-size: 14px; border-radius: 2px;
  border: 1px solid var(--foreground); background: var(--foreground); color: var(--background); cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-outline { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn-outline:hover { background: transparent; color: var(--accent); border-color: var(--accent); }

/* hero */
.hero { padding: 96px 0; border-bottom: 1px solid var(--border); }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 560px; margin-top: 24px; }
.hero .buttons { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 16px; }

/* services */
.services { display: grid; gap: 32px; margin-top: 40px; }
@media (min-width: 640px) { .services { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .services.three { grid-template-columns: repeat(3, 1fr); } }
.service { border-top: 1px solid var(--border); padding-top: 24px; }
.service h3 { font-weight: 500; }
.service p { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

/* project cards */
.grid-projects { display: grid; gap: 40px; margin-top: 40px; }
@media (min-width: 640px) { .grid-projects { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .grid-projects { grid-template-columns: repeat(3, 1fr); } }
.project-card { display: block; }
.project-card .img { height: 256px; border-radius: 2px; }
.project-card .row { margin-top: 16px; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.project-card h3 { transition: color .2s; }
.project-card:hover h3 { color: var(--accent); }
.project-card .meta { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.tag { font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; color: var(--muted); white-space: nowrap; height: fit-content; }

/* gradients as photo placeholders */
.img { background: linear-gradient(135deg, #d6d2cc, #a8a29a); position: relative; }
.img.alt1 { background: linear-gradient(135deg, #f0dcc4, #a8a29a); }
.img.alt2 { background: linear-gradient(135deg, #a8a29a, #7d766e); }
.img.alt3 { background: linear-gradient(135deg, #e6e2dc, #b8b0a6); }
.img.tall { height: 320px; }
@media (min-width: 640px) { .img.tall { height: 448px; } }
.img .label { position: absolute; left: 12px; bottom: 12px; font-size: 12px; color: #fff; background: rgba(0,0,0,.25); padding: 4px 8px; border-radius: 2px; }

/* filter */
.filters { display: flex; flex-wrap: wrap; gap: 12px; }
.filter-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 6px 16px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 14px;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
[hidden] { display: none !important; }

/* articles list */
.era-heading {
  font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-top: 40px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.era-heading:first-child { margin-top: 0; }
.article-item { display: block; border-bottom: 1px solid var(--border); padding: 32px 0; }
.article-item:first-child { padding-top: 0; }
.era-heading + .article-item { padding-top: 32px; }
.article-item h3 { margin-top: 8px; transition: color .2s; }
.article-item:hover h3 { color: var(--accent); }
.article-item p { margin: 8px 0 0; max-width: 640px; font-size: 14px; color: var(--muted); }
.article-item .more { display: inline-block; margin-top: 12px; font-size: 14px; color: var(--accent); }

/* article & project pages */
.back { font-size: 14px; color: var(--accent); }
.article { padding: 64px 24px 80px; }
.article h1 { margin-top: 8px; max-width: 720px; }
.article .body { margin-top: 40px; max-width: 720px; }
.article-figure { margin: 40px 0 0; max-width: 960px; }
.article-figure img { width: 100%; height: auto; border-radius: 2px; }
.article-figure figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.article .body h2 { font-size: 22px; margin: 48px 0 20px; }
#header { text-align: center; margin: 12px 0; }
.article h1, .article .eyebrow { text-align: center; }
.article h1, .article .eyebrow, .article .body, .article-figure { margin-left: auto; margin-right: auto; }
.article .body p { margin: 0 0 20px; color: rgba(28, 26, 23, .9); }
.project-meta { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 24px 0 0; font-size: 14px; color: var(--muted); }
.project-meta div span { color: var(--foreground); }
.project-hero { margin-top: 40px; height: 320px; border-radius: 2px; overflow: hidden; }
@media (min-width: 640px) { .project-hero { height: 448px; } }
.project-hero img { width: 100%; height: 100%; object-fit: cover; display: block; max-width: none; }
.project-hero.photo { height: auto; }
.project-hero.photo img { height: auto; object-fit: initial; }

.project-card .img img { width: 100%; height: 100%; object-fit: cover; display: block; max-width: none; }
.project-body { margin-top: 40px; max-width: 640px; }
.project-body p { margin: 0 0 20px; color: var(--muted); }
.project-body ul { margin: 0; padding-left: 20px; }
.project-body li { margin-bottom: 20px; color: var(--muted); }
.project-body li:last-child { margin-bottom: 0; }
.project-body li strong { color: var(--foreground); }

.project-gallery { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
@media (min-width: 640px) { .project-gallery { grid-template-columns: 1fr 1fr; } }
.project-gallery .img { height: 220px; border-radius: 2px; }
@media (min-width: 640px) { .project-gallery .img { height: 280px; } }

.project-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 32px; margin-top: 16px; max-width: 420px; font-size: 14px; }
.project-stats dt { color: var(--muted); }
.project-stats dd { margin: 0; color: var(--foreground); }

/* contacts */
.contacts-grid { display: grid; gap: 64px; }
@media (min-width: 1024px) { .contacts-grid { grid-template-columns: 1fr 1fr; } }
.contact-item + .contact-item { margin-top: 24px; }
.contact-item .label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; }
.contact-item .value { font-size: 18px; margin: 4px 0 0; }

form.contact-form { display: grid; gap: 16px; }
form.contact-form label { font-size: 14px; color: var(--muted); display: block; margin-bottom: 4px; }
form.contact-form input,
form.contact-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 2px;
  background: transparent; font: inherit; color: inherit;
}
form.contact-form input:focus,
form.contact-form textarea:focus { outline: none; border-color: var(--accent); }
form.contact-form textarea { min-height: 120px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; top: -9999px; }
.form-status { padding: 10px 12px; border-radius: 2px; font-size: 14px; }
.form-status-ok { background: rgba(154, 91, 50, .1); border: 1px solid rgba(154, 91, 50, .3); color: var(--accent); }
.form-status-error { background: #fdecec; border: 1px solid #f3b4b4; color: #b42318; }

/* footer */
.site-footer { margin-top: auto; border-top: 1px solid var(--border); }
.footer-main { padding: 40px 24px 0; display: flex; flex-direction: column; gap: 32px; }
@media (min-width: 640px) { .footer-main { flex-direction: row; justify-content: space-between; } }
.footer-main p { margin: 4px 0 0; font-size: 14px; color: var(--muted); max-width: 320px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.footer-nav a { color: rgba(28, 26, 23, .8); }
.footer-contacts { font-size: 14px; color: var(--muted); }
.footer-contacts p { margin: 0 0 4px; }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 6px; padding-bottom: 24px; }
.socials a { font-size: 13px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; color: rgba(28, 26, 23, .8); }
.socials a:hover { border-color: var(--accent); color: var(--accent); }
.socials-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.socials-row .informer-link { justify-self: start; min-width: max-content; }
.socials-row .informer-link img { max-width: none; }
.socials-row .socials { justify-self: center; }
.informer-link { border: none; padding: 0; line-height: 0; }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 24px; font-size: 12px; color: var(--muted); }
