/* ==========================================================================
   Dr. Muhammad Afzal — portfolio stylesheet
   Hand-written, no framework, no webfont requests. ~0 external dependencies.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand: field green + wheat gold */
  --brand:        #1a7a5e;
  --brand-dark:   #14654d;
  --brand-deep:   #0f5842;
  --brand-soft:   #e6f2ed;
  --accent:       #c8922a;
  --accent-soft:  #fbf1dc;

  --ink:          #16211d;
  --ink-2:        #3d4b45;
  --ink-3:        #6b7a73;
  --line:         #e2e6e3;
  --bg:           #fbfaf7;
  --surface:      #ffffff;
  --surface-2:    #f4f6f4;

  --radius:       14px;
  --radius-sm:    9px;
  --shadow-sm:    0 1px 2px rgba(16,32,26,.06), 0 2px 8px rgba(16,32,26,.05);
  --shadow-md:    0 4px 14px rgba(16,32,26,.09), 0 12px 34px rgba(16,32,26,.07);

  --maxw:         1180px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --nav-h: 60px;
  --sky-top: #eef6f2;
  --sky-bot: #dbebe3;
  --drone: #0f5842;
  --plot-0: #4cb28c; --plot-1: #2f9a74; --plot-2: #1a7a5e; --plot-3: #6cc39f; --plot-4: #3ea882;
  color-scheme: light;
}
html[data-theme="dark"] {
  --brand:        #4cc79c;
  --brand-dark:   #3fb68c;
  --brand-deep:   #8fe3c4;
  --brand-soft:   #16302a;
  --accent:       #e5b65c;
  --accent-soft:  #2b2413;

  --ink:          #e8efec;
  --ink-2:        #b9c5c0;
  --ink-3:        #8a9a94;
  --line:         #27332e;
  --bg:           #0e1613;
  --surface:      #141e1a;
  --surface-2:    #1a2621;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
  --shadow-md:    0 4px 14px rgba(0,0,0,.45), 0 12px 34px rgba(0,0,0,.35);
  --sky-top: #16241f;
  --sky-bot: #101b17;
  --drone: #8fe3c4;
  --plot-0: #2c8265; --plot-1: #256b53; --plot-2: #1c5744; --plot-3: #379976; --plot-4: #2a7a5f;
  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  /* sticky footer: short pages (404, legal) still fill the viewport */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg, video { max-width: 100%; height: auto; display: block; }
/* `hidden` must win over any component's own display rule. Without this,
   setting el.hidden = true does nothing to anything styled display:grid,
   flex or block — a trap this project already fell into once. */
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.22; color: var(--ink); margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.7rem); }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.3vw, 1.9rem); }
h3 { font-size: 1.18rem; }
h4 { font-size: 1.02rem; font-family: var(--sans); font-weight: 650; }
p  { margin: 0 0 1rem; }
a  { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); }
ul, ol { padding-left: 1.15rem; }
li { margin-bottom: .3rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--brand); color: #fff; padding: .55rem 1rem; border-radius: 0 0 8px 8px;
  text-decoration: none; transition: top .18s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(2.6rem, 5vw, 4.2rem); scroll-margin-top: calc(var(--nav-h) + 12px); }
.section--alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.section__head { max-width: 62ch; margin-bottom: 1.8rem; }
.section__eyebrow {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand-dark); background: var(--brand-soft);
  padding: .3rem .65rem; border-radius: 99px; margin-bottom: .75rem;
}
.lede { font-size: 1.06rem; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.small { font-size: .88rem; }

/* ---------- Language + theme switching ---------- */
html[data-lang="en"] [lang="de"].i18n,
html[data-lang="de"] [lang="en"].i18n { display: none !important; }

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; height: 100%; display: flex; align-items: center; gap: 1rem; }
.nav__brand { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-weight: 650; font-size: 1.02rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav__brand .mark { width: 30px; height: 30px; flex: 0 0 30px; }
.nav__links { display: flex; align-items: center; gap: .1rem; margin-left: auto; }
.nav__links a {
  color: var(--ink-2); text-decoration: none; font-size: .9rem; font-weight: 550;
  padding: .45rem .6rem; border-radius: 8px; transition: background .16s ease, color .16s ease;
}
.nav__links a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.nav__links a.is-active { color: var(--brand-dark); background: var(--brand-soft); }
.nav__links a.cta {
  background: var(--brand); color: #fff; margin-left: .4rem; padding-inline: .95rem;
  box-shadow: var(--shadow-sm);
}
.nav__links a.cta:hover { background: var(--brand-dark); color: #fff; }
.nav__tools { display: flex; gap: .35rem; align-items: center; margin-left: .5rem; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  min-width: 36px; height: 36px; padding: 0 .55rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 9px; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 650;
  transition: border-color .16s, color .16s, background .16s;
}
.iconbtn:hover { border-color: var(--brand); color: var(--brand-dark); }
.iconbtn svg { width: 17px; height: 17px; }
.nav__burger { display: none; }

@media (max-width: 900px) {
  .nav__burger { display: inline-flex; margin-left: auto; }
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: .15rem;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: .7rem 20px 1.1rem; box-shadow: var(--shadow-md);
    margin-left: 0;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .18s ease;
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links a { padding: .6rem .7rem; font-size: .98rem; }
  .nav__links a.cta { margin-left: 0; text-align: center; margin-top: .4rem; }
}

/* Very narrow phones: the wordmark gives way so the controls always fit. */
@media (max-width: 560px) {
  .nav__inner { gap: .5rem; padding-inline: 14px; }
  .nav__brand span { display: none; }
  .nav__tools { margin-left: .2rem; gap: .3rem; }
  .iconbtn { min-width: 34px; height: 34px; padding: 0 .45rem; }
  .wrap { padding-inline: 16px; }
  .profile__photo { width: 140px; height: 140px; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(1.6rem, 3vw, 2.6rem); }
.hero__banner {
  position: relative; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-sm);
  /* No min-height: it would override the ratio on a narrow screen, leaving the
     box shorter than 3:1 while the drawing inside is 3:1 — which crops it. */
  aspect-ratio: 3 / 1;
}
/* the banner's own drawing only — not the little figures inside the
   formula panel, which set their own width */
.hero__banner > svg { width: 100%; height: 100%; }
/* Caption for the banner motifs — the one place the text is a readable size. */
.hero__banner { position: relative; }
.banner__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  margin: 0; padding: .45rem .9rem;
  font-size: .8rem; line-height: 1.35; text-align: center;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  border-top: 1px solid var(--line);
  transition: opacity .2s ease;
}
@media (max-width: 560px) { .banner__caption { font-size: .72rem; padding: .35rem .6rem; } }

/* ---------- Formula panel, opened from a dot in the banner ---------- */
.banner__panel {
  /* A card floating over the field rather than a lid closed on it: inset from
     every edge so the banner stays visible around and through it. */
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(430px, calc(100% - 3rem));
  max-height: calc(100% - 3rem);
  z-index: 4;
  display: grid; place-content: center; gap: .15rem;
  padding: .8rem 1.9rem .85rem;
  text-align: center;
  overflow-y: auto;
  /* more of the field shows through; the heavier blur is what keeps the
     text legible over a busy, high-contrast plot grid */
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: 18px;
  box-shadow: 0 10px 34px rgba(16, 32, 26, .16), 0 2px 8px rgba(16, 32, 26, .08);
  animation: panelIn .34s cubic-bezier(.2, 1.4, .4, 1), panelFloat 6s ease-in-out .34s infinite;
}

@keyframes panelIn {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
/* a slow drift, so the card reads as hovering rather than pinned */
@keyframes panelFloat {
  0%, 100% { transform: translate(-50%, -50%); }
  50%      { transform: translate(-50%, calc(-50% - 5px)); }
}
@media (prefers-reduced-motion: reduce) {
  .banner__panel { animation: none; transform: translate(-50%, -50%); }
}

.banner__panel h4 {
  font-family: var(--sans); font-size: .82rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand-dark); margin: 0 0 .35rem;
}
.banner__panel p { margin: 0 0 .3rem; font-size: .82rem; color: var(--ink-2); max-width: 46ch; }
.banner__panel .formula {
  font-family: var(--serif); font-size: clamp(1rem, .85rem + .5vw, 1.32rem);
  color: var(--ink); margin-bottom: .3rem;
}
.banner__panel .formula--sub { font-size: .95rem; color: var(--ink-2); }
.banner__panel sub, .banner__panel sup { font-size: .62em; }

.banner__panel-close {
  position: absolute; top: .3rem; right: .5rem;
  width: 26px; height: 26px; border: none; border-radius: 50%;
  background: transparent; color: var(--ink-3);
  font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.banner__panel-close:hover { color: var(--brand-dark); background: var(--surface-2); }

.panel-fig { width: 158px; height: auto; margin: 0 auto .3rem; }
.panel-fig--sm { width: 94px; }
.panel-fig .ax    { stroke: var(--ink-3); stroke-width: 1; opacity: .6; }
.panel-fig .axl   { fill: var(--ink-3); font: 600 6px/1 system-ui, sans-serif; }
.panel-fig .pt circle { fill: var(--brand); opacity: .75; }
.panel-fig .load line  { stroke: var(--accent); stroke-width: 1.4; }
.panel-fig .curve { fill: none; stroke: var(--brand); stroke-width: 1.8; }
.panel-fig .roc   { fill: none; stroke: var(--brand); stroke-width: 2; }
.panel-fig .diag  { stroke: var(--ink-3); stroke-dasharray: 3 3; opacity: .5; }
.panel-fig .band  { opacity: .10; }
.panel-fig .vis { fill: var(--brand); } .panel-fig .red { fill: var(--accent); } .panel-fig .nir { fill: var(--brand); }

.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; padding: 0; margin: 0 0 .5rem; }
.chips li {
  font-size: .76rem; font-weight: 600; color: var(--brand-dark);
  background: var(--brand-soft); border-radius: 99px; padding: .2rem .55rem; margin: 0;
}

/* ---------- Phone: the same eight dots, in a row under the field ----------
   Chips ran off the right edge and needed scrolling. Eight dots fit any phone
   width comfortably and echo the desktop treatment. */
.formula-list, .formula-list__note { display: none; }

@media (max-width: 700px) {
  .formula-list {
    display: flex; justify-content: center; align-items: center;
    gap: clamp(.15rem, 2.2vw, .7rem);
    list-style: none; margin: .5rem 0 0; padding: 0;
  }
  .formula-list li { margin: 0; }
  .formula-list button {
    position: relative;
    width: 34px; height: 34px;           /* a real tap target */
    padding: 0; border: none; background: none; cursor: pointer;
  }
  /* the visible dot, drawn to match the ones beside the field */
  .formula-list button::before {
    content: ""; position: absolute; inset: 50% auto auto 50%;
    width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
    border-radius: 50%; background: var(--accent);
    border: 1.5px solid var(--surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
    transition: transform .28s cubic-bezier(.2,1.5,.4,1), box-shadow .2s ease;
  }
  .formula-list button[aria-pressed="true"]::before {
    transform: scale(1.45);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent);
  }
  .formula-list__note {
    display: block; text-align: center;
    margin: .3rem 0 0; font-size: .7rem; color: var(--ink-3);
  }

  /* the label stays for screen readers and for the panel title */
  .formula-list button > span {
    position: absolute; width: 1px; height: 1px;
    clip-path: inset(50%); overflow: hidden; white-space: nowrap;
  }

  /* On a phone the banner is ~119px tall, far too short to hold the panel.
     It becomes a bottom sheet instead. */
  .banner__panel {
    position: fixed; inset: auto 0 0 0; z-index: 200;
    top: auto; left: 0; transform: none; width: auto;
    border: none; border-radius: 20px 20px 0 0;
    max-height: 72vh; padding: 1.2rem 1.2rem 1.5rem;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -10px 34px rgba(16,32,26,.22);
    animation: sheetIn .26s cubic-bezier(.2,1.2,.4,1);
  }
  @keyframes sheetIn { from { transform: translateY(18px); opacity: .5 } to { transform: none; opacity: 1 } }
  .banner__panel-close { top: .5rem; right: .6rem; }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .banner__panel { animation: none; }
}

.hero__grid {
  display: grid; grid-template-columns: minmax(230px, 280px) 1fr;
  gap: clamp(1.4rem, 4vw, 3rem); align-items: start;
  margin-top: clamp(1.4rem, 3vw, 2.2rem);
}
@media (max-width: 860px) { .hero__grid { grid-template-columns: 1fr; } }

/* profile card */
.profile { position: sticky; top: calc(var(--nav-h) + 22px); text-align: center; }
@media (max-width: 860px) { .profile { position: static; } }
.profile__photo {
  width: 168px; height: 168px; margin: 0 auto .95rem; border-radius: 50%;
  overflow: hidden; border: 4px solid var(--surface); box-shadow: var(--shadow-md);
  background: var(--brand-soft);
}
.profile__photo img, .profile__photo svg { width: 100%; height: 100%; object-fit: cover; }
.profile__name { font-size: 1.45rem; margin-bottom: .15rem; }
.profile__role { color: var(--brand-dark); font-weight: 600; font-size: .95rem; margin-bottom: .2rem; }
.profile__where { color: var(--ink-3); font-size: .87rem; margin-bottom: 1rem; }
.profile__links { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.profile__links a {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .82rem; font-weight: 600; text-decoration: none;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
  padding: .38rem .68rem; border-radius: 99px;
  transition: transform .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.profile__links a:hover { color: var(--brand-dark); border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.profile__links svg { width: 15px; height: 15px; }

/* Text for screen readers only — visually removed, still announced. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-size: .93rem; font-weight: 650; text-decoration: none; cursor: pointer;
  padding: .68rem 1.25rem; border-radius: 10px; border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brand-dark); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-dark); transform: translateY(-2px); }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 1rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.45rem; position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transform: scaleX(0); transform-origin: left; transition: transform .28s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.card:hover::after { transform: scaleX(1); }
.card__icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark); margin-bottom: .85rem;
}
.card__icon svg { width: 22px; height: 22px; }
.card h3 { font-family: var(--sans); font-size: 1.04rem; font-weight: 650; margin-bottom: .45rem; }
.card p { font-size: .93rem; color: var(--ink-2); margin-bottom: .7rem; }
.card ul { font-size: .89rem; color: var(--ink-2); margin: 0; padding-left: 1.05rem; }
.card ul li { margin-bottom: .25rem; }

/* Service detail: a disclosure on small screens, plain content on large ones. */
.card__more { margin-top: .6rem; }
.card__more > summary {
  cursor: pointer; list-style: none;
  font-size: .84rem; font-weight: 650; color: var(--brand-dark);
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .15rem 0;
}
.card__more > summary::-webkit-details-marker { display: none; }
.card__more > summary::after {
  content: ""; width: .42em; height: .42em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform .18s ease;
}
.card__more[open] > summary::after { transform: rotate(-135deg) translate(-1px, -1px); }
.card__more > summary:hover { color: var(--brand); }
.card__more > ul { margin-top: .5rem; }


/* pills / tags */
.pills { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 0; padding: 0; list-style: none; }
.pills li {
  font-size: .79rem; font-weight: 600; color: var(--ink-2); margin: 0;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: .3rem .6rem; border-radius: 99px;
}
.pills li.is-key { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: color-mix(in srgb, var(--accent) 70%, var(--ink)); }

/* ---------- "Why me" / trust section ---------- */


.pullquote {
  margin: 0 0 1.8rem;
  padding: .2rem 0 .2rem 1.5rem;
  border-left: 4px solid var(--accent);
  max-width: 52ch;
}
.pullquote p {
  font-family: var(--serif);
  font-size: clamp(1.18rem, 1.02rem + .8vw, 1.6rem);
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 .6rem;
}
.pullquote strong { color: var(--brand-dark); font-weight: 600; }
.pullquote cite {
  font-style: normal; font-size: .78rem; font-weight: 650;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}

/* The numeral sits in the same box the Services cards use for their icon,
   so both sections read as one system. */
.card__num {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  color: var(--brand-dark);
  letter-spacing: .02em;
}

/* ---------- Client feedback carousel ---------- */
.carousel { position: relative; padding-inline: 0; }

.carousel__track {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: .4rem;
  /* the scrollbar itself is hidden; the arrows and dots do the navigating */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.carousel__track::-webkit-scrollbar { display: none; }

/* One card on a phone, two on a tablet, three on a desktop.
   The divisor has to be a plain number — calc() cannot divide by a
   custom property, and the whole declaration is thrown away if it tries. */
.carousel__track > .quote {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
}
@media (min-width: 700px) {
  .carousel__track > .quote { flex-basis: calc((100% - 1.1rem) / 2); }
}
@media (min-width: 1060px) {
  .carousel__track > .quote { flex-basis: calc((100% - 2.2rem) / 3); }
}

.carousel__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  cursor: pointer; font: inherit;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
}
.carousel__arrow:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.carousel__arrow svg { width: 18px; height: 18px; }
.carousel__arrow--prev { left: -8px; }
.carousel__arrow--next { right: -8px; }
@media (min-width: 1240px) {
  .carousel__arrow--prev { left: -22px; }
  .carousel__arrow--next { right: -22px; }
}
.carousel[data-static] .carousel__arrow,
.carousel[data-static] .carousel__dots { display: none; }

.carousel__dots {
  display: flex; justify-content: center; gap: .4rem; margin-top: 1.1rem;
}
.carousel__dot {
  width: 7px; height: 7px; padding: 0; border-radius: 50%;
  border: none; cursor: pointer; background: var(--line);
  transition: background .2s, transform .2s;
}
.carousel__dot[aria-current="true"] { background: var(--brand); transform: scale(1.35); }

/* ---------- Client feedback cards ---------- */
.quote {
  margin: 0; padding: 1.5rem 1.5rem 1.3rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; position: relative;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.quote:hover { box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.quote::before {
  content: "\201C";
  font-family: var(--serif); font-size: 3.2rem; line-height: .75;
  color: var(--accent); opacity: .5; display: block; margin-bottom: .3rem;
}
.quote blockquote { margin: 0 0 1rem; flex: 1; }
.quote blockquote p {
  margin: 0; font-family: var(--serif); font-size: 1.02rem; line-height: 1.55; color: var(--ink);
}
.quote figcaption { border-top: 1px solid var(--line); padding-top: .8rem; }
.quote__who { display: block; font-weight: 650; font-size: .93rem; color: var(--ink); }
.quote__meta { display: block; font-size: .84rem; color: var(--ink-3); margin-top: .1rem; }

/* ---------- Tabs (EN/DE style panels) ---------- */
.tabs { margin-bottom: 1rem; }
.tabs__list { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.1rem; }
.tabs__btn {
  font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-bottom: none;
  color: var(--ink-3); padding: .45rem .9rem; border-radius: 9px 9px 0 0;
  transition: background .15s, color .15s;
}
.tabs__btn:hover { background: var(--brand-soft); color: var(--brand-dark); }
.tabs__btn[aria-selected="true"] { background: var(--brand); color: #fff; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--brand), var(--accent)); opacity: .35; }
.timeline > li { position: relative; padding-left: 2rem; margin-bottom: 1.5rem; }
.timeline > li::before {
  content: ""; position: absolute; left: 0; top: .45rem; width: 16px; height: 16px;
  border-radius: 50%; background: var(--surface); border: 3px solid var(--brand);
}
.timeline .t-when { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-dark); }
.timeline .t-what { font-weight: 650; font-size: 1.02rem; margin: .1rem 0 .05rem; }
.timeline .t-where { font-size: .89rem; color: var(--ink-3); margin-bottom: .4rem; }
.timeline ul { font-size: .92rem; color: var(--ink-2); margin: .35rem 0 0; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; min-width: 520px; }
thead th {
  text-align: left; background: var(--surface-2); color: var(--ink-2);
  font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
  padding: .7rem .9rem; border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
tbody td { padding: .68rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--brand-soft); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-top: 1.4rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: 1.7rem; color: var(--brand-dark); line-height: 1.1; }
.stat span { font-size: .82rem; color: var(--ink-3); }

/* ---------- Booking / contact ---------- */
.booking { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 880px) { .booking { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.panel h3 { display: flex; align-items: center; gap: .55rem; }
.panel h3 svg { width: 20px; height: 20px; color: var(--brand); flex: none; }

.embed-slot {
  border: 2px dashed color-mix(in srgb, var(--brand) 40%, var(--line));
  border-radius: var(--radius-sm); background: var(--brand-soft);
  padding: 1.1rem; font-size: .88rem; color: var(--ink-2); margin-top: .9rem;
}
.embed-slot code { background: var(--surface); }
#cal-embed { min-height: 0; }
#cal-embed:not(:empty) + .embed-slot { display: none; }

.field { margin-bottom: .85rem; }
.field label { display: block; font-size: .84rem; font-weight: 650; margin-bottom: .3rem; color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: .94rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: .6rem .75rem;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field textarea { min-height: 128px; resize: vertical; }
.req { color: var(--accent); font-weight: 700; margin-left: .15em; }
.form-legend { font-size: .82rem; color: var(--ink-3); margin: 0 0 1rem; }

.consent { display: flex; gap: .55rem; align-items: flex-start; font-size: .84rem; color: var(--ink-2); }
.consent input { width: auto; margin-top: .25rem; flex: none; }
.form-note { font-size: .82rem; color: var(--ink-3); margin-top: .7rem; }
.form-status { margin-top: .8rem; font-size: .9rem; font-weight: 600; }
.form-status.ok { color: var(--brand-dark); }
.form-status.err { color: #c0392b; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Callout ---------- */
.callout {
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  padding: .9rem 1.1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .9rem; color: var(--ink-2); margin: 1.2rem 0;
}
.callout strong { color: var(--ink); }
.callout--todo { border-left-color: var(--brand); background: var(--brand-soft); }

/* ---------- Footer ---------- */
.footer { background: var(--surface-2); border-top: 1px solid var(--line); padding-block: 2.4rem 1.6rem; margin-top: 1rem; }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.6rem; }
.footer h4 { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .6rem; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .35rem; }
.footer a { color: var(--ink-2); text-decoration: none; font-size: .9rem; }
.footer a:hover { color: var(--brand-dark); text-decoration: underline; }
.footer__bottom {
  margin-top: 1.8rem; padding-top: 1.1rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between;
  font-size: .84rem; color: var(--ink-3);
}

/* ---------- Legal pages ---------- */
.legal { max-width: 78ch; }
.legal h2 { margin-top: 2.2rem; font-size: 1.35rem; }
.legal h3 { margin-top: 1.5rem; font-size: 1.05rem; font-family: var(--sans); }
.legal p, .legal li { font-size: .95rem; color: var(--ink-2); }
.legal address { font-style: normal; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.15rem; display: inline-block; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Back to top ---------- */
.totop {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; border: none; cursor: pointer;
  box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.totop.is-shown { opacity: 1; pointer-events: auto; transform: none; }
.totop svg { width: 19px; height: 19px; }

/* ---------- Print ---------- */
@media print {
  .nav, .totop, .footer, .embed-slot, form { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .card, .panel { break-inside: avoid; }
}
