/* DASCONSULT – site styles. Modern CSS (2026) with graceful fallbacks; no build step. */
@layer reset, tokens, base, layout, components, sections, motion;

/* ---------- fonts (self-hosted IBM Plex Sans, variable wght + wdth) ---------- */
@font-face {
  font-family: "Plex";
  src: url("fonts/plex-normal-latin.woff2") format("woff2");
  font-weight: 300 700; font-stretch: 85% 100%; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex";
  src: url("fonts/plex-normal-latin-ext.woff2") format("woff2");
  font-weight: 300 700; font-stretch: 85% 100%; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plex";
  src: url("fonts/plex-italic-latin.woff2") format("woff2");
  font-weight: 400; font-stretch: 85% 100%; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex";
  src: url("fonts/plex-italic-latin-ext.woff2") format("woff2");
  font-weight: 400; font-stretch: 85% 100%; font-style: italic; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* cross-document view transition: RO ⇄ EN switch animates instead of flashing */
@view-transition { navigation: auto; }

@property --glow {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: none; text-size-adjust: none; interpolate-size: allow-keywords; }
  body { min-height: 100dvh; line-height: 1.6; -webkit-font-smoothing: antialiased; }
  img, svg, picture { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; }
  p, h1, h2, h3, h4 { overflow-wrap: break-word; }
}

@layer tokens {
  :root {
    color-scheme: light dark;

    /* brand: the blue of the DASCONSULT letters (#1f3a8a) */
    --brand-h: 264;
    --brand: oklch(37% 0.13 var(--brand-h));
    --brand-strong: oklch(30% 0.12 var(--brand-h));
    --volt: oklch(84% 0.17 88);               /* "danger high voltage" yellow – used sparingly */

    --bg: light-dark(oklch(98.6% 0.004 var(--brand-h)), oklch(16% 0.025 var(--brand-h)));
    --bg-alt: light-dark(oklch(95.8% 0.01 var(--brand-h)), oklch(20% 0.03 var(--brand-h)));
    --surface: light-dark(oklch(100% 0 0), oklch(22.5% 0.03 var(--brand-h)));
    --ink: light-dark(oklch(22% 0.03 var(--brand-h)), oklch(94% 0.01 var(--brand-h)));
    --ink-soft: light-dark(oklch(43% 0.03 var(--brand-h)), oklch(76% 0.02 var(--brand-h)));
    --line: light-dark(oklch(89% 0.012 var(--brand-h)), oklch(32% 0.03 var(--brand-h)));
    --accent: light-dark(var(--brand), oklch(78% 0.1 var(--brand-h)));
    --accent-ink: light-dark(oklch(99% 0 0), oklch(18% 0.03 var(--brand-h)));

    /* the mark-up colour code used in DASCONSULT packages */
    --mk-red: oklch(56% 0.21 27);
    --mk-brown: oklch(48% 0.09 55);
    --mk-blue: oklch(50% 0.22 264);
    --mk-magenta: oklch(58% 0.25 330);

    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 1px 2px oklch(20% 0.04 var(--brand-h) / 0.06), 0 12px 32px -12px oklch(20% 0.06 var(--brand-h) / 0.18);
    --gutter: clamp(16px, 4vw, 40px);
    --maxw: 1200px;
    --font: "Plex", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
    --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.08rem);
    --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.4rem);
    --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.05rem);
    --step-3: clamp(1.9rem, 1.5rem + 2vw, 3rem);
    --step-4: clamp(2.3rem, 1.6rem + 3.6vw, 4.4rem);
  }
  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"] { color-scheme: dark; }
}

@layer base {
  html { scroll-behavior: smooth; scroll-padding-top: 88px; }
  body {
    font-family: var(--font);
    font-size: var(--step-0);
    color: var(--ink);
    background: var(--bg);
    accent-color: var(--accent);
  }
  h1, h2, h3 { line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; font-weight: 650; }
  h1 { font-size: var(--step-4); font-stretch: 90%; }
  h2 { font-size: var(--step-3); font-stretch: 92%; }
  h3 { font-size: var(--step-1); }
  p { text-wrap: pretty; }
  a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
  a:hover { text-decoration-thickness: 2px; }
  :focus-visible { outline: 3px solid var(--volt); outline-offset: 3px; border-radius: 6px; }
  ::selection { background: oklch(84% 0.17 88 / 0.55); color: oklch(20% 0.03 264); }
  .visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
}

@layer layout {
  .wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
  section { padding-block: clamp(64px, 9vw, 128px); }
  .section-head { max-width: 62ch; margin-bottom: clamp(32px, 5vw, 56px); }
  .section-head p { color: var(--ink-soft); margin-top: 14px; font-size: var(--step-1); line-height: 1.5; }
  .eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: var(--step--1); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 14px;
    &::before { content: ""; width: 28px; height: 2px; background: currentColor; }
  }
  .alt { background: var(--bg-alt); }
}

@layer components {
  /* ---------- header ---------- */
  .site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in oklch, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid color-mix(in oklch, var(--line) 70%, transparent);
    view-transition-name: site-header;

    .bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
    /* scroll progress line – scroll-driven animation, no JS */
    &::after {
      content: ""; position: absolute; inset: auto 0 -1px 0; height: 2px;
      background: linear-gradient(90deg, var(--accent), var(--volt));
      transform-origin: left; transform: scaleX(0);
    }
  }
  .logo {
    display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
    font-weight: 700; letter-spacing: 0.06em; font-size: 1.12rem; font-stretch: 88%;
    svg { width: 30px; height: 30px; flex: none; }
  }
  .nav-links {
    display: flex; gap: clamp(14px, 2vw, 28px); list-style: none; padding: 0;
    a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
    a:hover { color: var(--ink); }
  }
  .nav-tools { display: flex; align-items: center; gap: 10px; }
  .lang {
    display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; font-size: 0.8rem; font-weight: 600;
    a, span { padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--ink-soft); }
    [aria-current="true"] { background: var(--ink); color: var(--bg); }
  }
  .menu-btn {
    display: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
    border-radius: 10px; padding: 8px 12px; font-weight: 600; cursor: pointer;
  }
  /* mobile menu: native popover + @starting-style entry animation */
  #menu[popover] {
    inset: 76px var(--gutter) auto auto; width: min(320px, calc(100vw - 2 * var(--gutter)));
    border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
    background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
    opacity: 0; translate: 0 -8px;
    transition: opacity 0.2s, translate 0.2s, display 0.2s allow-discrete, overlay 0.2s allow-discrete;
    &:popover-open { opacity: 1; translate: 0 0; }
    ul { list-style: none; padding: 0; display: grid; }
    a { display: block; padding: 12px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
    a:hover { background: var(--bg-alt); }
  }
  @starting-style { #menu[popover]:popover-open { opacity: 0; translate: 0 -8px; } }
  @media (width < 900px) {
    .nav-links { display: none; }
    .menu-btn { display: inline-block; }
  }

  /* ---------- buttons ---------- */
  .btn {
    --b: var(--accent);
    display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px;
    font-weight: 600; text-decoration: none; border: 1.5px solid var(--b); transition: background 0.2s, color 0.2s, translate 0.2s;
    &.primary { background: var(--b); color: var(--accent-ink); }
    &.ghost { color: inherit; border-color: currentColor; }
    &:hover { translate: 0 -1px; }
    svg { width: 18px; height: 18px; }
  }

  /* ---------- cards ---------- */
  .cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
  .card {
    container-type: inline-size;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: clamp(22px, 3vw, 30px); position: relative; overflow: clip;
    transition: border-color 0.25s, box-shadow 0.25s, --glow 0.5s;
    background-image: radial-gradient(circle at 100% 0%, color-mix(in oklch, var(--accent) var(--glow), transparent), transparent 55%);
    &:hover { border-color: color-mix(in oklch, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); --glow: 14%; }
    h3 { margin: 18px 0 10px; }
    p { color: var(--ink-soft); }
    ul { margin-top: 14px; padding-left: 1.1em; color: var(--ink-soft); font-size: 0.95rem; }
    li + li { margin-top: 4px; }
    .icon {
      width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
      background: color-mix(in oklch, var(--accent) 12%, transparent); color: var(--accent);
      svg { width: 26px; height: 26px; }
    }
    .tag {
      position: absolute; top: 22px; right: 22px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
      text-transform: uppercase; color: var(--ink-soft); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px;
    }
  }
  /* card lays out horizontally when the card itself (not the screen) is wide */
  @container (width > 520px) {
    .card-inner { display: grid; grid-template-columns: auto 1fr; gap: 0 20px; }
    .card-inner h3 { margin-top: 4px; }
  }

  /* ---------- duotone photo (greyish CC0 photos become brand-blue duotones) ---------- */
  .duo {
    position: relative; overflow: clip; border-radius: var(--radius-lg); isolation: isolate; background: var(--brand-strong);
    img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15) brightness(0.92); mix-blend-mode: luminosity; opacity: 0.9; }
    &::after {
      content: ""; position: absolute; inset: 0; z-index: 1;
      background: linear-gradient(180deg, oklch(18% 0.06 var(--brand-h) / 0.05) 15%, oklch(16% 0.07 var(--brand-h) / 0.6) 55%, oklch(15% 0.07 var(--brand-h) / 0.94) 100%);
    }
  }
}

@layer sections {
  /* ---------- hero ---------- */
  .hero {
    position: relative; isolation: isolate; color: oklch(97% 0.01 264);
    padding-block: clamp(72px, 12vw, 150px) clamp(56px, 8vw, 110px);
    background: oklch(19% 0.06 var(--brand-h));
    overflow: clip;
    .bg { position: absolute; inset: 0; z-index: -2; }
    .bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; filter: grayscale(1) contrast(1.2); opacity: 0.42; mix-blend-mode: luminosity; }
    &::before {
      content: ""; position: absolute; inset: 0; z-index: -1;
      background:
        radial-gradient(ellipse at 15% 20%, oklch(45% 0.16 var(--brand-h) / 0.55), transparent 55%),
        linear-gradient(100deg, oklch(17% 0.06 var(--brand-h) / 0.96) 30%, oklch(17% 0.06 var(--brand-h) / 0.55) 75%, oklch(17% 0.06 var(--brand-h) / 0.35));
    }
    .grid { display: grid; gap: clamp(32px, 5vw, 64px); align-items: center; grid-template-columns: 1.15fr 0.85fr; }
    @media (width < 960px) { .grid { grid-template-columns: 1fr; } }
    .eyebrow { color: var(--volt); }
    h1 { max-width: 15ch; }
    .lead { margin-top: 22px; max-width: 56ch; font-size: var(--step-1); line-height: 1.5; color: oklch(88% 0.02 264); }
    .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
    .btn.primary { --b: var(--volt); color: oklch(20% 0.03 264); }
    .btn.ghost { color: oklch(96% 0.01 264); }
    .stats {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: clamp(40px, 6vw, 72px);
      border-top: 1px solid oklch(100% 0 0 / 0.16); max-width: 760px;
      div { padding: 18px 18px 0 0; }
      strong { display: block; font-size: var(--step-3); font-weight: 650; font-stretch: 88%; color: oklch(98% 0.01 264); line-height: 1; }
      span { display: block; margin-top: 8px; font-size: 0.9rem; color: oklch(80% 0.03 264); line-height: 1.35; }
    }
    @media (width < 560px) { .stats { grid-template-columns: 1fr 1fr; } }
  }

  /* single-line diagram drawn in the hero */
  .sld {
    width: 100%; max-width: 440px; justify-self: end; color: oklch(92% 0.03 264);
    .w { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .bus { stroke-width: 4; }
    .hot { stroke: var(--volt); }
    .lbl { fill: oklch(80% 0.04 264); font: 600 11px var(--font); letter-spacing: 0.08em; }
    .lbl.v { fill: var(--volt); }
    .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.2s cubic-bezier(.6,0,.2,1) forwards; animation-delay: calc(var(--i, 0) * 0.12s + 0.2s); }
    .flow { stroke-dasharray: 3 14; animation: flow 1.6s linear infinite; }
  }
  @media (width < 960px) { .sld { justify-self: start; max-width: 360px; } }

  /* ---------- services ---------- */
  #servicii, #services { .card { counter-increment: svc; } }

  /* ---------- method: the mark-up colour code ---------- */
  .steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); counter-reset: step; }
  .step {
    counter-increment: step; position: relative; padding: 26px; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--line);
    &::before {
      content: counter(step, decimal-leading-zero); display: block; font-size: var(--step-2); font-weight: 650;
      font-stretch: 85%; color: var(--accent); margin-bottom: 12px;
    }
    p { color: var(--ink-soft); margin-top: 8px; }
  }
  .codes {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding: 0; list-style: none;
    li { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; font-weight: 600; padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--bg-alt); }
    li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
  }

  /* ---------- sectors (photo tiles) ---------- */
  .sectors { display: grid; gap: 16px; grid-template-columns: repeat(6, 1fr); }
  .sector {
    grid-column: span 2; min-height: 300px; display: flex; align-items: flex-end;
    &:nth-child(-n+2) { grid-column: span 3; min-height: 360px; }
    .duo { position: absolute; inset: 0; border-radius: inherit; }
    position: relative; border-radius: var(--radius-lg); overflow: clip; color: oklch(97% 0.01 264);
    .txt { position: relative; z-index: 2; padding: 24px; text-shadow: 0 1px 12px oklch(12% 0.05 var(--brand-h) / 0.6); }
    h3 { font-size: var(--step-1); }
    p { margin-top: 6px; color: oklch(86% 0.02 264); font-size: 0.95rem; line-height: 1.45; }
    img { transition: scale 0.8s cubic-bezier(.2,.7,.2,1); }
    &:hover img { scale: 1.05; }
  }
  @media (width < 900px) {
    .sectors { grid-template-columns: 1fr 1fr; }
    .sector, .sector:nth-child(-n+2) { grid-column: span 1; min-height: 260px; }
    .sector:first-child { grid-column: 1 / -1; }
  }
  @media (width < 560px) { .sectors { grid-template-columns: 1fr; } .sector, .sector:first-child { grid-column: 1 / -1; } }

  /* ---------- about ---------- */
  .about { display: grid; gap: clamp(32px, 5vw, 72px); grid-template-columns: 0.9fr 1.1fr; align-items: start; }
  @media (width < 900px) { .about { grid-template-columns: 1fr; } }
  .about .duo { aspect-ratio: 4 / 5; position: sticky; top: 100px; }
  @media (width < 900px) { .about .duo { aspect-ratio: 16 / 10; position: static; } }
  .timeline {
    list-style: none; padding: 0; margin-top: 28px; border-left: 2px solid var(--line);
    li { position: relative; padding: 0 0 22px 24px; }
    li::before {
      content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
      background: var(--bg); border: 2px solid var(--accent);
    }
    b { display: block; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
    span { color: var(--ink-soft); }
  }
  .creds { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin-top: 28px; }
  .cred {
    padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
    strong { display: block; font-size: 1rem; }
    span { color: var(--ink-soft); font-size: 0.9rem; }
  }

  /* ---------- FAQ: <details> with animated height (interpolate-size + ::details-content) ---------- */
  .faq { max-width: 860px; }
  .faq details {
    border-bottom: 1px solid var(--line);
    &::details-content { block-size: 0; overflow: clip; transition: block-size 0.35s ease, content-visibility 0.35s allow-discrete; }
    &[open]::details-content { block-size: auto; }
    summary {
      list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative; font-weight: 600; font-size: var(--step-1);
      &::-webkit-details-marker { display: none; }
      &::after { content: "+"; position: absolute; right: 4px; top: 18px; font-size: 1.6rem; font-weight: 400; color: var(--accent); transition: rotate 0.3s; }
    }
    &[open] summary::after { rotate: 45deg; }
    p { padding: 0 0 22px; color: var(--ink-soft); max-width: 70ch; }
  }

  /* ---------- contact ---------- */
  .contact {
    border-radius: 28px; padding: clamp(32px, 6vw, 72px); color: oklch(97% 0.01 264);
    background:
      radial-gradient(ellipse at 90% 10%, oklch(55% 0.16 var(--brand-h) / 0.55), transparent 55%),
      linear-gradient(135deg, oklch(33% 0.13 var(--brand-h)), oklch(22% 0.08 var(--brand-h)));
    display: grid; gap: 32px; grid-template-columns: 1.2fr 1fr; align-items: end;
    @media (width < 860px) { grid-template-columns: 1fr; }
    .eyebrow { color: var(--volt); }
    p { color: oklch(87% 0.03 264); margin-top: 14px; font-size: var(--step-1); line-height: 1.5; }
    .channels { display: grid; gap: 12px; }
    a.ch {
      display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius);
      background: oklch(100% 0 0 / 0.08); border: 1px solid oklch(100% 0 0 / 0.14); color: inherit; text-decoration: none;
      transition: background 0.2s;
      &:hover { background: oklch(100% 0 0 / 0.14); }
      svg { width: 22px; height: 22px; flex: none; color: var(--volt); }
      small { display: block; color: oklch(80% 0.03 264); font-size: 0.8rem; }
      strong { font-size: 1.05rem; }
    }
  }

  /* ---------- footer ---------- */
  .site-footer {
    padding-block: 40px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.9rem;
    .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center; }
    a { color: inherit; }
  }
}

@layer motion {
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes flow { to { stroke-dashoffset: -17; } }
  @keyframes reveal { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: 0 0; } }
  @keyframes progress { to { transform: scaleX(1); } }

  @media (prefers-reduced-motion: no-preference) {
    /* scroll-driven animations (Chromium, Safari 26+); elsewhere content simply shows */
    @supports (animation-timeline: view()) {
      .reveal {
        animation: reveal linear both;
        animation-timeline: view();
        animation-range: entry 5% cover 28%;
      }
      /* stagger siblings with sibling-index() where supported */
      @supports (animation-delay: calc(sibling-index() * 1ms)) {
        .cards > .reveal, .steps > .reveal { animation-range: entry calc(sibling-index() * 3%) cover calc(22% + sibling-index() * 3%); }
      }
      .site-header::after {
        animation: progress linear both;
        animation-timeline: scroll(root block);
      }
    }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .sld .draw { stroke-dashoffset: 0; }
  }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.35s; }
}
