/* =========================================================
   Nurkkala Kodit Oy — design tokens
   Palette derived from the approved Nurkkala Kodit logo.
========================================================= */
:root {
  --ink: #102624;
  --muted: #526562;
  --bg: #ffffff;
  --bg-alt: #f3f8f7;
  --card-bg: #ffffff;
  --line: #cadbd8;

  --accent: #004241;
  --accent-dark: #003534;
  --accent-soft: #e7f3f1;
  --accent-ink: #003b3a;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 8px 20px rgba(0, 66, 65, 0.07);
  --shadow-md: 0 20px 50px rgba(0, 66, 65, 0.11);
  --shadow-lg: 0 30px 80px rgba(0, 66, 65, 0.16);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-height: 76px;
  --container-width: 1120px;
}

/* =========================================================
   Reset & base
========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

main {
  flex: 1;
  width: 100%;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #73b9b1;
  outline-offset: 3px;
}

/* Anchor targets should not hide under the fixed header */
section[id],
main [id] {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.container {
  width: min(var(--container-width), calc(100% - 40px));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  width: auto;
  height: auto;
  padding: 12px 18px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

.lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
}

/* =========================================================
   Buttons
========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  min-height: 48px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.btn-block {
  width: 100%;
}

/* =========================================================
   Header / nav
========================================================= */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}

.nav-links a:hover {
  color: var(--accent-dark);
}

.nav-links a[aria-current="page"] {
  color: var(--accent-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-switch {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
}

.lang-switch a {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
}

.lang-switch a[aria-current="true"] {
  background: var(--ink);
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span::before {
  position: absolute;
  top: -6px;
}

.nav-toggle span::after {
  position: absolute;
  top: 6px;
}

.nav-toggle[aria-expanded="true"] span {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] span::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* =========================================================
   Hero
========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--header-height) + 64px) 0 72px;
  background: linear-gradient(150deg, #f8fbfa 0%, #edf6f4 55%, #d9ebe7 100%);
}

.hero::after {
  content: "";
  position: absolute;
  top: -120px;
  right: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(0, 66, 65, 0.10);
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 40px;
}

.hero h1 {
  font-size: clamp(2.1rem, 1.7rem + 2.2vw, 3.4rem);
  overflow-wrap: break-word;
  hyphens: auto;
}

@media (min-width: 640px) {
  .hero h1 {
    max-width: 18ch;
    hyphens: manual;
  }
}

.hero-sub {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
  font-weight: 600;
  color: var(--accent-ink);
  margin-bottom: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.tagline {
  display: inline-flex;
  margin: -6px 0 22px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
}

/* =========================================================
   Sections (shared rhythm)
========================================================= */
.section {
  padding: clamp(56px, 6vw, 96px) 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 720px;
  margin-bottom: 40px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 1.4rem + 1vw, 2.25rem);
}

/* Icon chip used across cards */
.icon-chip {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.icon-chip svg {
  width: 26px;
  height: 26px;
}

/* Card grid: "Yrityksille" */
.card-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  display: block;
  min-height: 100%;
  padding: 28px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.card p {
  color: var(--muted);
  margin-bottom: 0;
  font-size: 0.96rem;
}

/* Areas / location chips */
.location-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.location-chip {
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
}

.areas-layout {
  display: grid;
  gap: 32px;
  align-items: center;
}

@media (min-width: 860px) {
  .areas-layout {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.areas-map-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 28px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  isolation: isolate;
}

.areas-map-card::before,
.areas-map-card::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(0, 66, 65, 0.16);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.areas-map-card::before {
  width: 260px;
  height: 260px;
  right: -76px;
  top: -100px;
}

.areas-map-card::after {
  width: 150px;
  height: 150px;
  left: -48px;
  bottom: -72px;
  background: rgba(0, 66, 65, 0.04);
}

.areas-map-card .location-chips {
  position: relative;
  z-index: 1;
  justify-content: center;
}

/* Narrower reading column for the "Yritys" / "Company" section */
.narrow-copy {
  max-width: 62ch;
  margin-inline: auto;
  text-align: center;
}

.narrow-copy .lede {
  margin-inline: auto;
}

.privacy-copy {
  text-align: left;
}

.privacy-section {
  padding-top: calc(var(--header-height) + 32px);
}

.privacy-copy h1 {
  margin-bottom: 1em;
  font-size: clamp(2rem, 1.6rem + 1.5vw, 3rem);
}

.privacy-copy h2 {
  margin-top: 1.6em;
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
}

.privacy-copy a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-copy .eyebrow {
  margin-bottom: 16px;
}

.privacy-copy ul {
  margin: 0 0 1em;
  padding-left: 1.4em;
  list-style: disc;
}

.privacy-copy li + li {
  margin-top: 0.25em;
}

/* Process steps */
.steps {
  display: grid;
  gap: 16px;
  align-items: center;
  counter-reset: step;
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
  }
}

.step-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transform: rotate(90deg);
}

.step-connector svg {
  width: 26px;
  height: 26px;
}

@media (min-width: 720px) {
  .step-connector {
    transform: none;
  }
}

.step {
  position: relative;
  padding: 30px 26px 26px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.step h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.step p {
  color: var(--muted);
  margin-bottom: 0;
  font-size: 0.96rem;
}

/* =========================================================
   Contact / CTA section
========================================================= */
.contact-layout {
  display: grid;
  gap: 36px;
}

@media (min-width: 900px) {
  .contact-layout {
    grid-template-columns: 1fr 1.1fr;
  }
}

.contact-intro h2 {
  font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.4rem);
}

.contact-form-card {
  padding: 32px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.form-notice {
  margin-bottom: 20px;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid #c6ded9;
  border-radius: var(--radius-sm);
}

.contact-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-turnstile {
  min-height: 65px;
  margin-bottom: 18px;
}

.form-privacy {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.85rem;
}

.form-privacy a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-row {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.form-row label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.form-row .optional {
  font-weight: 500;
  color: var(--muted);
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-row input:focus-visible,
.form-row textarea:focus-visible {
  outline: 3px solid #73b9b1;
  outline-offset: 2px;
}

.form-row textarea {
  min-height: 120px;
  resize: vertical;
}

.two-col {
  display: grid;
  gap: 18px;
}

@media (min-width: 520px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.form-status {
  margin-top: 16px;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: none;
  border: 1px solid transparent;
}

.form-status.is-visible {
  display: block;
}

.form-status.is-success {
  color: #0f5132;
  background: #e7f7ee;
  border-color: #b9e6cb;
}

.form-status.is-error {
  color: #7a271a;
  background: #fdecea;
  border-color: #f2b8b0;
}

.form-status.is-info {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: #c6ded9;
}

/* =========================================================
   Closing CTA
========================================================= */
.closing-cta {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f8f6 0%, #dfeeea 100%);
  border-block: 1px solid #d1e5e0;
}

.closing-cta::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  right: -120px;
  bottom: -180px;
  border: 1px solid rgba(0, 66, 65, 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.closing-cta .container {
  position: relative;
  z-index: 1;
}

.closing-cta-inner {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.closing-cta-inner h2 {
  font-size: clamp(1.8rem, 1.5rem + 1.4vw, 2.6rem);
}

.closing-cta-inner .lede {
  margin: 0 auto 26px;
}

/* =========================================================
   Footer
========================================================= */
.site-footer {
  padding: 56px 0 32px;
  background: var(--accent);
  color: rgba(255, 255, 255, 0.72);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-logo {
  width: min(280px, 72vw);
  height: auto;
  margin-bottom: 12px;
}

.footer-tagline {
  max-width: 42ch;
  font-size: 0.92rem;
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 14px;
  font-size: 0.92rem;
}

.footer-contact a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-contact a:hover {
  color: #fff;
}

.company-info {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 20px 0;
  padding: 20px 22px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.company-info .icon-chip {
  flex-shrink: 0;
  margin-bottom: 0;
}

.company-info-text {
  display: grid;
  gap: 4px;
  font-size: 0.92rem;
  color: var(--muted);
}

.company-info-text strong {
  color: var(--ink);
  font-size: 1rem;
}

.contact-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

@media (max-width: 899px) {
  .company-info .contact-list {
    margin-left: -68px;
  }
}

.contact-person {
  display: grid;
  gap: 2px;
}

.contact-person-name {
  color: var(--ink);
  font-weight: 700;
}

.contact-link {
  width: fit-content;
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.contact-link:hover {
  color: var(--accent-dark);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding-top: 20px;
  font-size: 0.82rem;
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================================
   Responsive: mobile nav
========================================================= */
@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 20px 22px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 10px 0;
  }

  .header-actions .btn-primary {
    display: none;
  }
}

@media (max-width: 519px) {
  .card,
  .step,
  .contact-form-card {
    padding: 24px;
  }
}

@media (min-width: 861px) {
  .mobile-only {
    display: none;
  }
}

/* =========================================================
   Scroll reveal (progressive enhancement)
   The hidden starting state only applies once main.js has
   confirmed IntersectionObserver support and added
   .js-reveal to <body> — without JS, or with reduced motion
   requested, everything stays fully visible by default.
========================================================= */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .js-reveal [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
  }
}
