/* BlackFern — styles ported from the prototype (Blackfern.html) and adapted to
   the component markup. Colours, type scale, hero, accordions, marquee, contact,
   footer, fade-in, and the mobile single-column breakpoint mirror the prototype;
   visible focus styles are added for accessibility (Requirements 25.1, 25.2, 25.4). */

:root {
  --bg: #1a1a18;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --faint: rgba(255, 255, 255, 0.12);
  --font: var(--font-jakarta), 'Helvetica Neue', Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
}
::selection { background: var(--fg); color: var(--bg); }
input, textarea { font-family: var(--font); }
input::placeholder, textarea::placeholder { color: rgba(255, 255, 255, 0.28); }
img { display: block; }

/* Visible focus for keyboard users (Requirement 25.2) */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

/* ---- NAV ---- */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  padding: 1rem 3rem; display: flex; align-items: center; justify-content: space-between;
  transition: all 0.4s; background: rgba(26, 26, 24, 0.7); backdrop-filter: blur(20px);
}
#nav.scrolled { background: rgba(22, 22, 20, 0.97); border-bottom: 1px solid var(--faint); }
.nav-logo { display: flex; align-items: center; text-decoration: none; color: var(--fg); }
.nav-logo-img { height: 72px; width: auto; display: block; transition: height 0.4s; }
#nav.scrolled .nav-logo-img { height: 60px; }
.nav-links {
  display: flex; gap: 2.5rem; list-style: none;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.nav-links a {
  font-weight: 600; font-size: 0.93rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65); text-decoration: none; transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 0.5; }
.lang-switcher { display: none; gap: 2px; background: rgba(255, 255, 255, 0.07); border-radius: 2px; overflow: hidden; }
.lang-option {
  padding: 0.32rem 0.7rem; font-weight: 700; font-size: 0.6rem; letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45); text-decoration: none; transition: all 0.25s;
}
.lang-option.active { background: rgba(255, 255, 255, 0.15); color: var(--fg); }

/* ---- SECTIONS ---- */
section { padding: 8rem 3rem; position: relative; overflow: hidden; }
.inner { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.sec-label {
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45); display: block; margin-bottom: 1.2rem;
}
.sec-title {
  font-size: clamp(1.4rem, 2.8vw, 2.2rem); font-weight: 800; letter-spacing: -0.015em;
  line-height: 1; color: var(--fg); white-space: pre-line; margin-bottom: 2.5rem;
}
.body-text { font-size: 0.88rem; font-weight: 300; line-height: 1.95; color: rgba(255, 255, 255, 0.88); }
.about-intro p + p { margin-top: 1.1rem; }

/* ---- BUTTONS ---- */
.btn-primary, .btn-ghost {
  padding: 0.9rem 2.4rem; font-family: var(--font); font-weight: 700; font-size: 0.62rem;
  letter-spacing: 0.2em; text-transform: uppercase; cursor: pointer; transition: all 0.3s;
  text-decoration: none; display: inline-flex; align-items: center; background: transparent;
}
.btn-primary { color: var(--fg); border: 1.5px solid rgba(255, 255, 255, 0.45); }
.btn-primary:hover { background: var(--fg); color: var(--bg); }
.btn-ghost { color: rgba(255, 255, 255, 0.42); border: 1.5px solid var(--faint); font-weight: 500; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }

/* ---- HERO ---- */
#hero {
  min-height: 100vh; background: var(--bg); display: flex; align-items: flex-start; justify-content: center;
  padding: 150px 2rem 60px; text-align: center;
}
/* On tall screens (large external monitors) the top-anchored hero copy floats
   too high, leaving a big void above the Prague skyline. Once there is clearly
   excess height, centre it vertically with a slight upward bias. Laptop and
   mobile keep the safe top-anchored layout untouched. */
@media (min-height: 1000px) {
  #hero { align-items: center; padding-top: 110px; padding-bottom: 260px; }
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.prague-svg { position: absolute; bottom: 0; left: 0; width: 100%; }
.hero-content { position: relative; z-index: 2; max-width: 900px; }
.hero-tag {
  font-size: 0.58rem; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45); display: block; margin-bottom: 1.5rem;
}
.hero-h1 {
  font-size: clamp(1.45rem, 3.7vw, 2.8rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.05;
  color: var(--fg); margin-bottom: 1.8rem;
}
.hero-sub { font-size: 1.05rem; font-weight: 300; line-height: 1.9; color: rgba(255, 255, 255, 0.9); max-width: 560px; margin: 0 auto 2.5rem; }
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.scroll-hint { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.scroll-hint span { font-size: 0.5rem; letter-spacing: 0.3em; color: rgba(255, 255, 255, 0.25); }
.scroll-line { width: 1px; height: 40px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent); animation: pulse 2s ease infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.9; } }

/* ---- STATS ---- */
#stats { padding: 3rem; background: #111110; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.stats-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; text-align: center; }
.stat-num { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; color: var(--fg); margin-bottom: 0.3rem; }
.stat-label { font-size: 0.67rem; font-weight: 300; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); }

/* ---- GENERIC ACCORDION (About / Services / Sectors) ---- */
.accordion-item { border-bottom: 1px solid var(--faint); }
.accordion-item:first-child { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.accordion-header {
  display: flex; align-items: center; gap: 1.5rem; width: 100%; padding: 1.5rem 0;
  background: transparent; border: none; cursor: pointer; text-align: left; color: inherit; font-family: var(--font);
}
.accordion-arrow { margin-left: auto; font-size: 1.2rem; font-weight: 300; color: rgba(255, 255, 255, 0.25); transition: transform 0.35s ease, color 0.25s; flex-shrink: 0; }
.accordion-item.open .accordion-arrow { transform: rotate(45deg); color: rgba(255, 255, 255, 0.75); }
.accordion-body { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease; }
.accordion-item.open .accordion-body { max-height: 700px; opacity: 1; }

/* ---- ABOUT ---- */
#about { background: #2c2c2a; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
/* About — milestones "snake": intro copy on the left, a vertical serpentine
   traced 1:1 from the brand artwork on the right. The stage carries the
   artwork's aspect ratio so the HTML medallions/labels register against the SVG
   connector line; `cqw` units size everything against the stage so the line and
   nodes scale together. */
.tl-stage {
  position: relative; container-type: inline-size;
  width: 100%; max-width: 460px; margin: 0 auto;
  aspect-ratio: 1251 / 1210;
}
.tl-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tl-node { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.tl-medal {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  width: 14.07cqw; height: auto; display: block;
}
.tl-label {
  position: absolute; top: 0; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 0.3rem; max-width: 30cqw;
}
.tl-node--left .tl-label { right: calc(7.03cqw + 1.6cqw); text-align: right; align-items: flex-end; }
.tl-node--right .tl-label { left: calc(7.03cqw + 1.6cqw); text-align: left; align-items: flex-start; }
.tl-year { font-size: clamp(1.3rem, 3.4cqw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1; color: rgba(255, 255, 255, 0.55); }
.tl-text { font-size: clamp(0.72rem, 1.5cqw, 0.92rem); font-weight: 300; line-height: 1.45; color: rgba(255, 255, 255, 0.72); }
.tl-node--final .tl-year { color: var(--fg); }
.tl-node--final .tl-text { color: var(--fg); font-weight: 500; }

/* ---- SERVICES ---- */
#services { background: #1a1a18; }
.svc-num { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.2em; color: rgba(255, 255, 255, 0.25); flex-shrink: 0; width: 2rem; }
.svc-item-title { font-size: clamp(1rem, 2vw, 1.5rem); font-weight: 700; letter-spacing: -0.01em; color: rgba(255, 255, 255, 0.75); transition: color 0.25s; }
.svc-item.open .svc-item-title, .accordion-header:hover .svc-item-title { color: var(--fg); }
.svc-body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; padding: 0 0 2rem 3.5rem; }
.svc-tag { font-size: 0.56rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255, 255, 255, 0.4); border: 1px solid var(--faint); padding: 0.28rem 0.75rem; display: inline-block; margin-bottom: 1.5rem; }
.svc-summary { font-size: 0.87rem; font-weight: 300; line-height: 1.95; color: var(--muted); }
.svc-summary + .svc-summary { margin-top: 1.1rem; }
.svc-process-heading { font-size: 0.56rem; font-weight: 700; letter-spacing: 0.25em; text-transform: uppercase; color: rgba(255, 255, 255, 0.22); display: block; margin-bottom: 1.2rem; }
.svc-process, .sec-list { list-style: none; }
.svc-process li, .sec-list li { display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 0.82rem; color: rgba(255, 255, 255, 0.75); line-height: 1.75; }
.svc-process li:last-child, .sec-list li:last-child { border-bottom: none; }
.svc-process-mark, .sec-list-mark { flex-shrink: 0; opacity: 0.5; }

/* ---- SECTORS ---- */
#sectors { background: #111110; }
.sec-item-title { font-size: clamp(1rem, 2vw, 1.5rem); font-weight: 700; letter-spacing: -0.01em; color: rgba(255, 255, 255, 0.75); transition: color 0.25s; }
.sec-item.open .sec-item-title, .accordion-header:hover .sec-item-title { color: var(--fg); }
.sec-list { padding: 0.2rem 0 1.4rem 3.5rem; }

/* ---- REFERENCES (marquee) ---- */
#references { background: #2c2c2a; padding: 6rem 0; }
#references .inner { padding: 0 3rem; }
.marquee-wrap { position: relative; display: flex; align-items: center; gap: 0.5rem; padding: 0 3rem; }
.marquee-mask { overflow: hidden; position: relative; flex: 1; }
.marquee-mask::before, .marquee-mask::after { content: ''; position: absolute; top: 0; bottom: 0; width: 80px; z-index: 2; pointer-events: none; }
.marquee-mask::before { left: 0; background: linear-gradient(to right, #2c2c2a, transparent); }
.marquee-mask::after { right: 0; background: linear-gradient(to left, #2c2c2a, transparent); }
.marquee-track { display: flex; gap: 2px; width: max-content; animation: marquee 40s linear infinite; }
.marquee-track:hover, .marquee-track.paused { animation-play-state: paused; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.ref-logo { width: 180px; height: 90px; background: #fff; border: 1px solid rgba(0, 0, 0, 0.06); padding: 0 1.25rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: box-shadow 0.3s; overflow: hidden; }
.ref-logo:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28); }
.ref-logo img { max-width: 100%; max-height: 64px; object-fit: contain; }
.marquee-btn { width: 38px; height: 38px; border: 1px solid rgba(255, 255, 255, 0.18); background: transparent; color: rgba(255, 255, 255, 0.6); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1rem; transition: all 0.25s; flex-shrink: 0; }
.marquee-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--fg); border-color: rgba(255, 255, 255, 0.4); }

/* ---- CTA BAND ---- */
#cta-band { background: #2c2c2a; padding: 7rem 3rem; text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.cta-band-inner { max-width: 600px; margin: 0 auto; }
.cta-heading { font-size: clamp(1.8rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: -0.01em; color: var(--fg); margin-bottom: 1.5rem; line-height: 1.05; }
.cta-heading span { font-weight: 300; color: rgba(255, 255, 255, 0.38); }
.cta-message { font-size: 0.88rem; font-weight: 300; line-height: 1.95; color: rgba(255, 255, 255, 0.72); margin-bottom: 2.5rem; }
.cta-label { text-align: center; }

/* ---- CONTACT ---- */
#contact { background: #1a1a18; }
.contact-sub { font-size: 0.95rem; font-weight: 300; line-height: 1.9; color: var(--muted); max-width: 560px; margin-bottom: 3rem; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; }
.contact-form .field { margin-bottom: 2rem; }
.contact-form input, .contact-form textarea {
  width: 100%; background: transparent; border: none; border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.7rem 0; font-size: 0.87rem; font-weight: 300; color: var(--fg); outline: none; transition: border-color 0.3s;
}
.contact-form input:focus, .contact-form textarea:focus { border-bottom-color: rgba(255, 255, 255, 0.5); }
.contact-form textarea { resize: none; }
.field-error { display: block; min-height: 1rem; margin-top: 0.4rem; font-size: 0.68rem; letter-spacing: 0.05em; color: #d98b8b; }
.cf-turnstile { margin: 1rem 0; }
.form-status { margin-top: 1rem; font-size: 0.78rem; color: var(--muted); min-height: 1.2rem; }
.thank-you h3 { font-size: 1.1rem; font-weight: 700; color: var(--fg); margin-bottom: 0.8rem; }
.thank-you p { font-size: 0.88rem; font-weight: 300; color: var(--muted); }
.contact-office { padding-top: 1rem; }
.office-block { margin-bottom: 2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.office-label { font-size: 0.58rem; font-weight: 600; letter-spacing: 0.25em; text-transform: uppercase; color: rgba(255, 255, 255, 0.38); }
.office-block a { font-size: 0.88rem; font-weight: 300; color: rgba(255, 255, 255, 0.72); text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.2); padding-bottom: 1px; width: fit-content; transition: color 0.25s; }
.office-block a:hover { color: var(--fg); }
.office-company { font-size: 0.88rem; font-weight: 500; color: var(--fg); }
.office-reg { gap: 0.2rem; }
.office-reg span { font-size: 0.78rem; font-weight: 300; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.02em; }

/* ---- FOOTER ---- */
.site-footer { background: #0e0e0d; padding: 3rem; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; }
.footer-brand { display: flex; align-items: center; }
.footer-logo-img { height: 34px; width: auto; display: block; }
.footer-links { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a, .footer-link { font-size: 0.62rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); background: transparent; border: none; cursor: pointer; text-decoration: none; font-family: var(--font); transition: color 0.25s; }
.footer-links a:hover, .footer-link:hover { color: var(--fg); }
.footer-rights { font-size: 0.58rem; font-weight: 300; letter-spacing: 0.07em; color: rgba(255, 255, 255, 0.22); width: 100%; }

/* ---- LEGAL MODALS ---- */
.legal-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.legal-modal[hidden] { display: none; }
.legal-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
.legal-modal-panel { position: relative; z-index: 1; max-width: 640px; width: 100%; max-height: 80vh; overflow-y: auto; background: #1f1f1d; border: 1px solid var(--faint); padding: 2.5rem; }
.legal-modal-close { position: absolute; top: 1rem; right: 1rem; background: transparent; border: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.legal-modal-panel h2 { font-size: 1.2rem; margin-bottom: 1.2rem; color: var(--fg); }
.legal-modal-body { font-size: 0.85rem; font-weight: 300; line-height: 1.8; color: var(--muted); }
/* Structured legal copy: section headings, paragraph rhythm, cookie lists. */
.legal-modal-body h3 {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg); margin: 1.5rem 0 0.5rem;
}
.legal-modal-body p + p { margin-top: 0.7rem; }
.legal-modal-body ul { margin: 0.5rem 0 0.7rem; padding-left: 1.2rem; }
.legal-modal-body li + li { margin-top: 0.35rem; }
.legal-modal-body strong { color: var(--fg); font-weight: 600; }
.legal-modal-body a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* ---- FADE-IN ---- */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.85s ease, transform 0.85s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-delay-1 { transition-delay: 0.1s; }
.fade-delay-2 { transition-delay: 0.2s; }
.fade-delay-3 { transition-delay: 0.3s; }
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
  .marquee-track, .scroll-line { animation: none; }
}

/* Tight desktop: the enlarged logo would collide with the centred menu,
   so drop absolute centring and let the menu sit to the right instead. */
@media (max-width: 1300px) and (min-width: 901px) {
  .nav-links { position: static; transform: none; margin-left: auto; }
}

/* ---- RESPONSIVE (single column at the mobile breakpoint) ---- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  #nav { padding: 1rem 1.5rem; }
  section { padding: 5rem 1.5rem; }
  .about-grid, .contact-grid, .svc-body-grid { grid-template-columns: 1fr; gap: 3rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .nav-logo-img { height: 60px; }
  .svc-body-grid, .sec-list { padding-left: 0; }
  /* Single-column services stack much taller than the desktop 700px cap,
     which clipped the process list — give the open body room on mobile. */
  #services .accordion-item.open .accordion-body { max-height: 1500px; }

  /* Timeline: drop the serpentine for a plain vertical list on touch. */
  .about-timeline { margin-top: 1.5rem; }
  .tl-stage {
    container-type: normal; aspect-ratio: auto; max-width: 460px;
    display: flex; flex-direction: column; gap: 1.6rem;
  }
  .tl-line { display: none; }
  .tl-node { position: static; width: auto; height: auto; display: flex; align-items: center; gap: 1rem; }
  .tl-medal { position: static; transform: none; width: 54px; flex-shrink: 0; }
  .tl-node--left .tl-label, .tl-node--right .tl-label {
    position: static; transform: none; right: auto; left: auto; max-width: none;
    text-align: left; align-items: flex-start;
  }
  .tl-year { font-size: 1.35rem; }
  .tl-text { font-size: 0.82rem; }

  /* Brand slider: reclaim width and clarity on touch screens. The 80px edge
     fades + 3rem padding + nav buttons left less than one logo fully visible,
     and there is no :hover to lift logos to full opacity. */
  .marquee-wrap { padding: 0 1rem; gap: 0; }
  .marquee-btn { display: none; }
  .marquee-mask::before, .marquee-mask::after { width: 28px; }
  .ref-logo { width: 150px; height: 80px; padding: 0 0.9rem; }
  .ref-logo img { max-width: 100%; max-height: 54px; }
}
