/* tcx.ro - Integris TCX. Fara JavaScript, fonturi sau resurse externe.
   Miscarea e doar CSS si se opreste complet la prefers-reduced-motion. */
@property --n { syntax: "<integer>"; inherits: false; initial-value: 0; }

:root {
  --bg: #f6f6fb;
  --bg-alt: #ecebf8;
  --card: #ffffff;
  --text: #1b1a33;
  --muted: #565478;
  --line: #dcdaf0;
  --accent: #4338ca;        /* indigo */
  --accent-2: #6d28d9;      /* violet, pentru degradeuri */
  --accent-soft: #e6e4fb;
  --on-accent: #ffffff;
  --stat: #4338ca;
  --hero-a: #312e81;
  --hero-b: #4338ca;
  --hero-c: #6d28d9;
  --hero-text: #f3f2ff;
  --hero-muted: #c9c6f5;
  --max: 1080px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e1f; --bg-alt: #16152c; --card: #1b1a35; --text: #e9e8fb; --muted: #a7a4d6; --line: #2c2a52;
    --accent: #a5b4fc; --accent-2: #c4b5fd; --accent-soft: #24234a; --on-accent: #14132b; --stat: #a5b4fc;
    --hero-a: #1e1b4b; --hero-b: #312e81; --hero-c: #4c1d95; --hero-text: #f3f2ff; --hero-muted: #c9c6f5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0e1f; --bg-alt: #16152c; --card: #1b1a35; --text: #e9e8fb; --muted: #a7a4d6; --line: #2c2a52;
  --accent: #a5b4fc; --accent-2: #c4b5fd; --accent-soft: #24234a; --on-accent: #14132b; --stat: #a5b4fc;
  --hero-a: #1e1b4b; --hero-b: #312e81; --hero-c: #4c1d95; --hero-text: #f3f2ff; --hero-muted: #c9c6f5;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
a { color: var(--accent); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* antet lipit, cu sticla mata */
header.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: .02em; color: var(--text); text-decoration: none; font-size: 1.12rem; }
.brand span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav.main { display: flex; gap: 18px; flex-wrap: wrap; font-size: .95rem; }
nav.main a { color: var(--muted); text-decoration: none; position: relative; }
nav.main a:not(.lang)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
nav.main a:hover { color: var(--text); }
nav.main a:hover::after { transform: scaleX(1); }
nav.main a.lang { border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; }

/* deschiderea: degrade animat + forme care plutesc */
.hero {
  position: relative; overflow: hidden; color: var(--hero-text);
  padding: 96px 0 84px;
  background: linear-gradient(120deg, var(--hero-a), var(--hero-b), var(--hero-c), var(--hero-a));
  background-size: 300% 300%;
  animation: degrade 18s ease-in-out infinite;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; pointer-events: none;
}
.hero::before { width: 420px; height: 420px; background: #818cf8; top: -140px; right: -80px; animation: pluteste 14s ease-in-out infinite; }
.hero::after  { width: 360px; height: 360px; background: #a78bfa; bottom: -160px; left: -100px; animation: pluteste 17s ease-in-out infinite reverse; }
.hero .grila {
  position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
  animation: grila 30s linear infinite;
}
.hero .wrap { position: relative; z-index: 1; }   /* textul si butonul deasupra formelor care plutesc */
.hero h1 { font-size: clamp(2rem, 4.8vw, 3.3rem); line-height: 1.12; margin: 0 0 20px; max-width: 21ch;
  animation: urca .9s cubic-bezier(.2,.7,.2,1); }
.hero p.lead { font-size: 1.2rem; color: var(--hero-muted); max-width: 60ch; margin: 0 0 30px;
  animation: urca 1.05s cubic-bezier(.2,.7,.2,1); }
.hero .btn { animation: urca 1.2s cubic-bezier(.2,.7,.2,1); background: #fff; color: #312e81; }
.btn {
  display: inline-block; background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 700;
  padding: 13px 24px; border-radius: 10px; transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 6px 20px rgba(49, 46, 129, .25);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(49, 46, 129, .35); }

section { padding: 64px 0; }
section.alt { background: var(--bg-alt); }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); margin: 0 0 10px; line-height: 1.22; }
p.intro { color: var(--muted); max-width: 70ch; margin: 0 0 34px; }

/* cifrele: cresc de la 0 (proprietate CSS animata) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.stat .nr { display: block; font-size: 2.5rem; font-weight: 800; color: var(--stat); line-height: 1.1; margin-bottom: 6px;
  --n: var(--to); counter-reset: n var(--n); }
.stat .nr::after { content: counter(n) "%"; }
.n86 { --to: 86; } .n32 { --to: 32; } .n22 { --to: 22; } .n16 { --to: 16; }   /* fara style= in HTML: CSP strict */
.stat span { color: var(--muted); font-size: .95rem; }
p.source { font-size: .85rem; color: var(--muted); margin: 16px 0 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(49, 46, 129, .14); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card h3 { margin: 0 0 6px; font-size: 1.12rem; line-height: 1.3; }
.card .risk { color: var(--muted); font-size: .95rem; margin: 0 0 12px; }
.card ul { margin: 0; padding-left: 1.1em; }
.card li { margin: 4px 0; }
.card li::marker { color: var(--accent); }
.tag { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 999px;
  font-size: .78rem; font-weight: 700; padding: 2px 10px; margin-bottom: 10px; }
.card.nou { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(160deg, var(--card), var(--accent-soft)); }

.projects .card a { font-weight: 700; }
.contact-box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; max-width: 660px; }
.contact-box .mail { font-size: 1.4rem; font-weight: 800; margin: 8px 0; }
.legal { color: var(--muted); font-size: .9rem; margin-top: 14px; }

footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .88rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@keyframes degrade { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes pluteste { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-40px, 30px) scale(1.12); } }
@keyframes grila { from { background-position: 0 0, 0 0; } to { background-position: 44px 44px, 44px 44px; } }
@keyframes intra { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
/* textul din deschidere e MEREU vizibil: doar urca putin, fara opacitate (daca animatia nu ruleaza, mesajul ramane) */
@keyframes urca { from { translate: 0 14px; } }
@keyframes numara { from { --n: 0; } }

/* aparitia la derulare + numaratoarea: doar unde browserul stie animatii legate de derulare */
@supports (animation-timeline: view()) {
  .card, .stat, .contact-box { animation: intra linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
  .stat .nr { animation: numara 1.4s ease-out both; animation-timeline: view(); animation-range: entry 10% cover 40%; }
}
@supports not (animation-timeline: view()) {
  .stat .nr { animation: numara 1.6s .4s ease-out both; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 64px 0 56px; }
  section { padding: 44px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .stat .nr { --n: var(--to); }
}

/* 25 oct 2026: titlul „cat tu dormi” + ilustratia (SVG in pagina, fara fisiere externe) si pictogramele cardurilor */
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center; }
.hero p.noi { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; margin: -6px 0 18px; color: #fff;
  background: linear-gradient(90deg, #c7d2fe, #f5d0fe); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ilustratie { width: 100%; height: auto; max-width: 440px; justify-self: end; filter: drop-shadow(0 18px 40px rgba(15, 10, 60, .45)); }
.ilustratie .stea { animation: clipeste 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.ilustratie .s2 { animation-delay: 1.1s; } .ilustratie .s3 { animation-delay: 2.2s; }
.ilustratie .puls { stroke-dasharray: 320; animation: puls 3.6s linear infinite; }
.ilustratie .scut { animation: urca 1.2s cubic-bezier(.2,.7,.2,1); transform-box: fill-box; }
@keyframes clipeste { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: .25; scale: .6; } }
@keyframes puls { from { stroke-dashoffset: 640; } to { stroke-dashoffset: 0; } }
.card .ic { width: 30px; height: 30px; color: var(--accent); display: block; margin-bottom: 10px; }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .ilustratie { justify-self: center; max-width: 320px; }
}
@media (prefers-reduced-motion: reduce) { .ilustratie .puls { stroke-dasharray: none; } }

/* 28 oct 2026: detaliul extensibil din carduri (<details>, fara JavaScript). Pe card ramane textul scurt; la apasare se
   deschide exemplul / descrierea. Zona de apasare >= 44px (telefon), sageata se roteste, textul nu largeste pagina. */
.card .detalii { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 4px; }
.card .detalii summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px;
  font-weight: 700; font-size: .92rem; color: var(--accent); -webkit-tap-highlight-color: transparent;
}
.card .detalii summary::-webkit-details-marker { display: none; }
.card .detalii summary::after {
  content: ""; width: 8px; height: 8px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s ease;
}
.card .detalii[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.card .detalii summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.card .detalii p { margin: 4px 0 6px; color: var(--muted); font-size: .94rem; line-height: 1.55; overflow-wrap: anywhere; }
.card .detalii p strong { color: var(--text, inherit); }
@media (max-width: 560px) {
  .card { padding: 18px; }
  .card .detalii p { font-size: .97rem; }
}
