/* ==========================================================================
   Helenetics — style.css
   ========================================================================== */

/* ---------- Variables & reset ---------- */
:root {
  --navy: #0f2a4a;
  --navy-deep: #0b2240;
  --blue: #2c5aa0;
  --tint: #eef4fb;
  --tint-strong: #e3ecf8;
  --text: #1d2d44;
  --muted: #55657d;
  --text-soft: #3a4a62;      /* tumedam põhitekst kaartides */
  --light: #5b708c;          /* heledam toon tag-ridadele (kontrast ≥ 4.5:1 nii valgel kui heleda sinise taustal) */
  --white: #ffffff;
  --line: #dde6f1;

  --header-h: 64px;
  --radius: 14px;
  --container: 1600px;       /* sisu max laius — vähenda, kui tahad külgedele rohkem ruumi */
  --gutter: 48px;            /* külgmine vahe */
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

svg { flex-shrink: 0; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Typography helpers ---------- */
h1, h2, h3 { color: var(--navy); line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.tags {
  font-size: 0.82rem;
  color: var(--light);
  line-height: 1.5;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-deep); box-shadow: 0 6px 18px rgba(15, 42, 74, 0.25); }
.btn-light { background: var(--white); color: var(--navy); }
.btn-light:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }

/* ---------- Header / navbar ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-scrolled {
  border-color: var(--line);
  box-shadow: 0 2px 12px rgba(15, 42, 74, 0.06);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
  text-decoration: none;
}

.site-nav ul { display: flex; gap: 2rem; }
.site-nav a {
  position: relative;
  display: inline-block;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.site-nav a:hover::after,
.site-nav a.is-active::after { transform: scaleX(1); }
.site-nav a.is-active { color: var(--blue); }

/* Hamburger (peidetud desktopis) */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: #f3f7fc;
}
/* Pilt on täies kõrguses paremal (ei suumita sisse) ja hajub vasakust servast ära.
   Kitsal ekraanil lõigatakse pildi vasak serv, laptop jääb paremale nähtavaks. */
.hero-img {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: cover;
  object-position: right center;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 35%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 35%);
}
.hero .container {
  position: relative;
  z-index: 1;
  padding-top: 5.5rem;
  padding-bottom: 5.5rem;
}

.hero-content { max-width: 720px; }
.hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.1rem);
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.hero p { color: var(--text); margin-bottom: 0.9rem; }
.hero .btn { margin-top: 1rem; }

/* ---------- Generic sections ---------- */
.section { padding: 4.5rem 0; }
.section-tint { background: var(--tint); }

.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 4rem;
  align-items: end;
  margin-bottom: 2.75rem;
}
.section-head-stack { display: block; max-width: 640px; }
.section-head-stack h2 { margin-bottom: 0.75rem; }
.section-intro { color: var(--muted); font-size: 0.97rem; }

.grid { display: grid; gap: 2rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- Services ---------- */
/* Iga kaart jagab ühise ruudustiku ridu (subgrid): ikoon, pealkiri, tekst ja tagid.
   Nii algavad kõik tagid samalt kõrguselt, sõltumata põhiteksti või tagi pikkusest. */
.service {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 0;
}
.service .icon-circle { justify-self: start; }
.service h3 { margin: 1.1rem 0 0.6rem; }
.service p { color: var(--text-soft); font-size: 0.93rem; }
.service .tags {
  padding-top: 1rem;
  color: var(--light);
  font-size: 0.82rem;
}

.icon-circle {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--tint-strong);
  color: var(--navy);
  font-size: 1.6rem;
}

/* ---------- Why work with me ---------- */
.why .icon {
  display: inline-flex;
  color: var(--navy);
  font-size: 1.9rem;
  margin-bottom: 0.9rem;
}
.why h3 { margin-bottom: 0.5rem; }
.why p { color: var(--muted); font-size: 0.93rem; }

/* ---------- Process ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}
.step {
  position: relative;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tint-strong);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.95rem;
}
.step h3 { margin: 0.3rem 0 0.4rem; }
.step p { color: var(--muted); font-size: 0.9rem; }

/* ---------- Projects ---------- */
/* Desktop: pilt vasakul, info paremal */
.project {
  display: flex;
  flex-direction: row;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(15, 42, 74, 0.07);
}
.project img {
  flex: 0 0 42%;
  width: 42%;
  min-height: 240px;
  align-self: stretch;
  object-fit: cover;
}
.project-body {
  flex: 1;
  min-width: 0;
  padding: 1.75rem 1.75rem 1.9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
}
.project-body h3 { font-size: 1.25rem; }
.project-body p { color: var(--muted); font-size: 0.93rem; }
.project-body .tags { margin-top: 0.25rem; color: var(--light); font-size: 0.82rem; }

.badge {
  align-self: flex-start;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--tint-strong);
  color: var(--navy) !important;
  font-size: 0.7rem !important;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Contact ---------- */
.contact {
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(11, 34, 64, 0.94) 0%, rgba(11, 34, 64, 0.82) 55%, rgba(11, 34, 64, 0.55) 100%),
    url("../assets/images/baltic-sea.jpg") center / cover no-repeat,
    var(--navy-deep);
}
.contact-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  align-items: center;
  padding-top: 5rem;
  padding-bottom: 5rem;
}
.contact h2 { color: var(--white); margin-bottom: 1rem; }
.contact .eyebrow { color: #b9cde8; }
.contact-text p { color: #dbe6f5; margin-bottom: 0.8rem; max-width: 540px; }
.contact-text .btn { margin-top: 1rem; }

.contact-list { display: grid; gap: 1.4rem; }
.contact-list li { display: flex; align-items: center; gap: 1rem; }
.contact-list svg { font-size: 1.6rem; color: #b9d3f5; }
.contact-list .label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9fb8d9;
}
.contact-list a { text-decoration: none; font-weight: 500; }
.contact-list a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { padding: 1.6rem 0; }
.footer-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.footer-tagline {
  padding-left: 1.25rem;
  border-left: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}
.footer-copy { margin-left: auto; font-size: 0.78rem; color: var(--muted); }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Keskmised ekraanid (761–1400 px): pilt jääb paremale poolele, tekst vasakule heleda tausta peale */
@media (max-width: 1400px) {
  .hero-img {
    max-width: 55%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 45%);
  }
  .hero-content { max-width: 48%; }
  .hero h1 { font-size: clamp(2rem, 3.6vw, 3.1rem); }
}

/* Projektikaardid üksteise alla, et pildi kõrval oleks info jaoks piisavalt ruumi */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Tahvel */
@media (max-width: 1000px) {
  :root { --gutter: 32px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 2.5rem; }
  .section-head { grid-template-columns: 1fr; gap: 1rem; }
  .contact-inner { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* Mobiil — hamburger-menüü */
@media (max-width: 760px) {
  :root { --gutter: 24px; }
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(15, 42, 74, 0.1);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.3s ease, visibility 0.3s;
  }
  .site-nav.is-open { max-height: 320px; visibility: visible; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 0.5rem var(--gutter) 1rem; }
  .site-nav a { display: block; padding: 0.85rem 0; font-size: 1rem; }
  .site-nav a::after { display: none; }

  .hero-content { max-width: none; }
  .hero-img {
    width: 100%;
    max-width: 100%;
    object-position: 70% center;
    opacity: 0.2;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .hero .container { padding-top: 3.5rem; padding-bottom: 3.5rem; }

  .section { padding: 3.25rem 0; }
  .grid-4, .grid-2, .steps { grid-template-columns: 1fr; }
  .grid { gap: 2rem; }

  /* projektikaart: pilt üleval, info all */
  .project { flex-direction: column; }
  .project img {
    flex: none;
    width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 10;
  }
  .project-body { justify-content: flex-start; padding: 1.5rem 1.4rem 1.7rem; }

  /* ikoonid ja tekst keskele (ainult mobiilis) */
  .service, .why { text-align: center; }
  .service .icon-circle { justify-self: center; }
  .why .icon { display: flex; justify-content: center; }

  .contact-inner { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .footer-tagline { border-left: 0; padding-left: 0; width: 100%; order: 3; }
  .footer-copy { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}