/* =========================================================
   Me Daniela Manguay – Avocate à Fribourg
   ========================================================= */

/* ---------- Base ---------- */
:root {
  --navy: #0C1F3C;
  --blue: #1F3A5F;
  --gold: #E2B84A;
  --cream: #FAF6ED;
  --ink: #111827;
  --text: #3b4557;
  --muted: #4a5568;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px));
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 17px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

p {
  margin: 0 0 1em;
}

h1,
h2,
h3 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin: 0;
}

h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  margin-bottom: 20px;
}

h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  background: var(--gold);
  margin-top: 14px;
  transform-origin: left;
  transition: transform .9s .25s ease;
}

section {
  padding: clamp(64px, 9vw, 110px) 0;
}

.lede {
  max-width: 620px;
  color: var(--text);
}

.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font: 600 1rem var(--font);
  text-decoration: none;
  padding: 14px 28px;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: background .25s, transform .25s, box-shadow .25s;
}

.btn:hover {
  background: #f0cb6a;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(12, 31, 60, .25);
}

/* ---------- Bandeau compact (sticky) ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(12, 31, 60, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 184, 74, .55);
  box-shadow: 0 6px 24px rgba(12, 31, 60, .18);
  transform: translateY(-105%);
  visibility: hidden;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), visibility 0s .5s;
}

.topbar.show {
  transform: none;
  visibility: visible;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), visibility 0s;
}

.topbar.off {
  display: none;
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.tb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cream);
  text-decoration: none;
  min-width: 0;
}

.tb-brand .mini {
  height: 28px;
  transform: scale(.6) rotate(-8deg);
  opacity: 0;
  transition: transform .6s .15s cubic-bezier(.2, .7, .2, 1), opacity .4s .15s;
}

.tb-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  transform: translateX(-8px);
  opacity: 0;
  transition: transform .55s .22s ease, opacity .45s .22s;
}

.topbar.show .mini,
.topbar.show .tb-txt {
  transform: none;
  opacity: 1;
}

.tb-name {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.tb-sub {
  font-size: .66rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 3px;
}

.tb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tb-nav a {
  position: relative;
  color: rgba(250, 246, 237, .85);
  text-decoration: none;
  font-size: .92rem;
  padding: 8px 12px;
  transition: color .25s;
}

.tb-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
}

.tb-nav a:hover,
.tb-nav a.cur {
  color: var(--cream);
}

.tb-nav a:hover::after,
.tb-nav a.cur::after {
  transform: scaleX(1);
}

.tb-nav a.tb-cta {
  margin-left: 8px;
  border: 1px solid rgba(226, 184, 74, .7);
  color: var(--gold);
  padding: 7px 16px;
}

.tb-nav a.tb-cta::after {
  display: none;
}

.tb-nav a.tb-cta:hover,
.tb-nav a.tb-cta.cur {
  background: var(--gold);
  color: var(--navy);
}

@media (max-width: 820px) {
  .tb-nav a:not(.tb-cta) {
    display: none;
  }
  .topbar .wrap {
    height: 58px;
  }
  .tb-sub {
    display: none;
  }
}

/* ---------- Bannière ---------- */
.hero {
  position: relative;
  background: var(--navy);
  color: var(--cream);
  overflow: hidden;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 3px solid var(--gold);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/hero.jpg") center/cover no-repeat, linear-gradient(160deg, var(--blue), var(--navy) 60%, var(--ink));
  animation: settle 2.4s cubic-bezier(.2, .6, .2, 1) both;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at center, rgba(12, 31, 60, .6) 15%, rgba(12, 31, 60, 0));
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  text-align: center;
  padding: 48px 24px;
  transform: translateY(calc(var(--p, 0) * -70px)) scale(calc(1 - var(--p, 0) * .32));
  opacity: calc(1 - var(--p, 0) * 1.15);
  will-change: transform, opacity;
}

.hero .tagline,
.hero .scroll {
  opacity: calc(.75 - var(--p, 0) * 1.4);
}

.hname {
  margin: 0;
  font: 500 clamp(2.6rem, 7vw, 5.2rem)/1.05 var(--font);
  letter-spacing: -.035em;
  color: var(--cream);
  animation: rise 1.2s .4s ease both;
}

.hrule {
  display: block;
  width: 64px;
  height: 2px;
  background: var(--gold);
  margin: 24px 0 20px;
  transform-origin: center;
  animation: grow 1s .9s ease both;
}

.hsub {
  font-size: clamp(.8rem, 1.4vw, .98rem);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
  animation: rise 1.2s 1.1s ease both;
}

.tagline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  margin: 0 auto;
  padding: 0 24px;
  max-width: 36em;
  text-align: center;
  font-size: clamp(.85rem, 1.3vw, .98rem);
  line-height: 1.55;
  color: var(--cream);
  opacity: .75;
  text-wrap: balance;
  animation: fade 1.2s 1.3s both;
}

.scroll {
  position: absolute;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  margin-left: -22px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(226, 184, 74, .6);
  border-radius: 50%;
  color: var(--gold);
  animation: fade 1s 1.6s both;
  transition: background .25s, color .25s;
}

.scroll svg {
  width: 20px;
  height: 20px;
  animation: bob 2s 2.2s ease-in-out infinite;
}

.scroll:hover {
  background: var(--gold);
  color: var(--navy);
}

/* Écrans bas (téléphone en paysage) : l'accroche reprend sa place dans le flux */
@media (max-height: 560px) {
  .hero {
    flex-direction: column;
    padding: 32px 0 96px;
  }
  .logo {
    padding: 24px 24px 16px;
  }
  .tagline {
    position: static;
    margin: 0 auto;
  }
}

/* ---------- Filigrane du logo ---------- */
.domains-sec,
.about {
  position: relative;
  overflow: hidden;
}

.domains-sec>.wrap,
.about>.wrap {
  position: relative;
  z-index: 1;
}

.wm {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  color: var(--gold);
  width: auto;
  transform: translateZ(0);
}

.domains-sec .wm {
  height: 440px;
  right: clamp(-40px, 2vw, 40px);
  top: 56px;
  opacity: .16;
}

.about .wm {
  height: 120%;
  right: -3%;
  bottom: -8%;
  opacity: .07;
}

/* ---------- Domaines de pratique ---------- */
.domains-sec {
  background: var(--cream);
  color: var(--ink);
}

.domains-sec h2 {
  color: var(--navy);
}

.cards {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.card {
  flex: 0 1 calc((100% - 72px)/4);
  min-width: 230px;
  padding: 32px 26px 30px;
  background: #fff;
  border: 1px solid rgba(12, 31, 60, .14);
  position: relative;
  transition: transform .35s ease, border-color .35s ease;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  width: 0;
  background: var(--gold);
  transition: width .45s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--gold);
}

.card:hover::before {
  width: 100%;
}

.ico {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--navy);
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  margin-bottom: 22px;
  transition: background .35s, border-color .35s, color .35s;
}

.card:hover .ico {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}

.ico svg {
  width: 26px;
  height: 26px;
}

.card h3 {
  font: 600 1.1rem/1.3 var(--font);
  letter-spacing: -.015em;
  color: var(--navy);
}

.card p {
  margin: 10px 0 0;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Présentation ---------- */
.about {
  background: var(--navy);
  color: var(--cream);
}

.about .grid {
  display: grid;
  grid-template-columns: .8fr 1.35fr;
  gap: clamp(36px, 7vw, 96px);
  align-items: center;
}

.about p {
  max-width: 62ch;
  color: rgba(250, 246, 237, .9);
}

.about .btn {
  margin-top: 14px;
}

.portrait {
  position: relative;
  margin: 0;
  aspect-ratio: 4/5;
  max-width: 380px;
  width: 100%;
}

.portrait::before {
  content: "";
  position: absolute;
  inset: 16px -16px -16px 16px;
  border: 2px solid var(--gold);
  z-index: 0;
}

.portrait img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.idn {
  border-left: 2px solid var(--gold);
  padding-left: 20px;
  margin: 0 0 26px;
}

.idn-name {
  margin: 0;
  font: 700 clamp(1.8rem, 3.4vw, 2.6rem)/1.1 var(--font);
  letter-spacing: -.03em;
  color: var(--cream);
}

.idn-name::after {
  display: none;
}

.idn-role {
  font: 500 1.1rem var(--font);
  color: var(--gold);
  margin-top: 6px;
}

/* ---------- Contact ---------- */
.contact {
  background: var(--cream);
  color: var(--ink);
}

.contact h2 {
  color: var(--navy);
}

.contact .grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  align-items: stretch;
}

dl {
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 24px;
}

dt {
  font-weight: 600;
  color: var(--blue);
}

dd {
  margin: 0;
}

dd a {
  text-decoration-color: var(--gold);
  text-underline-offset: 4px;
}

/* Carte Google Maps intégrée */
.map {
  position: relative;
  min-height: 300px;
  border: 1px solid rgba(12, 31, 60, .2);
  background: var(--blue);
  color: var(--cream);
  overflow: hidden;
}

.map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- Honoraires ---------- */
.fees {
  background: var(--blue);
  color: var(--cream);
  padding: clamp(56px, 8vw, 90px) 0;
}

.fees .grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 64px;
}

.fees h2 {
  color: var(--gold);
  margin: 0;
}

.fees p {
  margin: 0;
  max-width: 60ch;
}

/* ---------- Mentions légales / protection des données ---------- */
.privacy {
  background: var(--cream);
  border-top: 1px solid rgba(12, 31, 60, .15);
  min-height: 60vh;
}

.privacy .wrap {
  max-width: 760px;
}

.privacy h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--navy);
}

.privacy h3 {
  font: 600 1.1rem var(--font);
  color: var(--navy);
  margin: 2em 0 .5em;
}

.privacy p,
.privacy address {
  color: var(--text);
  font-size: .98rem;
}

.privacy address {
  font-style: normal;
  border-left: 2px solid var(--gold);
  padding-left: 16px;
  margin-bottom: 1em;
}

/* Barre affichée sur les pages juridiques */
.docbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
}

.docbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.docbar .logo-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cream);
  text-decoration: none;
  font: 700 1.1rem var(--font);
  letter-spacing: -.02em;
}

.db-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-weight: 400;
}

.mini {
  height: 30px;
  width: auto;
  color: var(--gold);
  flex: none;
  display: block;
}

.docbar a.back {
  color: var(--cream);
  text-decoration: none;
  font-size: .95rem;
  border: 1px solid rgba(226, 184, 74, .6);
  padding: 9px 16px;
  transition: background .25s, color .25s;
}

.docbar a.back:hover {
  background: var(--gold);
  color: var(--navy);
}

.veil {
  position: fixed;
  inset: 0;
  background: var(--navy);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  z-index: 100;
}

.veil.on {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Pied de page ---------- */
footer {
  background: var(--ink);
  color: rgba(250, 246, 237, .78);
  padding: clamp(56px, 7vw, 88px) 0 28px;
  font-size: 1rem;
}

.f-in {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.f-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: clamp(32px, 6vw, 72px);
}

.f-name {
  font: 500 clamp(1.6rem, 2.6vw, 2.1rem)/1.15 var(--font);
  letter-spacing: -.025em;
  color: var(--cream);
}

.f-sub {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 2px solid var(--gold);
  display: inline-block;
  font-size: .8rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--gold);
}

.f-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.55;
}

.f-h {
  margin: 0 0 6px;
  font: 600 .78rem var(--font);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}

.f-col a {
  color: var(--cream);
  text-decoration: none;
  background: linear-gradient(var(--gold), var(--gold)) 0 100%/0 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size .35s ease, color .25s;
}

.f-col a:hover {
  background-size: 100% 1px;
  color: #fff;
}

.f-bottom {
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 22px;
  border-top: 1px solid rgba(250, 246, 237, .14);
  font-size: .85rem;
  color: rgba(250, 246, 237, .55);
}

/* ---------- Animations ---------- */
@keyframes settle {
  from {
    transform: scale(1.08);
    opacity: .6;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.js h2::after {
  transform: scaleX(0);
}

.js h2.in::after {
  transform: scaleX(1);
}

.js .rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s ease, transform .8s ease;
  transition-delay: var(--d, 0s);
}

.js .rv.in {
  opacity: 1;
  transform: none;
}

.noanim .rv,
.noanim h2::after {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .rv {
    opacity: 1;
    transform: none;
  }
  .topbar,
  .topbar .mini,
  .topbar .tb-txt {
    transform: none !important;
    opacity: 1;
  }
  .topbar {
    display: none;
  }
  .topbar.show {
    display: block;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .card {
    flex-basis: calc((100% - 24px)/2);
  }
}

@media (max-width: 820px) {
  /* Mobile : cadrage sur la tour de la cathédrale Saint-Nicolas */
  .hero-bg {
    background-position: 18% center;
  }
  .hero::after {
    background: radial-gradient(ellipse at center, rgba(12, 31, 60, .45) 15%, rgba(12, 31, 60, 0));
  }
  .about .grid,
  .contact .grid,
  .fees .grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .about .portrait {
    max-width: 300px;
    margin-right: 16px;
  }
  .map {
    min-height: 280px;
  }
  .domains-sec .wm {
    height: 240px;
    top: 24px;
    right: -20px;
  }
  .about .wm {
    height: 70%;
    right: -14%;
  }
  .f-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .card {
    flex-basis: 100%;
  }
}
