/* ============================================================
   matthiasgrimmer.com — style
   Adapted from RadonMonitor/project-website/styles.css
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #edf3f8;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: #162231;
  --ink-soft: #3d5a73;
  --line: rgba(37, 59, 85, 0.1);
  --brand: #0082ba;
  --brand-dark: #253B55;
  --accent: #2391c9;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.6rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: #ffffff;
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- Sticky top navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, #162231 0%, #253B55 55%, #1a2f45 100%);
  border-bottom: none;
}

.site-nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  height: 5.2rem;
  padding: 0.5rem clamp(1.25rem, 4vw, 3rem);
  position: relative;
}

.site-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.4rem;
  flex-wrap: nowrap;
  justify-content: center;
}

.site-nav-list a {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease;
}

.site-nav-list a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.site-nav-list a.is-active {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.site-nav-toggle {
  display: none;
  position: absolute;
  right: clamp(1.25rem, 4vw, 3rem);
  top: 50%;
  transform: translateY(-50%);
  width: 2.6rem;
  height: 2.6rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: 60;
}

.site-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
}

@media (max-width: 860px) {
  .site-nav-list {
    display: none;
    position: absolute;
    top: 5.2rem;
    left: 0;
    right: 0;
    background: #253B55;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    padding: 0.4rem 0.5rem 0.6rem;
    flex-direction: column;
    gap: 0;
    z-index: 55;
  }
  .site-nav.is-open .site-nav-list {
    display: flex;
  }
  .site-nav-list li + li {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .site-nav-list a {
    display: block;
    padding: 1rem 1rem;
    color: rgba(255, 255, 255, 0.95);
    white-space: normal;
    border-radius: 0;
    font-size: 1rem;
  }
  .site-nav-list a:hover,
  .site-nav-list a.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }
  .site-nav-toggle {
    display: inline-flex;
  }
}

/* ---------- Full-viewport hero stage ---------- */
.hero-stage {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 5.2rem);
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  overflow: hidden;
}

.hero-stage-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 1100px;
  width: 100%;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.6rem, 9vw, 6.4rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero-subtitle {
  margin: 1.6rem auto 0;
  max-width: 720px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.65;
}

.hero-scroll-cue {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  z-index: 2;
  animation: scrollCue 2s ease-in-out infinite;
}

.hero-scroll-cue span {
  display: block;
  width: 18px;
  height: 18px;
  border-right: 2.5px solid var(--brand);
  border-bottom: 2.5px solid var(--brand);
  transform: rotate(45deg);
  background: none;
}

.hero-scroll-cue span:nth-child(2) {
  opacity: 0.45;
  margin-top: -10px;
}

@keyframes scrollCue {
  0%   { transform: translateX(-50%) translateY(0); opacity: 0.9; }
  50%  { transform: translateX(-50%) translateY(7px); opacity: 1; }
  100% { transform: translateX(-50%) translateY(0); opacity: 0.9; }
}

/* Rising bubbles in hero */
.hero-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 28%, transparent 55%);
          mask-image: linear-gradient(to top, #000 0%, #000 28%, transparent 55%);
}

.hero-bubble {
  position: absolute;
  bottom: -180px;
  border-radius: 999px;
  background: radial-gradient(circle at 32% 30%, #e8f4fb 0%, #b3d9f0 55%, #7dc3e8 100%);
  filter: drop-shadow(0 4px 10px rgba(0, 130, 186, 0.22));
  opacity: 0;
  animation: heroBubbleRise linear infinite;
  background-repeat: no-repeat;
  background-position: center center;
}

/* Resistor */
.hero-bubble.bubble-1,
.hero-bubble.bubble-6 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none' stroke='%230082ba' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='30' y1='4' x2='30' y2='16'/%3E%3Crect x='17' y='16' width='26' height='28' rx='3'/%3E%3Cline x1='30' y1='44' x2='30' y2='56'/%3E%3C/svg%3E");
}

/* Capacitor */
.hero-bubble.bubble-2,
.hero-bubble.bubble-7 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none' stroke='%230082ba' stroke-width='3.5' stroke-linecap='round'%3E%3Cline x1='30' y1='4' x2='30' y2='26'/%3E%3Cline x1='10' y1='26' x2='50' y2='26'/%3E%3Cline x1='10' y1='34' x2='50' y2='34'/%3E%3Cline x1='30' y1='34' x2='30' y2='56'/%3E%3C/svg%3E");
}

/* Transistor (NPN) */
.hero-bubble.bubble-3,
.hero-bubble.bubble-8 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none' stroke='%230082ba' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='22' y1='14' x2='22' y2='46'/%3E%3Cline x1='6' y1='30' x2='22' y2='30'/%3E%3Cline x1='22' y1='22' x2='46' y2='10'/%3E%3Cline x1='22' y1='38' x2='46' y2='50'/%3E%3Cpolygon points='37,13 46,10 40,20' fill='%230082ba' stroke='none'/%3E%3C/svg%3E");
}

/* IC chip */
.hero-bubble.bubble-4,
.hero-bubble.bubble-9 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none' stroke='%230082ba' stroke-width='3.5' stroke-linecap='round'%3E%3Crect x='18' y='14' width='24' height='32' rx='3'/%3E%3Cline x1='4' y1='22' x2='18' y2='22'/%3E%3Cline x1='4' y1='30' x2='18' y2='30'/%3E%3Cline x1='4' y1='38' x2='18' y2='38'/%3E%3Cline x1='42' y1='22' x2='56' y2='22'/%3E%3Cline x1='42' y1='30' x2='56' y2='30'/%3E%3Cline x1='42' y1='38' x2='56' y2='38'/%3E%3C/svg%3E");
}

/* Inductor */
.hero-bubble.bubble-5 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none' stroke='%230082ba' stroke-width='3.5' stroke-linecap='round'%3E%3Cline x1='30' y1='4' x2='30' y2='16'/%3E%3Cpath d='M30 16 Q38 16 38 24 Q38 32 30 32 Q22 32 22 40 Q22 48 30 48'/%3E%3Cline x1='30' y1='48' x2='30' y2='56'/%3E%3C/svg%3E");
}

.hero-bubble.bubble-1 { width: 32px;  height: 32px;  left: 6%;  animation-duration: 11s; animation-delay: -1s; }
.hero-bubble.bubble-2 { width: 22px;  height: 22px;  left: 16%; animation-duration: 9s;  animation-delay: -4s; }
.hero-bubble.bubble-3 { width: 48px;  height: 48px;  left: 28%; animation-duration: 14s; animation-delay: -2s; }
.hero-bubble.bubble-4 { width: 28px;  height: 28px;  left: 42%; animation-duration: 10s; animation-delay: -6s; }
.hero-bubble.bubble-5 { width: 40px;  height: 40px;  left: 54%; animation-duration: 13s; animation-delay: -8s; }
.hero-bubble.bubble-6 { width: 24px;  height: 24px;  left: 66%; animation-duration: 9.5s; animation-delay: -3s; }
.hero-bubble.bubble-7 { width: 36px;  height: 36px;  left: 76%; animation-duration: 12s; animation-delay: -5s; }
.hero-bubble.bubble-8 { width: 18px;  height: 18px;  left: 86%; animation-duration: 8.5s; animation-delay: -7s; }
.hero-bubble.bubble-9 { width: 30px;  height: 30px;  left: 92%; animation-duration: 11.5s; animation-delay: -2.5s; }

@keyframes heroBubbleRise {
  0%   { transform: translateY(0)      scale(0.7);  opacity: 0; }
  10%  { opacity: 0.85; }
  60%  { opacity: 0.7; }
  100% { transform: translateY(-115vh) scale(1.1);  opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bubble,
  .hero-scroll-cue { animation: none; }
  .hero-bubble { opacity: 0.55; }
}

/* ---------- Sections ---------- */
main {
  width: 100%;
}

.section {
  width: 100%;
  padding: clamp(4rem, 8vh, 7rem) clamp(1.25rem, 4vw, 3rem);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

main > .section:nth-of-type(even) {
  background: var(--bg-alt);
}

.section > * {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.15;
  font-weight: 700;
}

.section h2 {
  font-size: clamp(2rem, 5.5vw, 4rem);
  line-height: 1.08;
  margin-bottom: 3.4rem;
  letter-spacing: -0.02em;
  text-align: center;
  position: relative;
}

.section h2::after {
  content: '';
  position: absolute;
  bottom: -1rem;
  left: 50%;
  transform: translateX(-50%);
  height: 2px;
  width: 3rem;
  border-radius: 99px;
  background: var(--brand);
}

.section .subsection-heading {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-top: 3.5rem;
  margin-bottom: 1rem;
  color: var(--ink);
}

.workflow-intro,
.section > p {
  margin: 0 auto 1.5rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  text-align: center;
}

/* ---------- Feature grid & cards ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.feature-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.15rem;
  transition: box-shadow 170ms ease;
}

.feature-card:hover {
  box-shadow: 0 4px 16px rgba(37, 59, 85, 0.06);
}

.feature-card .icon {
  display: block;
  font-size: 1.6rem;
  color: var(--brand);
  margin-bottom: 0.6rem;
  line-height: 1;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
  text-align: center;
}

.feature-card .icon {
  font-size: 2rem;
  color: var(--brand);
  display: block;
  margin-bottom: 0.7rem;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1.5px solid var(--brand);
  color: var(--brand);
  background: transparent;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
  margin-right: 0.3rem;
  margin-top: 0.4rem;
}

.button:hover {
  background: var(--brand);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ---------- Contact section ---------- */
.contact-card {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.contact-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1.4rem;
  color: var(--ink);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  text-align: left;
}

.contact-list li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem;
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
}

.contact-list li:first-child {
  border-top: none;
  padding-top: 0;
  grid-template-columns: 1fr;
  text-align: center;
}

.contact-list h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--brand-dark);
  opacity: 0.7;
  margin: 0;
  padding-top: 0.15rem;
}

.contact-list a {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 600;
}

.contact-list a:hover {
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.footer {
  padding: 1.8rem clamp(1.25rem, 4vw, 3rem);
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.92rem;
}

.footer a {
  color: var(--brand-dark);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .section {
    min-height: auto;
    padding: clamp(2.5rem, 7vh, 4rem) 1rem;
  }
  .hero-stage {
    padding: 1.5rem 1rem 3rem;
    min-height: calc(100svh - 5.2rem);
  }
  .section h2 {
    font-size: clamp(1.7rem, 6.5vw, 2.4rem);
    margin-bottom: 2.6rem;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .contact-list li {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-stage {
    padding: 1rem 0.85rem 2.2rem;
  }
  .hero-title {
    font-size: clamp(1.9rem, 10vw, 2.8rem);
  }
  .section {
    padding: 2.2rem 0.85rem 2.5rem;
  }
}
