/* ============================================================
   Mesambria Books — v2 Redesign
   Editorial minimal · Playfair Display + Inter
   ============================================================ */

/* --- Reset & Base --- */
:root {
  --black: #1a1a1a;
  --ink: #2c2c2c;
  --body: #4a4a4a;
  --muted: #888888;
  --rule: #e0e0e0;
  --sand: #f7f5f2;
  --white: #ffffff;
  --max-w: 920px;
  --header-h: 72px;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

::selection {
  background: var(--black);
  color: var(--white);
}

/* --- Container --- */
.container {
  width: min(100% - 3rem, var(--max-w));
  margin-inline: auto;
}
@media (min-width: 1024px) {
  .header-inner {
    width: min(100% - 4rem, 1100px);
    margin-inline: auto;
  }
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  transition: box-shadow .3s var(--ease);
}
.site-header.scrolled {
  box-shadow: 0 1px 12px rgba(0,0,0,.06);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}
.brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}
.brand-text {
  font-family: var(--serif);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--black);
  text-transform: uppercase;
}

/* Desktop nav */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}
.desktop-nav a {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .2s var(--ease);
  position: relative;
}
.desktop-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--black);
  transition: width .3s var(--ease);
}
.desktop-nav a:hover { color: var(--black); }
.desktop-nav a:hover::after { width: 100%; }

.desktop-lang {
  display: flex;
  gap: .5rem;
  font-size: .75rem;
  letter-spacing: .1em;
  margin-left: .75rem;
  padding-left: .75rem;
  border-left: 1px solid var(--rule);
}
.desktop-lang a { color: var(--muted); transition: color .2s; }
.desktop-lang a.is-active { color: var(--black); font-weight: 600; }
.desktop-lang a:hover { color: var(--black); }

/* Hamburger */
.menu-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 201;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--black);
  border-radius: 1px;
  transition: all .3s var(--ease);
}
.menu-toggle span { position: relative; }
.menu-toggle span::before,
.menu-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
}
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after  { top: 6px; }

.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before {
  top: 0;
  transform: rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* --- Mobile nav overlay --- */
.nav-wrap {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--white);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 2rem 2rem;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .35s var(--ease), visibility 0s .35s;
  box-shadow: -8px 0 40px rgba(0,0,0,.08);
}
.nav-wrap.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .35s var(--ease), visibility 0s 0s;
}

.nav-close {
  align-self: flex-end;
  background: none;
  border: 0;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  padding: .25rem;
  line-height: 1;
  margin-bottom: 2rem;
  transition: color .2s;
}
.nav-close:hover { color: var(--black); }

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mobile-nav a {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
  padding: .85rem 0;
  border-bottom: 1px solid var(--rule);
  transition: color .2s, padding-left .2s;
}
.mobile-nav a:first-child { border-top: 1px solid var(--rule); }
.mobile-nav a:hover,
.mobile-nav a:active { color: var(--black); padding-left: .5rem; }

.mobile-lang {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  gap: .75rem;
  font-size: .8rem;
  letter-spacing: .12em;
}
.mobile-lang a { color: var(--muted); transition: color .2s; }
.mobile-lang a.is-active { color: var(--black); font-weight: 600; }

/* Backdrop */
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.2);
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease), visibility 0s .35s;
  -webkit-tap-highlight-color: transparent;
}
.menu-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity .35s var(--ease), visibility 0s 0s;
}

/* --- Hero --- */
.hero {
  padding: clamp(5rem, 14vw, 10rem) 0 clamp(4rem, 10vw, 7rem);
  text-align: center;
}
.hero-logo {
  width: clamp(60px, 10vw, 90px);
  height: auto;
  margin: 0 auto 2.5rem;
  opacity: .85;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 600;
  color: var(--black);
  line-height: 1.15;
  letter-spacing: -.01em;
}
.hero-sub {
  margin-top: 1.25rem;
  font-size: clamp(.95rem, 2vw, 1.1rem);
  color: var(--muted);
  max-width: 52ch;
  margin-inline: auto;
  line-height: 1.65;
}
.hero-rule {
  width: 40px;
  height: 1px;
  background: var(--rule);
  margin: 2.5rem auto 0;
  border: 0;
}

/* --- Sections --- */
.section {
  padding: clamp(3.5rem, 9vw, 6rem) 0;
  scroll-margin-top: calc(var(--header-h) + 2rem);
}
.section + .section {
  border-top: 1px solid var(--rule);
}

.section-header {
  margin-bottom: 1.5rem;
}
.section-label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .5rem;
}
.section-header h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 600;
  color: var(--black);
  line-height: 1.2;
  letter-spacing: -.01em;
}

.section-body {
  max-width: 62ch;
  font-size: clamp(.93rem, 1.8vw, 1rem);
  line-height: 1.75;
}

/* Section note (coming soon placeholders) */
.section-note {
  font-size: .92rem;
  color: var(--muted);
  font-style: italic;
}

/* --- Contacts --- */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: .5rem;
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.contact-label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-value {
  font-size: 1rem;
  color: var(--ink);
}
.contact-value a {
  transition: color .2s;
}
.contact-value a:hover {
  color: var(--black);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 2.5rem;
  text-align: center;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.footer-brand {
  font-family: var(--serif);
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--black);
}
.footer-copy {
  font-size: .8rem;
  color: var(--muted);
}
.footer-company {
  font-size: .78rem;
  color: var(--muted);
}
.footer-location {
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .04em;
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Desktop breakpoint --- */
@media (min-width: 1024px) {
  .menu-toggle { display: none; }
  .desktop-nav { display: flex; }

  .nav-wrap,
  .menu-backdrop,
  .nav-close { display: none !important; }

  .contacts-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}
