:root {
  --bg: #f5f1e8;
  --paper: #ebe4d7;
  --ink: #1d1a17;
  --muted: #6f685f;
  --line: rgba(29, 26, 23, 0.12);
  --accent: #8d7156;
  --dark: #171411;
  --light: #fbf7ef;
  --radius: 22px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.08);
  --section-bg: var(--bg);
  --section-text: var(--ink);
  --section-accent: var(--accent);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.page-colored,
.section-colored {
  background: var(--section-bg);
  color: var(--section-text);
}

.page-colored .muted,
.page-colored .lead,
.page-colored .project-description,
.page-colored .project-materials,
.page-colored .contact-card,
.page-colored .copyright,
.section-colored .muted,
.section-colored .lead,
.section-colored .project-description,
.section-colored .project-materials,
.section-colored .contact-card,
.section-colored .copyright {
  color: color-mix(in srgb, var(--section-text) 60%, white 40%);
}

.page-colored .button.dark,
.section-colored .button.dark {
  background: var(--section-accent);
  border-color: var(--section-accent);
  color: #fff;
}

.page-colored .button.dark:hover,
.section-colored .button.dark:hover {
  filter: brightness(0.92);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font: inherit; }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(18px); background: rgba(245, 241, 232, 0.88); border-bottom: 1px solid var(--line); }
.topbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.9rem; }
.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px; font-size: 0.84rem; text-transform: uppercase; letter-spacing: 0.1em; }
.hero, .internal-hero { position: relative; background-size: cover; background-position: center; min-height: 88vh; display: flex; align-items: center; overflow: hidden; }
.internal-hero { min-height: 52vh; }
.overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.24), rgba(0,0,0,0.56)); }
.hero-content, .internal-hero .container { position: relative; z-index: 1; color: var(--light); }
.hero h1, .internal-hero h1, .site-footer h2 { font-size: clamp(3rem, 8vw, 6.8rem); line-height: 0.96; margin: 0 0 24px; max-width: 9ch; }
.hero-lead { max-width: 48rem; font-size: 1.05rem; color: rgba(251, 247, 239, 0.82); margin: 0 0 24px; }
.hero-slides, .hero-mosaic { position: absolute; inset: 0; }
.hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; animation: heroFade 12s infinite; }
.hero-mosaic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px; }
.hero-mosaic-item img { width: 100%; height: 100%; object-fit: cover; min-height: 220px; }
@keyframes heroFade {
  0%, 20% { opacity: 0; }
  25%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.76rem; color: var(--muted); margin: 0 0 18px; }
.eyebrow.light, .light { color: rgba(251, 247, 239, 0.88); }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 14px 22px; border-radius: 999px; border: 1px solid currentColor; transition: 0.25s ease; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.button.light:hover { background: var(--light); color: var(--dark); }
.button.dark { background: var(--dark); color: var(--light); border-color: var(--dark); }
.button.dark:hover { background: var(--accent); border-color: var(--accent); }
.section { padding: 96px 0; }
.alt-section { background: linear-gradient(180deg, var(--paper), #efe8db); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 42px; }
.section-head h2, .contact-grid h2, .about-grid h2 { font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.02; margin: 0; }
.section-head.centered { text-align: center; display: block; }
.muted, .lead, .project-description, .project-materials, .contact-card, .copyright { color: var(--muted); }
.project-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 28px; }
.project-card { background: rgba(255, 255, 255, 0.52); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.span-wide { grid-column: span 7; }
.span-narrow { grid-column: span 5; }
.span-square { grid-column: span 6; }
.project-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.project-link { display: block; }
.project-meta { display: flex; justify-content: space-between; gap: 16px; padding: 22px 24px 8px; }
.project-meta h3, .list-card h3 { margin: 0; font-size: 1.45rem; }
.project-meta p { margin: 6px 0 0; color: var(--muted); }
.project-description, .project-materials { padding: 0 24px 18px; margin: 0; }
.project-materials { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 6px; }
.about-grid, .contact-grid, .footer-grid, .split-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; }
.about-grid img { width: 100%; border-radius: var(--radius); min-height: 520px; object-fit: cover; box-shadow: var(--shadow); }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 28px; }
.stat { padding: 18px; background: rgba(255,255,255,0.55); border: 1px solid var(--line); border-radius: 18px; }
.stat strong { display: block; font-size: 2rem; margin-bottom: 6px; }
.list-cards, .testimonials-grid { display: grid; gap: 16px; }
.list-card, .testimonial-card { display: grid; grid-template-columns: 90px 1fr; gap: 18px; padding: 24px; border-top: 1px solid var(--line); }
.testimonial-band { background: var(--dark); color: var(--light); padding: 96px 0; }
.testimonial-card { grid-template-columns: 1fr; border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius); background: rgba(255,255,255,0.03); }
.testimonial-card p { font-size: 1.25rem; margin: 0 0 20px; }
.contact-card, .contact-form, .panel, .metric-card { background: rgba(255,255,255,0.62); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-card { padding: 22px; }
.contact-form, .panel { padding: 28px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack-form { display: grid; gap: 16px; }
label { display: grid; gap: 8px; font-size: 0.95rem; }
input, textarea, select { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.75); }
input[type="file"] { padding: 10px; background: rgba(255,255,255,0.4); }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.site-footer { background: var(--dark); color: var(--light); padding: 88px 0 56px; }
.footer-grid { align-items: end; }
.footer-mail { font-size: 1.5rem; }
.social-list { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 8px; }
.content-page .wysiwyg { max-width: 760px; font-size: 1.1rem; }
.content-page.template-split .wysiwyg, .page-template-split { columns: 2; column-gap: 36px; max-width: none; }
.content-page.template-editorial .wysiwyg, .page-template-editorial { max-width: 920px; font-size: 1.18rem; }
.project-detail-head { display: flex; justify-content: space-between; gap: 24px; align-items: start; margin-bottom: 30px; }
.project-detail-head h2 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin: 0; line-height: 1.02; }
.project-facts { display: grid; gap: 10px; color: var(--muted); max-width: 340px; }
.project-story { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; align-items: start; }
.project-story.template-editorial { grid-template-columns: 0.85fr 1.15fr; }
.project-story.template-gallery { grid-template-columns: 1fr; }
.project-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.project-gallery.mode-mosaic { grid-template-columns: repeat(3, 1fr); }
.project-gallery figure { margin: 0; }
.project-gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; min-height: 260px; box-shadow: var(--shadow); }
.about-template-spotlight .about-grid, .contact-template-card .contact-grid { grid-template-columns: 1fr; }
.services-template-grid .list-cards { grid-template-columns: repeat(2, 1fr); }
.testimonials-template-spotlight .testimonials-grid { grid-template-columns: 1fr; }
.testimonials-template-spotlight .testimonial-card:first-child { padding: 38px; }
.admin-body { background: linear-gradient(180deg, #ece3d4, #f7f2ea); min-height: 100vh; }
.installer-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.panel.wide { width: min(980px, 100%); }
.auth-panel { width: min(460px, 100%); }
.admin-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { background: #171411; color: var(--light); padding: 28px; }
.sidebar-nav { display: grid; gap: 12px; margin-top: 28px; }
.sidebar-nav a { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.04); }
.admin-main { padding: 26px; }
.admin-header, .admin-cards { display: grid; gap: 18px; }
.admin-header { grid-template-columns: 1fr auto; align-items: end; margin-bottom: 20px; }
.admin-cards { grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
.metric-card { padding: 22px; }
.metric-card strong { display: block; font-size: 2.6rem; }
.admin-user { color: var(--muted); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.actions button, .actions a { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.flash { padding: 14px 16px; border-radius: 16px; margin-bottom: 16px; }
.flash.success { background: rgba(76, 143, 82, 0.12); border: 1px solid rgba(76, 143, 82, 0.24); }
.flash.error { background: rgba(164, 68, 52, 0.12); border: 1px solid rgba(164, 68, 52, 0.24); }
.checkbox { display: flex; align-items: center; gap: 10px; }
.checkbox input { width: auto; }
@media (max-width: 960px) {
  .project-grid, .about-grid, .contact-grid, .footer-grid, .split-panel, .admin-shell, .grid-2, .grid-3, .admin-cards, .list-card { grid-template-columns: 1fr; }
  .project-story, .project-gallery, .hero-mosaic, .services-template-grid .list-cards { grid-template-columns: 1fr; }
  .content-page.template-split .wysiwyg, .page-template-split { columns: 1; }
  .span-wide, .span-narrow, .span-square { grid-column: span 12; }
  .site-header { position: static; }
  .topbar, .section-head, .form-row, .admin-header, .project-detail-head { display: grid; gap: 16px; }
  .sidebar { padding-bottom: 8px; }
}
