@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ===================== RESET & BASE ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #c0392b;
  --primary-dark: #8e1b10;
  --primary-mid:  #a83226;
  --primary-lite: #e74c3c;
  --bg:           #f4f5f7;
  --surface:      #ffffff;
  --text:         #1e293b;
  --muted:        #64748b;
  --border:       #e2e8f0;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.09);
  --shadow-lg:    0 12px 40px rgba(0,0,0,0.13);
  --radius:       10px;
  --radius-lg:    18px;
  --font:         'Inter', 'Segoe UI', system-ui, sans-serif;
  --max-w:        1100px;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); }

/* ===================== HEADER / NAV ===================== */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(to right, rgba(195, 60, 40, 0.96) 0%, rgba(90, 10, 3, 0.99) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 24px rgba(0,0,0,0.22);
  overflow: visible; /* sallii mobiilinavin ulottua headerin ulkopuolelle */
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo { height: 42px; filter: brightness(0) invert(1); }

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 0.15rem;
}

.nav-links > li > a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.915rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: 7px;
  transition: background 0.18s, color 0.18s;
  display: block;
}

.nav-links > li > a:hover { background: rgba(255,255,255,0.13); color: #fff; }

/* CTA button in nav */
.nav-cta > a {
  background: rgba(255,255,255,0.16) !important;
  color: #fff !important;
  font-weight: 600 !important;
  border: 1px solid rgba(255,255,255,0.28);
}
.nav-cta > a:hover { background: rgba(255,255,255,0.26) !important; }

/* ---- Dropdown ---- */
.dropdown { position: relative; }

.dropdown > a::after { content: ' ▾'; font-size: 0.72rem; opacity: 0.65; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  /* 10px transparent bridge — hiiri ei putoa väliin */
  padding: 10px 0.4rem 0.4rem 0.4rem;
  background: transparent;
  min-width: 215px;
  flex-direction: column;
  gap: 2px;
}

/* Näkyvä valkoinen boksi alkaa bridgen jälkeen */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: 10px; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: -1;
}

/* Hover toimii vain laitteissa joissa on oikea hiiri */
@media (hover: hover) {
  .dropdown:hover .dropdown-menu { display: flex; }
}

/* JS-toggle toimii kaikilla laitteilla */
.dropdown.open .dropdown-menu { display: flex; }

.dropdown-menu li a {
  color: var(--text) !important;
  font-size: 0.9rem;
  font-weight: 400;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  display: block;
  transition: background 0.14s, color 0.14s;
}

.dropdown-menu li a:hover { background: var(--bg); color: var(--primary) !important; }

/* ---- Hamburger ---- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px;
}

.hamburger span {
  display: block;
  width: 23px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: 0.3s var(--ease);
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===================== HERO ===================== */
.hero {
  position: relative;
  min-height: 540px;
  display: flex;
  align-items: center;
  background: linear-gradient(140deg, var(--primary-dark) 0%, var(--primary-mid) 55%, var(--primary-lite) 100%);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('DSC_0225.JPG') center/cover no-repeat;
  opacity: 0.13;
}

.hero-content {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5.5rem 1.5rem;
  color: white;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.28);
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 1.3rem;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  max-width: 740px;
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.87;
  max-width: 580px;
  line-height: 1.72;
  margin-bottom: 2.25rem;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.82rem 1.65rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s var(--ease);
  cursor: pointer;
  border: none;
  font-family: var(--font);
}

.btn-white  { background: #fff; color: var(--primary); }
.btn-white:hover  { background: #f2f2f2; transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.48); }
.btn-outline:hover { background: rgba(255,255,255,0.12); border-color: #fff; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ===================== LAYOUT ===================== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

.section    { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }

.section-tag {
  display: inline-block;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.65rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.section-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 620px;
  line-height: 1.72;
  margin-bottom: 3rem;
}

/* ===================== SERVICE CARDS ===================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.service-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(to bottom, var(--primary), var(--primary-lite));
  opacity: 0;
  transition: opacity 0.25s;
}

.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.service-card:hover::before { opacity: 1; }

.service-card-icon {
  width: 50px; height: 50px;
  background: linear-gradient(135deg, rgba(192,57,43,0.1), rgba(231,76,60,0.14));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--primary);
}

.service-card h3 { font-size: 1.08rem; font-weight: 600; margin-bottom: 0.55rem; }
.service-card p  { font-size: 0.9rem; color: var(--muted); line-height: 1.65; margin-bottom: 1.25rem; }

.card-link {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ===================== PAGE HERO (subpages) ===================== */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-mid));
  color: white;
  padding: 3.5rem 0;
}

.page-hero h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.page-hero p { font-size: 1.02rem; opacity: 0.84; max-width: 600px; }

/* ===================== CONTENT CARDS ===================== */
.content-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.content-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.content-card p {
  color: var(--muted);
  line-height: 1.78;
  margin-bottom: 1rem;
}

.content-card p:last-child { margin-bottom: 0; }

.content-card ul {
  padding-left: 1.25rem;
  color: var(--muted);
}

.content-card ul li { margin-bottom: 0.5rem; line-height: 1.65; }

/* ---- Tech grid (ohjelmistot) ---- */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.tech-item {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.tech-item-dot {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- CTA banner ---- */
.cta-banner {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-mid));
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 2.5rem 0;
}

.cta-banner h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.3rem; }
.cta-banner p  { opacity: 0.83; font-size: 0.93rem; }

/* ===================== CONTACT ===================== */
.contact-bg { background: var(--surface); }

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.contact-info-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.contact-info-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.contact-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.4rem;
  align-items: flex-start;
}

.contact-row-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, rgba(192,57,43,0.1), rgba(231,76,60,0.13));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.2rem;
}

.contact-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.55;
}

.contact-value a { color: var(--primary); text-decoration: none; }
.contact-value a:hover { text-decoration: underline; }

.billing-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  margin-top: 1.5rem;
}

.billing-box h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.billing-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.87rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.billing-row:last-child { border-bottom: none; }
.billing-row span:first-child { color: var(--muted); }

.owner-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.owner-name {
  margin-top: 1rem;
  font-weight: 600;
  font-size: 1rem;
}

.owner-title {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.15rem;
}

/* ===================== FORM ===================== */
.form-wrap {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  max-width: 640px;
  margin: 0 auto;
}

.form-wrap h2 { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 0.4rem; }
.form-desc { color: var(--muted); font-size: 0.93rem; margin-bottom: 2rem; }

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.87rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}

textarea.form-control { resize: vertical; min-height: 145px; }

/* ===================== FOOTER ===================== */
footer {
  background: #0f172a;
  color: rgba(255,255,255,0.55);
  padding: 3.5rem 0 1.75rem;
  margin-top: 5rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.footer-brand-desc {
  font-size: 0.88rem;
  line-height: 1.65;
  margin-top: 0.9rem;
  max-width: 280px;
}

.footer-logo { height: 36px; filter: brightness(0) invert(1); opacity: 0.8; }

.footer-col h4 {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.38);
  margin-bottom: 0.85rem;
}

.footer-col ul { list-style: none; }

.footer-col a {
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 2.1;
  transition: color 0.18s;
}

.footer-col a:hover { color: white; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.83rem;
}

/* ===================== SCROLL REVEAL ===================== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.reveal.visible { opacity: 1; transform: none; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-top > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }

  /* Nav: absoluuttinen headerin alla — sticky header pitää sen aina näytön yläreunassa */
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-height: calc(100vh - 68px);
    background: #3e0400;
    overflow-y: auto;
    z-index: 9999;
  }

  nav.open { display: block; }

  /* Linkkikontti täyttää nav-alueen ja scrollaa tarvittaessa */
  .nav-links {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 1rem;
    min-height: calc(100% - 68px);
  }

  /* Jokainen päälinkin kohta */
  .nav-links > li > a {
    font-size: 1.15rem;
    font-weight: 500;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    color: rgba(255,255,255,0.9) !important;
    display: block;
  }

  .nav-links > li > a:hover,
  .nav-links > li > a:active {
    background: rgba(255,255,255,0.1);
    color: white !important;
  }

  /* Chevron-suunta */
  .dropdown > a::after { content: ' ▸'; }
  .dropdown.open > a::after { content: ' ▾'; }

  /* Alavalikko mobiilissa: accordionina suoraan alla */
  .dropdown-menu {
    position: static;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 0.4rem 0.5rem 0.4rem 1.25rem;
    margin: 0.25rem 0 0.5rem 0;
    background: transparent;
    border-left: 2px solid rgba(255,255,255,0.18);
    min-width: 0; /* ylikirjoitetaan desktop min-width */
  }

  /* Poistetaan desktop-pseudo-elementti mobiilissa */
  .dropdown-menu::before { display: none; }

  .dropdown-menu li { list-style: none; }

  .dropdown-menu li a {
    color: rgba(255,255,255,0.82) !important;
    font-size: 1.05rem !important;
    font-weight: 400 !important;
    padding: 0.85rem 1rem !important;
    border-radius: 8px;
    display: block;
    background: rgba(255,255,255,0.03);
  }

  .dropdown-menu li a:hover,
  .dropdown-menu li a:active {
    background: rgba(255,255,255,0.1) !important;
    color: white !important;
  }

  .nav-cta { display: none; }

  .contact-wrapper { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; }

  .footer-top { grid-template-columns: 1fr; }
  .footer-top > :first-child { grid-column: auto; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .card-grid  { grid-template-columns: 1fr; }
  .tech-grid  { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}
