/* =========================================================
   Sulfogenis — Stylesheet
   Palette (client brief):
     background      #fffbf3
     text            #656566
     link            #e08549
     link:active     red
     link:visited    #e08549
   Extended palette pulled from the logo's dot sequence.
   ========================================================= */

:root {
  --bg:            #fffbf3;
  --bg-alt:        #fff5e6;
  --text:          #656566;
  --heading:       #45403c;
  --link:          #e08549;
  --link-active:   #d1291c;
  --line:          #ecdfc8;
  --line-soft:     #f2e8d6;

  /* accent tints lifted from the header dots */
  --accent-cream:  #fbe7d3;
  --accent-gold:   #eec765;
  --accent-amber:  #e6a93e;
  --accent-deep:   #e08549;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --logo-content-fraction: 0.36; /* portion of the header graphic occupied by the logo + dots */

  --max-w: 1080px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
ul, ol { padding-left: 1.2em; }

h1, h2, h3, h4 {
  font-family: var(--font);
  color: var(--heading);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

a {
  color: var(--link);
  text-decoration-color: rgba(224, 133, 73, 0.4);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { text-decoration-color: var(--link); }
a:visited { color: var(--link); }
a:active { color: var(--link-active); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--link-active);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--heading);
  color: var(--bg);
  padding: 0.75em 1.25em;
  z-index: 999;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* =========================================================
   Sticky header — graphic scaled to content width
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.header-image {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.primary-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  /* starts just past the logo + dot graphic, so it never overlaps it */
  left: calc(var(--logo-content-fraction) * 100%);
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1rem, 2.4vw, 2.25rem);
}

.primary-nav a {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--heading);
  text-decoration: none;
  padding: 0.4em 0.1em;
  position: relative;
}
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--link);
  transition: right 0.2s ease;
}
.primary-nav a:hover,
.primary-nav a.is-active {
  color: var(--link);
}
.primary-nav a:hover::after,
.primary-nav a.is-active::after {
  right: 0;
}
.primary-nav a:active { color: var(--link-active); }

.nav-toggle {
  display: none;
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  z-index: 5;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--heading);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* =========================================================
   Sections — shared rhythm
   ========================================================= */
.section {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
  border-bottom: 1px solid var(--line-soft);
  scroll-margin-top: var(--header-h-live, 100px);
}
.section:last-of-type { border-bottom: none; }

.eyebrow {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-amber);
  margin: 0 0 0.9em;
}

.section-title {
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  max-width: 32ch;
}

.section-icon {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0.2rem 1rem 0.6rem 0;
}

.lede {
  font-size: 1.15rem;
  max-width: 62ch;
  color: var(--text);
}

.subhead {
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  margin-top: 2.2em;
}

/* =========================================================
   Hero
   ========================================================= */
.hero { padding-top: clamp(3.5rem, 9vw, 6rem); }

.hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}
.hero-icon {
  flex: 0 0 auto;
  width: 150px;
  height: 150px;
  margin-top: 0.35rem;
}

.hero h1 {
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  max-width: 20ch;
  margin-bottom: 1.1em;
}
.hero h1 span {
  display: block;
  color: var(--link);
  font-size: 0.6em;
  font-weight: 400;
  margin-top: 0.35em;
}

.vision-grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.vision-card {
  background: var(--bg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.vision-card h2 {
  font-size: 1.15rem;
  margin-bottom: 0.6em;
}
.vision-card p { margin-bottom: 0; font-size: 0.98rem; }

.card-icon {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0.15rem 1rem 0.6rem 0;
}

.clear-float { clear: left; }

/* ---------- PDF download note ---------- */
.pdf-note {
  margin-top: 2.25rem;
  font-size: 1.02rem;
  max-width: 62ch;
}

/* =========================================================
   Technology
   ========================================================= */
.data-grid {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.data-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem 1.5rem 1.6rem;
  position: relative;
}
.data-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-deep));
  border-radius: 14px 14px 0 0;
}


.data-tag {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 0.5em;
}
.data-card h4 {
  font-size: 1.08rem;
  margin-bottom: 0.7em;
}
.data-card ul {
  margin: 0;
  padding-left: 1.1em;
  font-size: 0.94rem;
}
.data-card li { margin-bottom: 0.55em; }
.data-card li:last-child { margin-bottom: 0; }

.expansion {
  margin-top: 2.5rem;
  padding: 1.75rem;
  background: linear-gradient(135deg, var(--accent-cream), var(--bg));
  border-radius: 14px;
  border: 1px solid var(--line);
}
.expansion p { margin-bottom: 0; max-width: 68ch; }

/* =========================================================
   Company / team
   ========================================================= */
.group-label {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  border-top: 1px solid var(--line);
  padding-top: 1.75rem;
  margin-top: 2.25rem;
  margin-bottom: 1rem;
}
.group-label--advisory { margin-top: 3rem; }

.team-list {
  display: flex;
  flex-direction: column;
}

.team-member {
  border-bottom: 1px solid var(--line-soft);
}
.team-member:first-child { border-top: 1px solid var(--line-soft); }

.team-toggle {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  background: none;
  border: none;
  text-align: left;
  padding: 1.15rem 0.25rem;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
.team-name {
  font-family: var(--font);
  font-size: 1.1rem;
  color: var(--heading);
  flex: 0 0 auto;
}
.team-role {
  font-size: 0.88rem;
  color: var(--text);
  flex: 1 1 auto;
}
.team-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  position: relative;
}
.team-icon::before,
.team-icon::after {
  content: "";
  position: absolute;
  background: var(--link);
  transition: transform 0.2s ease;
}
.team-icon::before {
  top: 9px; left: 2px; width: 16px; height: 2px;
}
.team-icon::after {
  top: 2px; left: 9px; width: 2px; height: 16px;
}
.team-toggle[aria-expanded="true"] .team-icon::after {
  transform: scaleY(0);
}
.team-toggle:hover .team-name { color: var(--link); }

.team-bio {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.team-bio > p {
  overflow: hidden;
  min-height: 0;
  font-size: 0.96rem;
  padding-right: 2rem;
  margin: 0;
}
.team-member.is-open .team-bio {
  grid-template-rows: 1fr;
  padding-bottom: 1.3rem;
}
/* fallback wrapper so grid-rows trick works */
.team-bio { display: grid; }
.team-bio p { grid-row: 1; grid-column: 1; }

.advisory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.advisory-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
}
.advisory-card h4 {
  font-size: 1.02rem;
  margin-bottom: 0.55em;
}
.advisory-card p {
  font-size: 0.92rem;
  margin-bottom: 0;
}

/* =========================================================
   Publications
   ========================================================= */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  counter-reset: pub;
}
.pub-list li {
  counter-increment: pub;
  position: relative;
  padding: 1.4rem 0 1.4rem 3rem;
  border-top: 1px solid var(--line-soft);
}
.pub-list li:last-child { border-bottom: 1px solid var(--line-soft); }
.pub-list li::before {
  content: counter(pub, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.5rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--accent-amber);
}
.pub-title {
  font-family: var(--font);
  color: var(--heading);
  font-size: 1.05rem;
  margin-bottom: 0.4em;
}
.pub-authors {
  font-size: 0.88rem;
  margin-bottom: 0.4em;
}
.pub-authors strong { color: var(--heading); font-weight: 600; }
.pub-meta {
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: var(--text);
  margin-bottom: 0;
}
.pub-meta a { word-break: break-word; }

/* =========================================================
   Impressum / legal section (fully hidden until opened via footer link)
   ========================================================= */
.legal-section {
  background: var(--bg-alt);
}
.legal-wrap { max-width: 720px; }

.legal-h {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.9em;
  margin-bottom: 0.4em;
  color: var(--heading);
}
.legal-body-inner {
  margin-top: 0.5rem;
}
.legal-body-inner h3.legal-h:first-of-type { margin-top: 0; }

.legal-wrap p {
  font-size: 0.94rem;
  color: var(--text);
}

.legal-back {
  display: inline-block;
  margin-top: 2.5rem;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  padding: 2.5rem 0 3.5rem;
  background: var(--bg-alt);
}

.footer-contact {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.footer-contact p {
  margin: 0 0 0.35em;
  color: var(--text);
}
.footer-contact p:last-child { margin-bottom: 0; }

.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.88rem;
}
.footer-wrap p { margin: 0; }

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-legal-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--link);
  cursor: pointer;
  text-decoration-color: rgba(224, 133, 73, 0.4);
  text-underline-offset: 3px;
  text-decoration-line: underline;
}
.footer-legal-btn:hover { text-decoration-color: var(--link); }
.footer-legal-btn:active { color: var(--link-active); }

.back-to-top {
  font-weight: 600;
  text-decoration: none;
}

/* =========================================================
   Scroll-reveal
   ========================================================= */
.vision-card,
.data-card,
.advisory-card,
.team-member,
.pub-list li {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.vision-card.is-visible,
.data-card.is-visible,
.advisory-card.is-visible,
.team-member.is-visible,
.pub-list li.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .vision-card, .data-card, .advisory-card, .team-member, .pub-list li {
    opacity: 1; transform: none; transition: none;
  }
}

/* =========================================================
   Scroll-to-top button
   ========================================================= */
.scroll-top-btn {
  position: fixed;
  right: clamp(1rem, 4vw, 2rem);
  bottom: clamp(1rem, 4vw, 2rem);
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--link);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(69, 64, 60, 0.25);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.15s ease, color 0.15s ease;
}
.scroll-top-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-top-btn:hover {
  border-color: var(--link);
  color: var(--link-active);
}
.scroll-top-btn:active { color: var(--link-active); }

@media (prefers-reduced-motion: reduce) {
  .scroll-top-btn { transition: opacity 0.2s ease; }
}

@media (max-width: 480px) {
  .scroll-top-btn { width: 42px; height: 42px; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .data-grid { grid-template-columns: 1fr; }
  .advisory-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .vision-grid { grid-template-columns: 1fr; border-radius: 10px; }

  .nav-toggle { display: flex; }

  .primary-nav {
    position: fixed;
    top: var(--header-h-live, 56px);
    left: 0;
    right: 0;
    bottom: auto;
    justify-content: flex-start;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px -12px rgba(0,0,0,0.15);
    padding: 0.5rem 0;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }
  .primary-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .primary-nav a {
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--line-soft);
  }
  .primary-nav a::after { display: none; }

  .team-toggle { flex-wrap: wrap; }
  .team-role { flex-basis: 100%; order: 3; margin-top: 0.2em; }

  .hero-head { gap: 1rem; }
  .hero-icon { width: 90px; height: 90px; }

  .footer-wrap { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .pub-list li { padding-left: 2.4rem; }
}
