/* =========================================================
   FERELLA INTERIORS — shared site stylesheet
   Quiet Luxury · Curated Design

   Composes ONLY design-system tokens (www/design-system/tokens/*.css —
   fonts, colors, type, spacing, effects). No raw hex/rgb() here: every
   color is a var(--token). Page-specific styles live in css/<page>.css.
   ========================================================= */

/* ---------- Base ---------- */

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ---------- Typography ---------- */

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Headline directly following an eyebrow inside a stacked block.
   (Adjacent-combinator so it outranks page rules like `.big-cta h2`.) */
.eyebrow + .after-eyebrow { margin-top: 18px; }

h1.section-title,
h2.section-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0;
}

p { margin: 0 0 1.1em; }
p.lead {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.45;
  color: var(--ink);
  letter-spacing: 0.005em;
}

.body-text {
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.75;
}

/* ---------- Layout ---------- */

.shell { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad-x); }

main { flex: 1 0 auto; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 48px;
  padding: 18px var(--pad-x);
  max-width: var(--max);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-self: start;
  padding-right: 32px;
}
.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: grayscale(20%);
  mix-blend-mode: multiply;
}
.brand .wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.22em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
.brand .tagline {
  display: block;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 6px;
}

.nav {
  justify-self: center;
  display: flex;
  gap: 38px;
}
.nav a {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 8px 0;
  position: relative;
  transition: color .25s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .35s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--ink); }

/* 1200–1380px: the last band with the inline nav — tighten brand + gaps so
   the six items + DE|EN stay inside the gutter (measured: with the 38px gap
   the nav pokes into the right padding up to ~1375px). The .nav rule must
   come AFTER the base .nav rule to win the cascade (in the export it sat
   before it and never applied). */
@media (max-width: 1380px) {
  .brand .wordmark { font-size: 18px; letter-spacing: 0.18em; }
  .nav { gap: 26px; }
}
@media (max-width: 1024px) {
  .brand .wordmark { font-size: 16px; letter-spacing: 0.14em; }
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: 0;
  width: 36px;
  height: 36px;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.menu-toggle span {
  display: block;
  height: 1px;
  background: var(--ink);
  margin: 6px auto;
  width: 22px;
  transition: transform .3s ease, opacity .3s ease;
}

/* Below 1200px the six nav items + DE|EN no longer fit next to the brand
   (they overflowed the viewport between ~900 and 1200px), so the hamburger
   drawer takes over from here. Brand shrinking stays a phone-only concern. */
@media (max-width: 1200px) {
  .nav { display: none; }
  /* Toggle is pinned to the first row so it stays beside the brand while the
     drawer is open (before, it dropped beneath the links). */
  .menu-toggle { display: block; justify-self: end; grid-column: 2; grid-row: 1; }
  .site-header__inner { grid-template-columns: 1fr auto; }
  .nav.is-open {
    display: flex;
    flex-direction: column;
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 18px;
    padding: 24px 0 8px;
    border-top: 1px solid var(--line-soft);
    margin-top: 12px;
  }
}
@media (max-width: 900px) {
  .brand .tagline { display: none; }
  .brand img { width: 44px; height: 44px; }
  .brand .wordmark { font-size: 16px; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: transparent; color: var(--ink); }
.btn .arrow { transition: transform .3s ease; }
.btn:hover .arrow { transform: translateX(4px); }
/* Outline button on a dark (.section--deep) surface. */
.btn--on-deep,
.btn--on-deep:hover { border-color: var(--on-deep-soft); color: var(--on-deep); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg-deep);
  color: var(--on-deep-muted);
  padding: 88px var(--pad-x) 32px;
  margin-top: 120px;
}
.site-footer .grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1.5fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line-on-deep);
}
.site-footer h4 {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--on-deep-label);
  margin: 0 0 18px;
  font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer ul.footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 32px;
}
.site-footer a { color: var(--on-deep-muted); transition: color .25s; }
.site-footer a:hover { color: var(--on-deep-white); }
.site-footer .word {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: 0.18em;
  color: var(--on-deep);
  margin: 0 0 10px;
}
.site-footer .small {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--on-deep-mute);
}
.site-footer .legal {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 12px;
  color: var(--on-deep-faint);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}
.site-footer .legal a { color: var(--on-deep-mute); }

@media (max-width: 900px) {
  .site-footer .grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .site-footer ul.footer-nav { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-footer .grid { grid-template-columns: 1fr; }
  .site-footer .legal { flex-direction: column; gap: 8px; }
}

/* ---------- Image utility ---------- */

.image-frame {
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.image-frame:hover img { transform: scale(1.04); }

/* ---------- Section spacing ---------- */

.section { padding: var(--section-y) 0; }
.section--tight { padding: var(--section-y-tight) 0; }
.section--alt { background: var(--bg-alt); }
.section--deep { background: var(--bg-deep); color: var(--on-deep-soft); }
.section--deep .eyebrow { color: var(--on-deep-mute); }
.section--deep .body-text { color: var(--on-deep-body); }
.section--deep h1,
.section--deep h2 { color: var(--on-deep); }

/* Centered closing call-to-action on a dark band (About, Kooperationen). */
.deep-cta { text-align: center; }
.deep-cta__text {
  color: var(--on-deep-body);
  max-width: 50ch;
  margin: 24px auto 36px;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(24px, 4vw, 80px);
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 72px);
}
@media (max-width: 800px) {
  .section-head { grid-template-columns: 1fr; }
}

/* ---------- Forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-size: 10.5px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ink-mute);
}
.field input, .field select, .field textarea {
  font: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  color: var(--ink);
  font-size: 16px;
  outline: none;
  transition: border-color .25s;
  border-radius: 0;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
/* Project-type dropdown: more discreet — no border */
.field select#type {
  border-bottom-color: transparent;
  color: var(--ink-mute);
  padding-left: 0;
}
.field select#type:focus { border-bottom-color: transparent; }
.field textarea { resize: vertical; min-height: 120px; font-family: var(--sans); }

/* ---------- Misc ---------- */

::selection { background: var(--ink); color: var(--bg); }

.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s ease, transform 1s ease;
}
.fade-in.is-visible { opacity: 1; transform: none; }


/* =========================================================
   Language switcher (DE | EN) — typographic, no chrome
   ========================================================= */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: var(--tracking-mid);
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
}
.lang-switch__btn {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  opacity: 0.5;
  transition: opacity .18s ease;
}
.lang-switch__btn:hover,
.lang-switch__btn:focus-visible { opacity: 1; outline: none; }
.lang-switch__btn.is-active {
  opacity: 1;
  cursor: default;
  color: var(--accent);
}
.lang-switch__sep {
  opacity: 0.35;
  font-weight: 300;
  user-select: none;
}

/* In the header — sit just after the last nav item, baseline-aligned. */
.site-header .lang-switch--header { margin-left: 18px; padding-left: 18px; border-left: 1px solid var(--line-soft); }

/* Inside the nav drawer (below 1200px), push to its own row beneath the links. */
@media (max-width: 1200px) {
  .site-header .lang-switch--header {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    margin-top: 14px;
  }
}

/* In the footer legal row — same line as Impressum / Datenschutzerklärung. */
.site-footer .legal__links {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.site-footer .legal__links .lang-switch--footer {
  margin-left: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--line-soft);
  color: var(--ink-soft);
}
.site-footer .legal__links .lang-switch--footer .lang-switch__btn.is-active { color: var(--bg); }
@media (max-width: 700px) {
  .site-footer .legal { flex-direction: column; gap: 12px; align-items: center; text-align: center; }
  .site-footer .legal__links { flex-wrap: wrap; justify-content: center; }
  .site-footer .legal__links .lang-switch--footer {
    margin-left: 0; padding-left: 0; border-left: 0; flex-basis: 100%; justify-content: center;
  }
}
