/* Le Petit Ramoneur Basque — shared styles */

:root {
  /* Palette — warm artisan, anchored to fire + tuile + basque green */
  --ink: #1a1613;
  --ink-soft: #3a332d;
  --paper: #f4ecdf;
  --paper-deep: #ece2cf;
  --paper-warm: #f8f2e6;
  --ember: #b83a1f;
  --ember-deep: #8a2512;
  --tuile: #d97a4f;
  --basque-green: #3a6e5a;
  --basque-green-deep: #254a3c;
  --rule: #cdbfa3;
  --rule-soft: rgba(26, 22, 19, 0.12);

  /* Motif intensity — driven by Tweaks slider (0 -> 1.2) */
  --motif: 1;

  /* Type stacks (customizable via Tweaks) */
  --ff-display: "Newsreader", "Source Serif 4", Georgia, serif;
  --ff-sans: "Instrument Sans", "Inter", system-ui, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Radii + shadows */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  /* Subtle paper grain */
  background-image:
    radial-gradient(rgba(26, 22, 19, 0.025) 1px, transparent 1px),
    radial-gradient(rgba(26, 22, 19, 0.02) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 1px;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

h1 { font-size: clamp(44px, 6.2vw, 88px); line-height: 0.98; letter-spacing: -0.025em; font-weight: 440; }
h2 { font-size: clamp(32px, 3.8vw, 56px); line-height: 1.02; letter-spacing: -0.02em; font-weight: 460; }
h3 { font-size: clamp(22px, 2vw, 28px); line-height: 1.15; }
h4 { font-size: 19px; line-height: 1.3; }

p { margin: 0; }
em, i { font-style: italic; }

/* Utility */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 36px;
}
.container-narrow {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 36px;
}

.label {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember-deep);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

.serif-italic { font-family: var(--ff-display); font-style: italic; font-weight: 400; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--ff-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--ember);
  color: var(--paper);
  box-shadow: 0 1px 0 0 var(--ember-deep) inset, 0 8px 20px -10px rgba(184, 58, 31, 0.5);
}
.btn-primary:hover { background: var(--ember-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-light {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--ink);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 236, 223, 0.88);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.site-header .inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 14px 36px;
  max-width: 1440px;
  margin: 0 auto;
}
.logo-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--ff-display);
  font-size: 19px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.logo-mark .mark {
  width: 34px; height: 34px;
  flex: none;
}
.logo-img {
  height: 40px;
  width: auto;
  display: block;
}
@media (max-width: 640px) {
  .logo-img { height: 34px; }
}
.logo-mark span {
  white-space: nowrap;
}
.logo-mark small {
  display: block;
  font-family: var(--ff-mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 3px;
}
.nav-main {
  display: flex;
  gap: 28px;
  justify-content: center;
  font-size: 14.5px;
}
.nav-main a {
  position: relative;
  padding: 4px 0;
  color: var(--ink-soft);
  transition: color 0.15s;
}
.nav-main a:hover, .nav-main a.active { color: var(--ink); }
.nav-main a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--ember);
}
.header-cta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
}
.phone-link svg { width: 14px; height: 14px; }

/* Footer */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 72px 0 32px;
  margin-top: 120px;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("#");
  opacity: calc(0.06 * var(--motif));
  pointer-events: none;
}
.site-footer h4 {
  color: var(--paper);
  font-family: var(--ff-sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 18px;
  color: rgba(244, 236, 223, 0.55);
}
.site-footer .grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 60px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a:hover { color: var(--tuile); }
.site-footer .legal {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(244, 236, 223, 0.12);
  display: flex;
  justify-content: space-between;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(244, 236, 223, 0.5);
}

/* Section shell */
section { padding: 96px 0; position: relative; }
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  align-items: end;
  margin-bottom: 56px;
}
.section-head .left .eyebrow { margin-bottom: 18px; }
.section-head .right { max-width: 560px; color: var(--ink-soft); font-size: 17px; }

/* Cards */
.card {
  background: var(--paper-warm);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-lg);
  padding: 32px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--rule);
  box-shadow: 0 20px 40px -30px rgba(26, 22, 19, 0.3);
}

/* Ribbon (woven stripe motif) */
.ribbon {
  height: calc(18px + 10px * var(--motif));
  background: repeating-linear-gradient(
    90deg,
    var(--ember) 0 14px,
    var(--paper) 14px 22px,
    var(--ink) 22px 30px,
    var(--paper) 30px 38px,
    var(--basque-green) 38px 52px,
    var(--paper) 52px 60px
  );
  opacity: calc(0.35 + 0.65 * var(--motif));
  transition: opacity 0.3s, height 0.3s;
}

/* Placeholder image */
.placeholder {
  background:
    repeating-linear-gradient(135deg,
      rgba(26, 22, 19, 0.04) 0 10px,
      rgba(26, 22, 19, 0.08) 10px 11px);
  background-color: var(--paper-deep);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink-soft);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}
.placeholder span { max-width: 70%; }

/* Lauburu-inspired mark (used as accent) */
.mark-lauburu {
  --c: currentColor;
  width: 28px;
  height: 28px;
}

/* Tweaks panel */
.tweaks-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35);
  min-width: 280px;
  font-family: var(--ff-sans);
  font-size: 13px;
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h5 {
  margin: 0 0 14px 0;
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 236, 223, 0.5);
  font-weight: 500;
}
.tweaks-panel .tw-row { margin-bottom: 16px; }
.tweaks-panel .tw-row:last-child { margin-bottom: 0; }
.tweaks-panel label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: rgba(244, 236, 223, 0.78);
}
.tweaks-panel input[type="range"] {
  width: 100%;
  accent-color: var(--ember);
}
.tweaks-panel .swatches { display: flex; gap: 6px; }
.tweaks-panel .sw {
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.tweaks-panel .sw.active { border-color: var(--paper); }
.tweaks-panel select {
  width: 100%;
  background: #2a2420;
  color: var(--paper);
  border: 1px solid rgba(244, 236, 223, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

/* Chip / badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper-warm);
  border: 1px solid var(--rule-soft);
  font-size: 12.5px;
  color: var(--ink-soft);
}
.badge .dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--basque-green);
}

/* Link arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  transition: gap 0.2s;
}
.link-arrow:hover { gap: 14px; }

.phone-link span { white-space: nowrap; }
.phone-link { white-space: nowrap; flex-shrink: 0; }
.header-cta { flex-shrink: 0; }
.nav-main { white-space: nowrap; }
.nav-main a { white-space: nowrap; }

@media (max-width: 1120px) {
  .nav-main { display: none; }
  .site-header .inner { grid-template-columns: 1fr auto; gap: 16px; }
}
@media (max-width: 640px) {
  .phone-link span { display: none; }
  .header-cta .btn { padding: 10px 16px; }
}

@media (max-width: 900px) {
  section { padding: 64px 0; }
  .section-head { grid-template-columns: 1fr; gap: 20px; }
  .site-footer .grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .container, .container-narrow { padding: 0 22px; }
}
