/* =========================================================
   Optimus Digital Technology — foaie de stil
   Pașii 1–2: variabile, tipografie, layout mobil (mobile-first).
   Media queries (tabletă/desktop) și hamburger — pasul 3.
   ========================================================= */

/* ---------- Fonturi self-hosted ----------
   Fișierele .woff2 se adaugă în assets/fonts/ (subseturi latin + latin-ext).
   Până atunci, stiva de rezervă asigură o pagină lizibilă cu diacritice. */
@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* ---------- Variabile ---------- */
:root {
  /* Paletă (secțiunea 5.1) */
  --blue-deep: #1D4ED8;
  --blue:      #2563EB;
  --teal:      #0D9488;
  --teal-light:#0EA5A4;
  --ink:       #0F2233;
  --slate:     #5A6B7B;
  --paper:     #FFFFFF;
  --mist:      #F2F6F9;

  /* Tipografie */
  --font-heading: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Scală de mărimi fluidă cu clamp() (mobil → desktop) */
  --fs-h1:   clamp(2rem, 5vw + 1rem, 3.25rem);
  --fs-h2:   clamp(1.5rem, 3vw + 0.75rem, 2.25rem);
  --fs-h3:   clamp(1.15rem, 1.5vw + 0.75rem, 1.4rem);
  --fs-body: clamp(1rem, 0.5vw + 0.9rem, 1.125rem);
  --fs-small: 0.9rem;

  /* Ritm și forme */
  --space: 1rem;
  --radius-sm: 8px;   /* elemente mici */
  --radius-lg: 16px;  /* blocuri */
  --measure: 65ch;    /* lungimea rândului sub ~70 caractere */

  --header-h: 60px;
}

/* ---------- Reset ușor ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.5em;
}

p { margin: 0 0 1rem; }

a { color: var(--blue-deep); }
a:hover { color: var(--blue); }

/* Contur vizibil la focus, peste tot */
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Placeholder [DE COMPLETAT] — vizibil, temporar */
.todo {
  background: #FFF3CD;
  color: #7A5B00;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-style: italic;
}

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- Buton ---------- */
.btn {
  display: inline-block;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.btn--primary {
  background: var(--blue-deep);
  color: var(--paper);
}
.btn--primary:hover { background: var(--blue); color: var(--paper); }

/* ======================= NAVIGAȚIE ======================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(1.4) blur(6px);
  border-bottom: 1px solid var(--mist);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
}
.nav__logo { display: block; }
.nav__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
}
/* Buton hamburger (mobile-first: vizibil sub 768px) */
.nav__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  padding: 0;
  flex: none;
  background: none;
  border: none;
  cursor: pointer;
}
.nav__toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  margin-inline: auto;
  background: var(--ink);
  border-radius: 999px;
  transition: transform 160ms ease, opacity 160ms ease;
}
/* Se transformă în „X" când meniul e deschis */
.site-header.is-open .nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.is-open .nav__toggle-bar:nth-child(2) { opacity: 0; }
.site-header.is-open .nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Panoul de meniu: dropdown sub header pe mobil, ascuns implicit */
.nav__panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--mist);
  box-shadow: 0 10px 28px rgba(15, 34, 51, 0.08);
  padding: 0.5rem 1.25rem 1rem;
}
.site-header.is-open .nav__panel { display: block; }

.nav__links {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  display: flex;
  align-items: center;
  padding: 0.85rem 0;
  min-height: 48px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 1px solid var(--mist);
}
.nav__links a:hover { color: var(--blue); }
/* Comutator de limbă */
.nav__lang {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding-top: 0.75rem;
}
.lang-btn {
  min-width: 48px;
  min-height: 48px;
  padding: 0.4rem 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--slate);
  border-radius: var(--radius-sm);
}
.lang-btn:hover { color: var(--blue); }
.lang-btn[aria-pressed="true"] {
  color: var(--blue-deep);
  background: var(--mist);
}
.lang-sep { color: var(--slate); opacity: 0.5; }

/* Pe telefoane foarte înguste, numele lung încape greu */
@media (max-width: 380px) {
  .nav__name { font-size: 0.85rem; }
}

/* ======================= MEDIA QUERIES ======================= */

/* Tabletă: două coloane pentru ariile de servicii */
@media (min-width: 640px) {
  .services { grid-template-columns: repeat(2, 1fr); }
}

/* De la 768px: navigație orizontală, fără hamburger */
@media (min-width: 768px) {
  .nav__toggle { display: none; }
  .nav__panel {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
  }
  .nav__links {
    flex-direction: row;
    gap: 1.5rem;
  }
  .nav__links a {
    padding: 0.5rem 0;
    min-height: 0;
    color: var(--slate);
    font-size: var(--fs-small);
    border-bottom: none;
  }
  .nav__lang { padding-top: 0; }
}

/* Desktop: trei coloane pentru arii */
@media (min-width: 1024px) {
  .services { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 4.5rem 0; }
  .hero { padding: 5rem 0; }
  .footer__grid { grid-template-columns: 2fr 1fr; }
}

/* ======================= HERO ======================= */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  padding: 3rem 0;
}
.hero__inner {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.hero__title {
  font-size: var(--fs-h1);
  margin-bottom: 0.5rem;
}
.hero__subtitle {
  font-size: var(--fs-body);
  color: var(--slate);
  max-width: var(--measure);
  margin-bottom: 1.5rem;
}
/* Arcele: element grafic discret, opacitate mică (secțiunea 5.3).
   Pe mobil stau în spate, subtil. */
.hero__graphic {
  position: absolute;
  top: 50%;
  right: -60px;
  transform: translateY(-50%);
  width: 260px;
  max-width: 55%;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
.hero__text { position: relative; z-index: 1; }

/* Singurul moment orchestrat: arcele se desenează la încărcare, o dată (~900ms).
   pathLength="1" normalizează toate formele, deci un singur set de reguli le
   animează uniform, de la interior spre exterior. */
.hero__arcs :is(circle, line, path) {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: hero-draw 620ms ease-out forwards;
}
.hero__arcs circle             { animation-delay: 0ms; }
.hero__arcs line:nth-of-type(1){ animation-delay: 70ms; }
.hero__arcs line:nth-of-type(2){ animation-delay: 120ms; }
.hero__arcs path:nth-of-type(1){ animation-delay: 170ms; }
.hero__arcs path:nth-of-type(2){ animation-delay: 230ms; }
.hero__arcs path:nth-of-type(3){ animation-delay: 290ms; }

@keyframes hero-draw {
  to { stroke-dashoffset: 0; }
}

/* Fără mișcare: arcele apar direct desenate, fără animație */
@media (prefers-reduced-motion: reduce) {
  .hero__arcs :is(circle, line, path) {
    stroke-dashoffset: 0;
    animation: none;
  }
}

/* ======================= SECȚIUNI ======================= */
.section { padding: 3rem 0; }
.section--about   { background: var(--paper); }
.section--services{ background: var(--mist); }
.section--contact { background: var(--paper); }

.section__title { font-size: var(--fs-h2); }

/* Separator: segment scurt cu capete rotunjite (secțiunea 5.3) */
.section__divider {
  width: 56px;
  height: 4px;
  border-radius: 999px;
  background: var(--teal);
  margin: 0 0 1.5rem;
}

.section__lead {
  font-size: var(--fs-body);
  max-width: var(--measure);
  color: var(--ink);
}

/* ---------- Servicii ---------- */
.services {
  display: grid;
  grid-template-columns: 1fr;   /* o coloană pe mobil */
  gap: 2rem;
}
.service-group {
  background: var(--paper);
  border: 1px solid #E2EAF0;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.service-group__title {
  font-size: var(--fs-h3);
  color: var(--blue-deep);
}
.service-group__desc {
  color: var(--slate);
  max-width: var(--measure);
}
.service-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.service-list li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.75rem;
  max-width: var(--measure);
}
/* Marcaj: capăt rotunjit, în ton cu motivul vizual */
.service-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 10px;
  height: 4px;
  border-radius: 999px;
  background: var(--teal-light);
}

/* ---------- Contact ---------- */
.contact__email {
  font-size: 1.25rem;
  font-family: var(--font-heading);
  font-weight: 600;
}
.contact__label { color: var(--slate); margin-right: 0.4rem; }

/* ======================= FOOTER ======================= */
.site-footer {
  background: var(--ink);
  color: #C5D2DD;
  padding: 2.5rem 0;
  font-size: var(--fs-small);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.footer__company { color: var(--paper); font-weight: 600; margin-bottom: 0.75rem; }
.footer__legal-list, .footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer__legal-list li { margin-bottom: 0.4rem; }
.footer__legal-label { color: #8EA1B0; margin-right: 0.35rem; }
.site-footer a { color: #9EC1FF; }
.site-footer a:hover { color: #C9DBFF; }
.footer__links { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 1rem; }
.footer__copyright { color: #8EA1B0; margin: 0; }

/* Link ANPC cu pictogramă (balanță = soluționarea litigiilor) */
.footer__anpc {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.footer__anpc-icon { flex: none; }

/* ======================= PAGINA LEGALĂ (prose) ======================= */
.section--legal { background: var(--paper); }
.prose { max-width: 70ch; }
.prose h2 {
  font-size: var(--fs-h3);
  color: var(--blue-deep);
  margin-top: 2rem;
}
.prose p { color: var(--ink); }
.prose__updated { color: var(--slate); font-size: var(--fs-small); }

/* ======================= MIȘCARE REDUSĂ ======================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
