/* ==========================================================================
   IP69 OÜ — brand tokens (B2B / tehniline CVI)
   ========================================================================== */
:root {
  --navy: #143558;
  --navy-dark: #0c2540;
  --navy-soft: rgba(20, 53, 88, 0.08);
  --bg: #ffffff;
  --bg-soft: #f3f5f7;
  --bg-soft-2: #eceff2;
  --yellow: #f2db68;
  --yellow-dark: #d9b93a;
  --ink-70: rgba(20, 53, 88, 0.72);
  --ink-50: rgba(20, 53, 88, 0.5);

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-card: 0 10px 28px rgba(20, 53, 88, 0.07);
  --shadow-card-hover: 0 16px 36px rgba(20, 53, 88, 0.12);

  --font-display: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;

  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--navy);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}
p { margin: 0; }
section { position: relative; }

/* Minimal accent link underline (accent used sparingly, per CVI) */
.accent-link {
  text-underline-offset: 4px;
  text-decoration: underline;
  text-decoration-color: var(--yellow-dark);
  text-decoration-thickness: 2px;
  transition: color 0.2s ease;
}
.accent-link:hover { color: var(--navy); text-decoration-color: var(--navy); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--bg);
  padding: 7px 15px 7px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--navy);
}
.eyebrow .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--yellow-dark);
  flex: none;
  animation: pulseDot 1.8s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.section-dark .eyebrow { background: transparent; border-color: rgba(242,239,228,0.6); color: #f2efe4; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: padding 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-header.scrolled {
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 18px rgba(20,53,88,0.07);
  border-bottom: 1px solid var(--bg-soft-2);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 40px; width: auto; transition: height 0.3s ease; }
.site-header.scrolled .brand img { height: 32px; }

.main-nav { display: flex; align-items: center; gap: 34px; }
.main-nav a {
  font-weight: 600;
  font-size: 15px;
  position: relative;
  padding: 4px 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--yellow-dark);
  transition: width 0.25s ease;
}
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 14px; }
.phone-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14.5px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--navy);
  transition: background 0.25s, color 0.25s;
}
.phone-chip:hover { background: var(--navy); color: var(--bg); }
.phone-chip svg { width: 15px; height: 15px; }

.menu-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--navy);
  background: var(--bg);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.menu-toggle .bars { position: relative; display: inline-block; width: 18px; height: 12px; }
.menu-toggle .bars i { position: absolute; left:0; right:0; height: 2px; background: var(--navy); border-radius: 2px; transition: all 0.25s ease; }
.menu-toggle .bars i:nth-child(1){ top:0; }
.menu-toggle .bars i:nth-child(2){ top:5px; }
.menu-toggle .bars i:nth-child(3){ top:10px; }
.menu-toggle.open .bars i:nth-child(1){ transform: translateY(5px) rotate(45deg); }
.menu-toggle.open .bars i:nth-child(2){ opacity:0; }
.menu-toggle.open .bars i:nth-child(3){ transform: translateY(-5px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: 172px 0 108px; position: relative; overflow: hidden; }

.hero-bg-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--navy) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  opacity: 0.05;
  pointer-events: none;
}

.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }

.hero h1 { font-size: clamp(34px, 4.6vw, 58px); margin-top: 20px; }
.hero h1 .u { border-bottom: 3px solid var(--yellow-dark); padding-bottom: 2px; }

.hero p.lead {
  font-size: 18.5px;
  line-height: 1.62;
  color: var(--ink-70);
  max-width: 560px;
  margin-top: 22px;
}

.hero-trust { display: flex; gap: 30px; margin-top: 46px; flex-wrap: wrap; }
.hero-trust div { display:flex; flex-direction: column; padding-left: 14px; border-left: 2px solid var(--bg-soft-2); }
.hero-trust strong { font-family: var(--font-display); font-size: 16.5px; font-weight: 700; }
.hero-trust span { font-size: 13px; color: var(--ink-50); font-weight: 500; margin-top: 3px; }

.hero-art { position: relative; display: flex; align-items: center; justify-content: center; }
.hero-art-ring {
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  border: 1.5px dashed var(--navy);
  opacity: 0.18;
  animation: spin 42s linear infinite;
}
.hero-art-ring.r2 { width: 306px; height: 306px; animation-duration: 32s; animation-direction: reverse; opacity: 0.14; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-art img {
  position: relative;
  width: 280px;
  filter: drop-shadow(0 20px 34px rgba(20,53,88,0.16));
  animation: floaty 5.5s ease-in-out infinite;
}
@keyframes floaty { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-12px); } }

.hero-badge {
  position: absolute;
  bottom: 4px; right: 0;
  background: var(--navy);
  color: #f2efe4;
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 22px rgba(20,53,88,0.22);
}
.hero-badge .bulb { width: 8px; height:8px; border-radius:50%; background: var(--yellow); box-shadow: 0 0 8px 2px rgba(242,219,104,0.7); animation: bulbPulse 1.6s ease-in-out infinite;}
@keyframes bulbPulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* ==========================================================================
   Section divider
   ========================================================================== */
.divider { display: block; width: 100%; height: 40px; margin: 0; }
.divider path { stroke: var(--bg-soft-2); stroke-width: 2.5; fill: none; }

/* ==========================================================================
   Section shells
   ========================================================================== */
.section { padding: 104px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 640px; margin: 0 0 52px; }
.section-head h2 { font-size: clamp(27px, 3.4vw, 40px); margin-top: 16px; }
.section-head p { margin-top: 16px; font-size: 16.5px; color: var(--ink-70); line-height: 1.6; }

.section-dark { background: var(--navy-dark); color: #f2efe4; }
.section-dark .section-head p { color: rgba(242,239,228,0.72); }
.section-dark h2 { color: #f2efe4; }

/* ==========================================================================
   Services
   ========================================================================== */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.service-card {
  background: var(--bg);
  border: 1.5px solid var(--bg-soft-2);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--navy);
}

.service-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: var(--bg-soft);
  border: 1.5px solid var(--bg-soft-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s, transform 0.3s;
}
.service-card:hover .service-icon { border-color: var(--yellow-dark); transform: scale(1.05); }
.service-icon svg { width: 30px; height: 30px; stroke: var(--navy); }

.service-head { display: flex; flex-direction: column; gap: 6px; }
.service-card h3 { font-size: 18.5px; }
.service-kicker { font-size: 13.5px; font-weight: 700; color: var(--navy); opacity: 0.55; }
.service-card p { font-size: 14.5px; line-height: 1.58; color: var(--ink-70); }
.service-tag {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--navy);
  opacity: 0.5;
}
.service-tag::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--yellow-dark);
  opacity: 0.9;
}

/* ==========================================================================
   Koostöö (partnership / systems diagram)
   ========================================================================== */
.koostoo-grid { display: grid; grid-template-columns: 1fr 0.9fr; gap: 56px; align-items: center; }
.koostoo-copy .section-head { margin-bottom: 0; }
.koostoo-copy p.body-text {
  margin-top: 20px;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink-70);
  max-width: 560px;
}

.diagram-wrap { display: flex; align-items: center; justify-content: center; }
.diagram-wrap svg { width: 100%; max-width: 460px; height: auto; }
.diagram-node-label {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  fill: var(--navy);
}
.diagram-line { stroke: var(--navy); stroke-width: 1.5; stroke-dasharray: 3 5; opacity: 0.5; fill:none; }
.diagram-node-circle { fill: var(--bg); stroke: var(--navy); stroke-width: 1.5; }
.diagram-node-icon { stroke: var(--navy); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.diagram-hub-circle { fill: var(--navy); }
.diagram-hub-icon { stroke: #f2efe4; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.diagram-hub-dot { fill: var(--yellow); animation: bulbPulse 1.8s ease-in-out infinite; }

/* ==========================================================================
   Kontakt
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 0.85fr; gap: 50px; align-items: center; }
.contact-copy h2 { font-size: clamp(28px, 3.6vw, 42px); }
.contact-copy p.lead { margin-top: 18px; font-size: 16.5px; color: var(--ink-70); max-width: 460px; line-height: 1.6; }

.contact-card {
  border: 1.5px solid var(--bg-soft-2);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  padding: 8px 8px;
}
.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--bg-soft-2);
}
.contact-row:last-child { border-bottom: none; }
.contact-row dt {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-50);
  flex: none;
}
.contact-row dd {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  text-align: right;
}
.contact-row dd a:hover { color: var(--navy); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--navy-dark); color: #f2efe4; padding: 64px 0 28px; }
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(242,239,228,0.14);
}
.footer-brand img { height: 82px; }

.footer-cols { display: flex; gap: 70px; flex-wrap: wrap; }
.footer-col h5 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(242,239,228,0.48); margin-bottom: 14px; font-weight: 700;}
.footer-col a, .footer-col p { display: block; font-size: 14.5px; margin-bottom: 9px; color: rgba(242,239,228,0.88); }
.footer-col a:hover { color: var(--yellow); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  font-size: 12.5px;
  color: rgba(242,239,228,0.45);
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: translateY(0); transition-delay: var(--d, 0s); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; margin-bottom: 10px; }
  .hero { padding-top: 150px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .koostoo-grid { grid-template-columns: 1fr; gap: 40px; }
  .diagram-wrap { order: -1; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .section { padding: 72px 0; }
  .services-grid { grid-template-columns: 1fr; }
  .hero { padding: 126px 0 64px; }
  .hero-trust { flex-direction: column; gap: 18px; }
  .footer-cols { gap: 34px; }
  .contact-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .contact-row dd { text-align: left; }
}

/* Mobile nav sheet */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transform: translateY(-100%);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.mobile-nav.open { transform: translateY(0); }
.mobile-nav a { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
