/* ============================================================
   Greentick.fi — main.css
   Single stylesheet for the entire site (no framework).
   Spec: master plan §4 (Brand & design system).
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Brand */
  --green-900: #0F3D2E;
  --green-700: #1F7A55;
  --green-500: #2FA577;
  --green-100: #E6F4EC;

  /* Neutral */
  --ink-900: #0B1410;
  --ink-700: #2D3A33;
  --ink-500: #6B7872;
  --ink-200: #E5E9E7;
  --ink-50:  #F7F9F8;
  --white:   #FFFFFF;

  /* Functional */
  --warn:  #C97A1F;
  --error: #B43A3A;
  --link:  var(--green-700);

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Spacing scale (8pt) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  /* Layout */
  --content-max: 1200px;
  --container-pad-d: 48px;
  --container-pad-m: 24px;

  /* Radii */
  --r-card:   8px;
  --r-button: 6px;
  --r-input:  4px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(11, 20, 16, 0.04), 0 1px 3px rgba(11, 20, 16, 0.06);
  --shadow-md: 0 4px 12px rgba(11, 20, 16, 0.06), 0 2px 4px rgba(11, 20, 16, 0.04);
  --shadow-lg: 0 12px 32px rgba(11, 20, 16, 0.10), 0 4px 8px rgba(11, 20, 16, 0.04);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
}

/* ---------- 2. Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { max-width: 100%; display: block; height: auto; }
a { color: var(--link); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--green-500); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--green-500);
  outline-offset: 2px;
}

/* ---------- 3. Type scale ---------- */
h1, h2, h3, h4 { margin: 0 0 var(--s-4); color: var(--green-900); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 32px; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 24px; }
h3 { font-size: 20px; font-weight: 600; line-height: 1.3; }
h4 { font-size: 17px; font-weight: 600; }
p  { margin: 0 0 var(--s-4); }
.lead { font-size: 18px; color: var(--ink-700); line-height: 1.55; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green-700); margin-bottom: var(--s-3); }
.mono { font-family: var(--font-mono); }

@media (min-width: 768px) {
  h1 { font-size: 56px; }
  h2 { font-size: 36px; }
  h3 { font-size: 24px; }
  body { font-size: 17px; }
  .lead { font-size: 20px; }
}

/* ---------- 4. Container & sections ---------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--container-pad-m);
}
@media (min-width: 768px) {
  .container { padding-inline: var(--container-pad-d); }
}

section { padding-block: 64px; }
@media (min-width: 768px) {
  section { padding-block: 96px; }
}
section.tint { background: var(--ink-50); }
section.green-tint { background: var(--green-100); }
section.dark { background: var(--green-900); color: var(--ink-200); }
section.dark h1, section.dark h2, section.dark h3 { color: var(--white); }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 48px;
  padding-inline: var(--s-6);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.005em;
  border: 1.5px solid transparent;
  border-radius: var(--r-button);
  cursor: pointer;
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease), border-color var(--t-base) var(--ease), transform var(--t-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-700); color: var(--white); }
.btn-primary:hover { background: var(--green-900); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--green-900); border-color: var(--ink-200); }
.btn-secondary:hover { background: var(--ink-50); border-color: var(--green-700); color: var(--green-900); }
.btn-ghost { background: transparent; color: var(--green-700); }
.btn-ghost:hover { background: var(--green-100); color: var(--green-900); }

.btn .arrow { display: inline-block; transition: transform var(--t-base) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- 6. Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--ink-200);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: var(--s-5);
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
  height: 40px;
}
.site-header .brand svg,
.site-header .brand img { height: 32px; width: auto; }
.site-footer .brand-block .brand svg,
.site-footer .brand-block .brand img { height: 32px; width: auto; }
.site-header nav {
  display: none;
  gap: var(--s-6);
  align-items: center;
}
.site-header nav a {
  color: var(--ink-700);
  font-weight: 500;
  font-size: 15px;
  position: relative;
  padding-block: 6px;
}
.site-header nav a:hover { color: var(--green-900); }
.site-header nav a.active { color: var(--green-900); }
.site-header nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--green-700);
  border-radius: 2px;
}
.site-header .header-cta {
  display: none;
  gap: var(--s-3);
  align-items: center;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-button);
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
}
.lang-switch a {
  padding: 6px 10px;
  color: var(--ink-500);
  text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.lang-switch a.active { background: var(--green-900); color: var(--white); }
.lang-switch a:not(.active):hover { background: var(--ink-50); color: var(--green-900); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-button);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--ink-50); }
.nav-toggle .bar { display: block; width: 18px; height: 2px; background: var(--green-900); border-radius: 2px; transition: transform var(--t-base) var(--ease), opacity var(--t-base) var(--ease); }
.nav-toggle .bar + .bar { margin-top: 4px; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  display: none;
  padding: var(--s-5) var(--container-pad-m) var(--s-6);
  background: var(--white);
  border-bottom: 1px solid var(--ink-200);
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  padding: var(--s-3) 0;
  color: var(--ink-900);
  font-weight: 500;
  border-bottom: 1px solid var(--ink-200);
}
.mobile-nav a:last-of-type { border-bottom: 0; }
.mobile-nav .btn { margin-top: var(--s-4); width: 100%; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-header nav { display: inline-flex; }
  .site-header .header-cta { display: inline-flex; }
}

/* ---------- 7. Hero ---------- */
.hero {
  padding-block: 72px 80px;
  background: linear-gradient(180deg, var(--green-100) 0%, var(--white) 100%);
}
@media (min-width: 768px) {
  .hero { padding-block: 112px 128px; }
}
.hero .container {
  display: grid;
  gap: var(--s-7);
  align-items: center;
}
.hero h1 {
  max-width: 18ch;
  margin-bottom: var(--s-5);
}
.hero h1 .accent { color: var(--green-700); }
.hero .lead { max-width: 56ch; margin-bottom: var(--s-6); }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hero-visual {
  display: none;
}
@media (min-width: 900px) {
  .hero .container { grid-template-columns: 1.15fr 1fr; gap: var(--s-9); }
  .hero-visual { display: block; }
}

/* ---------- 8. Section heading helpers ---------- */
.section-head { max-width: 720px; margin-bottom: var(--s-7); }
.section-head h2 { margin-bottom: var(--s-3); }
.section-head p { color: var(--ink-700); font-size: 17px; margin: 0; }
.section-head.centered { margin-inline: auto; text-align: center; }

/* ---------- 9. Service card grid ---------- */
.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 640px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .service-grid { grid-template-columns: repeat(3, 1fr); } }

.service-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-6);
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-card);
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), transform var(--t-base) var(--ease);
  text-decoration: none;
  color: inherit;
}
.service-card:hover {
  border-color: var(--green-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.service-card .icon {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green-100);
  color: var(--green-700);
  border-radius: var(--r-card);
}
.service-card .icon svg { width: 24px; height: 24px; }
.service-card h3 { margin: 0; color: var(--green-900); font-size: 19px; }
.service-card p { color: var(--ink-700); margin: 0; font-size: 15px; line-height: 1.55; }
.service-card .more {
  margin-top: auto;
  padding-top: var(--s-3);
  color: var(--green-700);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.service-card:hover .more { color: var(--green-900); }
.service-card .more .arrow { transition: transform var(--t-base) var(--ease); }
.service-card:hover .more .arrow { transform: translateX(3px); }

/* ---------- 10. Why-us 3-up ---------- */
.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
}
@media (min-width: 900px) { .why-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-7); } }
.why-item .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: var(--green-900);
  color: var(--white);
  border-radius: 50%;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: var(--s-3);
}
.why-item h3 { color: var(--green-900); margin-bottom: var(--s-2); }
.why-item p { color: var(--ink-700); font-size: 16px; margin: 0; }

/* ---------- 11. Founders / About cards ---------- */
.founders {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-7);
}
@media (min-width: 900px) { .founders { grid-template-columns: 1fr 1fr; gap: var(--s-8); } }

.founder-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-7);
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-card);
}
.founder-card .avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--green-100) center/cover no-repeat;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green-700);
  font-weight: 700;
  font-size: 28px;
  overflow: hidden;
  flex-shrink: 0;
}
.founder-card .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.founder-card h3 { margin: 0; font-size: 22px; }
.founder-card .role { color: var(--green-700); font-weight: 600; font-size: 14px; letter-spacing: 0.02em; margin-bottom: var(--s-3); }
.founder-card p { color: var(--ink-700); font-size: 16px; line-height: 1.65; margin: 0; }
.founder-card p + p { margin-top: var(--s-3); }

/* ---------- 12. FAQ accordion ---------- */
.faq { display: grid; gap: var(--s-3); max-width: 760px; }
.faq-item {
  border: 1px solid var(--ink-200);
  border-radius: var(--r-card);
  background: var(--white);
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease);
}
.faq-item[open] { border-color: var(--green-500); }
.faq-item summary {
  list-style: none;
  padding: var(--s-5) var(--s-6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  font-weight: 600;
  font-size: 17px;
  color: var(--green-900);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 24px;
  font-weight: 400;
  color: var(--green-700);
  transition: transform var(--t-base) var(--ease);
  width: 24px;
  text-align: center;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item .answer {
  padding: 0 var(--s-6) var(--s-6);
  color: var(--ink-700);
  font-size: 16px;
  line-height: 1.65;
}

/* ---------- 13. Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.field input, .field textarea, .field select {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink-900);
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-input);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--green-700);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 122, 85, 0.15);
}
.field textarea { resize: vertical; min-height: 140px; }
.field .hint { font-size: 13px; color: var(--ink-500); }
.field.full { grid-column: 1 / -1; }

/* ---------- 14. CTA strip ---------- */
.cta-strip {
  background: var(--green-900);
  color: var(--white);
  border-radius: var(--r-card);
  padding: var(--s-7);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-5);
}
@media (min-width: 768px) {
  .cta-strip { flex-direction: row; align-items: center; justify-content: space-between; padding: var(--s-7) var(--s-8); }
}
.cta-strip h2 { color: var(--white); margin: 0; max-width: 24ch; }
.cta-strip p  { color: var(--ink-200); margin: var(--s-2) 0 0; max-width: 48ch; }
.cta-strip .btn-primary { background: var(--white); color: var(--green-900); }
.cta-strip .btn-primary:hover { background: var(--green-100); color: var(--green-900); }

/* ---------- 15. Footer ---------- */
.site-footer {
  background: var(--green-900);
  color: var(--ink-200);
  padding: var(--s-8) 0 var(--s-6);
  font-size: 15px;
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-7);
  margin-bottom: var(--s-7);
}
@media (min-width: 768px) {
  .site-footer .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-7); }
}
.site-footer .brand-block .brand svg { height: 32px; margin-bottom: var(--s-4); }
.site-footer .brand-block p { color: var(--ink-200); max-width: 36ch; line-height: 1.55; }
.site-footer h4 { color: var(--white); font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 var(--s-4); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.site-footer a { color: var(--ink-200); }
.site-footer a:hover { color: var(--white); }

.site-footer .footer-bar {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  font-size: 13px;
  color: var(--ink-500);
}
@media (min-width: 640px) {
  .site-footer .footer-bar { flex-direction: row; align-items: center; justify-content: space-between; }
}
.site-footer .footer-bar .legal { display: flex; gap: var(--s-4); flex-wrap: wrap; }

/* ---------- 16. Misc helpers ---------- */
.text-center { text-align: center; }
.muted { color: var(--ink-500); }
.note { font-size: 14px; color: var(--ink-500); }
.divider { height: 1px; background: var(--ink-200); border: 0; margin-block: var(--s-7); }

/* Trust strip (logos/tools) */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5) var(--s-7);
  align-items: center;
  justify-content: center;
  padding-block: var(--s-5);
  color: var(--ink-500);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.trust-strip .tool {
  font-weight: 600;
  color: var(--ink-700);
  font-size: 14px;
  letter-spacing: -0.01em;
  text-transform: none;
}

/* Service detail page tweaks */
.detail-grid {
  display: grid;
  gap: var(--s-7);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) { .detail-grid { grid-template-columns: 2fr 1fr; gap: var(--s-8); } }
.detail-grid aside { position: sticky; top: 96px; align-self: start; }
.aside-card {
  padding: var(--s-6);
  background: var(--green-100);
  border-radius: var(--r-card);
  border: 1px solid rgba(31,122,85,0.12);
}
.aside-card h3 { margin-bottom: var(--s-3); }

.bullet-list { list-style: none; padding: 0; margin: 0 0 var(--s-5); }
.bullet-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: var(--s-3);
  color: var(--ink-700);
  line-height: 1.55;
}
.bullet-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 6px;
  width: 18px; height: 18px;
  background: var(--green-100);
  border-radius: 4px;
}
.bullet-list li::after {
  content: '';
  position: absolute;
  left: 4px; top: 11px;
  width: 10px; height: 6px;
  border-left: 2px solid var(--green-700);
  border-bottom: 2px solid var(--green-700);
  transform: rotate(-45deg);
}

.steps {
  counter-reset: step;
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  padding: var(--s-6);
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-card);
  counter-increment: step;
}
.step::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--green-700);
  color: var(--white);
  border-radius: 50%;
  font-weight: 700;
  margin-bottom: var(--s-3);
}
.step h3 { margin-bottom: var(--s-2); }
.step p { color: var(--ink-700); margin: 0; font-size: 15px; }

/* 404 */
.center-stage {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 60vh;
  padding-block: var(--s-9);
}
.center-stage .big {
  font-size: 96px;
  font-weight: 700;
  color: var(--green-900);
  margin: 0 0 var(--s-4);
  letter-spacing: -0.04em;
}

/* Visually-hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
