/* ===========================================================================
   Marelenio OÜ — site styles
   Minimal, professional, light. Inter + system fallback.
   =========================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --text: #2a3350;
  --heading: #1b2a5b;
  --muted: #5b6472;
  --border: #e6e8ec;
  --accent: #2f6bf0;
  --accent-d: #1f57d6;
  --accent-soft: #eaf1ff;
  --teal: #17c2c2;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 10px 30px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { color: var(--heading); line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---- Bilingual visibility ------------------------------------------------ */
.es { display: none; }
html.lang-es .es { display: inline; }
html.lang-es .en { display: none; }

/* ---- Accessibility helpers ---------------------------------------------- */
.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;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  transition: top .2s ease;
}
.skip-link:focus { top: 16px; }

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

/* ---- Brand --------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-name { font-size: 1.05rem; letter-spacing: -0.01em; color: var(--heading); }
.brand-suffix { color: var(--muted); font-weight: 500; }
.brand-logo { display: block; width: auto; height: 32px; }
.brand-logo--sm { height: 24px; }

/* ---- Header -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 20px; }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a {
  color: var(--muted); font-weight: 500; font-size: .95rem;
  padding: 8px 12px; border-radius: 8px; transition: color .15s ease, background .15s ease;
}
.site-nav a:hover { color: var(--text); background: var(--bg-alt); }

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

/* ---- Language switch ----------------------------------------------------- */
.lang-switch {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 999px;
}
.lang-btn {
  appearance: none; border: 0; cursor: pointer; background: transparent;
  font: inherit; font-size: .8rem; font-weight: 600; letter-spacing: .02em;
  color: var(--muted); padding: 5px 11px; border-radius: 999px;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.lang-btn:hover { color: var(--text); }
html.lang-en .lang-btn[data-lang="en"],
html.lang-es .lang-btn[data-lang="es"] {
  background: #fff; color: var(--accent); box-shadow: var(--shadow-sm);
}

/* ---- Mobile nav toggle --------------------------------------------------- */
.nav-toggle {
  display: none; appearance: none; border: 1px solid var(--border); background: #fff;
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle .bar { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.site-header.nav-open .nav-toggle .bar:nth-child(2) { transform: translateY(6px) rotate(45deg); }
.site-header.nav-open .nav-toggle .bar:nth-child(3) { opacity: 0; }
.site-header.nav-open .nav-toggle .bar:nth-child(4) { transform: translateY(-6px) rotate(-45deg); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: .98rem; padding: 13px 22px; border-radius: 11px;
  cursor: pointer; transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-d); box-shadow: var(--shadow-md); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: #cdd2da; background: var(--bg-alt); }

/* ---- Hero ---------------------------------------------------------------- */
.hero { background: linear-gradient(180deg, var(--bg-alt) 0%, #fff 100%); border-bottom: 1px solid var(--border); }
.hero-inner { max-width: 760px; margin: 0 auto; text-align: center; padding: 96px 24px 88px; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 18px;
  padding: 6px 12px; background: var(--accent-soft); border-radius: 999px;
}
.hero-title { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; }
.hero-sub { margin-top: 20px; font-size: clamp(1.05rem, 2.2vw, 1.22rem); color: var(--muted); }
.hero-actions { margin-top: 34px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---- Sections ------------------------------------------------------------ */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 700; }
.section-lead { margin-top: 12px; color: var(--muted); font-size: 1.08rem; }

/* ---- Services grid ------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 26px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #dfe3ea; }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 18px;
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.15rem; font-weight: 600; }
.card p { margin-top: 10px; color: var(--muted); font-size: .98rem; }

/* ---- About / principles -------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.about-text h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 700; }
.about-text p { margin-top: 18px; color: var(--muted); font-size: 1.08rem; }
.principles { display: grid; gap: 14px; }
.principle {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 20px;
}
.principle .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 7px; }
.principle h3 { font-size: 1rem; font-weight: 600; }
.principle p { margin-top: 4px; color: var(--muted); font-size: .95rem; }

/* ---- Contact ------------------------------------------------------------- */
.contact-card {
  max-width: 720px; margin: 0 auto; text-align: center;
  background: linear-gradient(135deg, #1b2a5b 0%, #16223f 100%); color: #fff; border-radius: 20px; padding: 56px 32px;
}
.contact-card h2 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 700; }
.contact-card p { margin-top: 16px; color: #c9cfdb; font-size: 1.1rem; }
.contact-card .btn-primary { margin-top: 28px; }
.contact-card .btn-primary:hover { background: #fff; color: var(--accent-d); }
.contact-mail { display: inline-block; margin-top: 18px; color: #aeb9ff; font-weight: 500; }
.contact-mail:hover { color: #fff; }

/* ---- 404 ----------------------------------------------------------------- */
.section-404 { text-align: center; padding: 120px 0; }
.section-404 .eyebrow { font-size: 1rem; }
.section-404 h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }
.section-404 p { margin: 16px 0 28px; color: var(--muted); }

/* ---- Footer -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 28px; }
.footer-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.footer-meta { color: var(--muted); font-size: .95rem; }
.footer-mail { margin-left: auto; color: var(--accent); font-weight: 500; }
.footer-mail:hover { color: var(--accent-d); }
.footer-bottom { color: var(--muted); }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 720px) {
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md); padding: 8px 0; display: none;
  }
  .site-header.nav-open .site-nav { display: flex; }
  .site-nav a { padding: 13px 24px; border-radius: 0; }
  .nav-toggle { display: inline-flex; }
  .hero-inner { padding: 72px 22px 64px; }
  .section { padding: 64px 0; }
  .footer-mail { margin-left: 0; width: 100%; }
}

@media (max-width: 400px) {
  .container { padding: 0 16px; }
  .header-inner { gap: 12px; }
  .header-actions { gap: 8px; }
  .lang-btn { padding: 5px 9px; }
}

@media (max-width: 360px) {
  .brand-suffix { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
