/* ============================================================
   ala-jaaski.fi — design system
   Peggy website style direction 04-07-2026 (binding)
   White base · Baltic blue #0F4C81 · Ice blue #E8F1F8 · Sky #7FB3DC
   Source Serif 4 (display) + Inter (body)
   ============================================================ */

/* ---------- self-hosted fonts (no third-party requests) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/source-serif-600.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 600; font-display: swap; src: url("../fonts/source-serif-600-italic.woff2") format("woff2"); }

:root {
  --white: #ffffff;
  --ink: #17191e;
  --blue: #0f4c81;        /* PRIMARY — act */
  --blue-deep: #0b3c66;   /* hover on primary */
  --ice: #e8f1f8;         /* SECONDARY — calm bands/cards */
  --sky: #7fb3dc;         /* sparing accents */
  --line: #8a9099;        /* hairlines & captions only */
  --hairline: rgba(23, 25, 30, 0.12);

  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --max: 1200px;
  --pad: clamp(20px, 4vw, 48px);
  --sec: clamp(88px, 12vw, 150px);   /* vertical section rhythm */
  --r: 16px;
  --r-lg: 24px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--sky); color: var(--ink); }

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

a { color: var(--blue); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ---------- type ---------- */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.display {
  font-size: clamp(2.5rem, 5.6vw, 4.4rem);
  line-height: 1.06;
}

.h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
.h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.25; }

.accent {
  font-style: italic;
  color: var(--blue);
}

.kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--line);
  margin: 0 0 22px;
}

p { margin: 0 0 1.1em; max-width: 68ch; }

.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.65;
}

.muted { color: var(--line); }

/* ---------- links & buttons ---------- */

.textlink {
  font-weight: 500;
  position: relative;
  white-space: nowrap;
}
.textlink::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  height: 2px; width: 100%;
  background: var(--sky);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.textlink:hover::after { transform: scaleX(1); }

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--blue);
  padding: 16px 34px;
  border-radius: 100px;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:hover {
  background: var(--blue-deep);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 76, 129, 0.28);
}

.btn--ghost {
  color: var(--blue);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--blue);
}
.btn--ghost:hover {
  color: var(--white);
  background: var(--blue);
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--hairline); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
}

.logo { display: inline-flex; align-items: center; }
.logo img { height: 38px; width: auto; }
.logo--footer img { height: 46px; }
@media (max-width: 480px) { .logo img { height: 32px; } }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 34px);
  list-style: none;
  margin: 0; padding: 0;
}
.nav__links a {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  height: 2px; width: 100%;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.nav__links a:hover::after,
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.nav__links a[aria-current="page"] { color: var(--blue); }

.lang {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--line);
  display: flex;
  gap: 8px;
  align-items: center;
}
.lang a { color: var(--line); }
.lang a:hover { color: var(--blue); }
.lang .on { color: var(--ink); font-weight: 600; }

/* mobile menu */
.nav__toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

@media (max-width: 820px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute;
    top: 76px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--hairline);
    padding: 8px var(--pad) 20px;
    display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links li { width: 100%; }
  .nav__links a { display: block; padding: 12px 0; font-size: 1.05rem; }
  .nav.menu-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav.menu-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- hero ---------- */

.hero {
  padding-top: calc(76px + clamp(56px, 9vw, 110px));
  padding-bottom: var(--sec);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.hero__copy { min-width: 0; overflow-wrap: break-word; }
.hero__copy .btn { margin-top: 18px; }
.hero__copy .lede { margin-top: 28px; }

.hero__photo {
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 3 / 3.9;
}
.hero__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 18%;   /* full head stays in frame */
}

@media (max-width: 820px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__photo { order: -1; aspect-ratio: 4 / 4.4; max-width: 480px; }
}

/* ---------- section scaffolding ---------- */

.section { padding: var(--sec) 0; }

.band {
  background: var(--ice);
  border-radius: clamp(20px, 3vw, 36px);
  margin-left: clamp(8px, 1.4vw, 20px);
  margin-right: clamp(8px, 1.4vw, 20px);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(36px, 5vw, 60px);
  flex-wrap: wrap;
}

/* ---------- cards (services) ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.2vw, 26px);
}
@media (max-width: 980px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border-radius: var(--r);
  padding: clamp(26px, 3vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--ink);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
a.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(15, 76, 129, 0.12);
}
.card .h3 { color: var(--ink); }
.card p { margin: 0; font-size: 0.95rem; color: var(--ink); opacity: 0.82; }
.card__go {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
}

/* ---------- work gallery ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2vw, 24px);
}
@media (max-width: 980px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }

.tile {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  display: block;
  color: var(--white);
}
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.tile:hover img { transform: scale(1.03); }
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 20, 28, 0.72) 0%, rgba(13, 20, 28, 0.14) 34%, rgba(13, 20, 28, 0) 54%);
}
.tile figcaption {
  position: absolute;
  left: 18px; right: 18px; bottom: 16px;
  z-index: 1;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(13, 20, 28, 0.55);
}

/* ---------- split (about) ---------- */

.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

.split__photo {
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3.4;
}
.split__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

/* ---------- contact CTA ---------- */

.cta { text-align: center; }
.cta .h2 { margin-bottom: 20px; }
.cta p { margin-left: auto; margin-right: auto; }
.cta .btn { margin-top: 26px; }
.cta__meta {
  margin-top: 34px;
  font-size: 0.95rem;
  color: var(--ink);
  display: flex;
  gap: 10px 28px;
  justify-content: center;
  flex-wrap: wrap;
}
.cta__meta a { color: var(--blue); font-weight: 500; }

/* ---------- footer ---------- */

.footer {
  background: var(--ice);
  margin-top: var(--sec);
  padding: clamp(48px, 6vw, 72px) 0 40px;
}
.footer__grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.footer__meta {
  font-size: 0.92rem;
  line-height: 1.9;
}
.footer__legal {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--line);
}
.footer__legal a { color: var(--line); }
.footer__legal a:hover { color: var(--blue); }

.linkedin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.92rem;
}

/* ---------- work page gallery ---------- */

.work-head { margin-bottom: clamp(10px, 1.6vw, 18px); }
.work-head .h2 { margin-bottom: 14px; }
.work-head .lede { max-width: 60ch; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(14px, 2vw, 24px);
  margin-top: clamp(26px, 3.5vw, 44px);
}
.gallery--tall { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.shot {
  margin: 0;
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--ice);
}
.gallery--tall .shot { aspect-ratio: 3 / 4; }
.shot img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.shot:hover img { transform: scale(1.03); }

/* ---------- simple prose pages (legal / privacy) ---------- */

.prose { padding-top: calc(76px + clamp(40px, 6vw, 72px)); }
.prose .backlink { display: inline-block; margin-bottom: clamp(20px, 3vw, 34px); font-weight: 500; }
.prose h1 { font-size: clamp(2rem, 3.6vw, 2.9rem); margin-bottom: 12px; }
.prose h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin: clamp(40px, 5vw, 64px) 0 8px;
}
.prose h3 {
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0;
  margin: 28px 0 6px;
  color: var(--ink);
}
.prose p, .prose ul { max-width: 72ch; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.1em; }
.prose li { margin-bottom: 4px; }
.prose .em { font-style: italic; color: var(--line); display: block; margin-top: 18px; }

/* ---------- contact detail block ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-photo {
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3.2;
}
.contact-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.contact-details { margin-top: 30px; display: flex; flex-direction: column; gap: 6px; font-size: 1.08rem; }
.contact-details a { color: var(--blue); font-weight: 500; }
.contact-details .label { font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--line); font-weight: 500; margin-top: 14px; }

/* ---------- services offer blocks ---------- */

.offer {
  padding: clamp(28px, 3.4vw, 44px);
  border-radius: var(--r-lg);
  background: var(--white);
}
.offer + .offer { margin-top: clamp(16px, 2vw, 24px); }
.offer h3 { margin-bottom: 6px; }
.offer .sub { font-weight: 600; color: var(--ink); margin: 0 0 16px; max-width: 60ch; }
.offer ul { margin: 0; padding-left: 1.15em; max-width: 62ch; }
.offer li { margin-bottom: 6px; }
.offer__list-wrap { margin-top: clamp(28px, 3.5vw, 44px); }

/* ---------- FAQ (home, AIO plain-text answers) ---------- */

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(22px, 3vw, 40px);
  margin-top: clamp(32px, 4vw, 52px);
}
@media (max-width: 720px) { .faq-grid { grid-template-columns: 1fr; } }
.faq-item h3 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--ink);
}
.faq-item p { margin: 0; font-size: 0.98rem; color: var(--ink); opacity: 0.84; max-width: 54ch; }

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tile img, .btn, .card { transition: none; }
}
