/* Shared homepage styles. Used by / (English) and /bg/ (Bulgarian).
   Extracted from index.html's former inline <style> block so both
   language versions share one stylesheet instead of drifting copies. */
  :root {
    color-scheme: light;
    --ink: #10151b;
    --ink-soft: #333c46;
    --paper: #f2f2ec;
    --paper-raised: #ffffff;
    --ledger: #1f5fae;
    --ledger-dark: #163f78;
    --ledger-light: #6fa3e0;
    --line: #d8d8ce;
    --muted: #5b6169;
    --focus: #163f78;
    --radius: 3px;
  }
  * { box-sizing: border-box; }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
  body {
    margin: 0;
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3, .display { font-family: 'Piazzolla', Georgia, serif; letter-spacing: -0.01em; }
  h1, h2, h3 { text-wrap: balance; margin: 0; }
  p { text-wrap: pretty; }
  a { color: inherit; }
  img { max-width: 100%; display: block; }
  ::selection { background: var(--ledger); color: var(--paper); }

  .wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
  .measure { max-width: 62ch; }

  a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 2px;
  }

  .skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--ink); color: var(--paper); padding: 12px 18px;
    font-weight: 600; text-decoration: none;
  }
  .skip-link:focus { left: 12px; top: 12px; }

  .tabular { font-variant-numeric: tabular-nums; }

  /* ===== Header ===== */
  header.site {
    position: sticky; top: 0; z-index: 30;
    background: rgba(242,242,236,0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 0;
    gap: 20px;
  }
  .brand {
    font-family: 'Piazzolla', serif; font-weight: 600; font-size: 1.25rem;
    text-decoration: none; letter-spacing: -0.01em;
    display: flex; align-items: baseline; gap: 8px;
  }
  .brand .mark { width: 30px; height: 30px; display: block; }
  nav.links { display: flex; gap: 28px; }
  nav.links a {
    text-decoration: none; font-size: 0.9062rem; font-weight: 500; color: var(--ink-soft);
    padding: 4px 0; border-bottom: 1px solid transparent;
    transition: border-color 160ms ease-out, color 160ms ease-out;
  }
  nav.links a:hover { color: var(--ink); border-color: var(--ledger); }
  .nav-cta {
    background: var(--ledger); color: #fff;
    padding: 10px 20px; text-decoration: none; font-size: 0.875rem; font-weight: 600;
    min-height: 44px; display: inline-flex; align-items: center;
    border-radius: var(--radius);
    transition: background 160ms ease-out, transform 160ms ease-out;
    white-space: nowrap;
  }
  .nav-cta:hover { background: var(--ledger-dark); transform: translateY(-1px); }
  /* Language switcher: EN / BG. Stays visible on mobile (unlike .nav-cta) since
     it's only four characters wide and is a primary navigation control here. */
  .lang-switch {
    display: inline-flex; align-items: center;
    font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; letter-spacing: 0.04em;
  }
  .lang-switch a {
    text-decoration: none; color: var(--muted); padding: 0 7px;
    min-height: 44px; display: inline-flex; align-items: center;
    border-bottom: 1px solid transparent;
    transition: color 160ms ease-out, border-color 160ms ease-out;
  }
  .lang-switch a:hover { color: var(--ink); }
  .lang-switch a[aria-current="page"] { color: var(--ink); border-color: var(--ledger); }
  .lang-switch .sep { color: var(--line); }
  .menu-toggle {
    display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius);
    width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer;
  }
  .menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
    content: ""; display: block; width: 18px; height: 2px; background: var(--ink); position: relative;
    transition: transform 160ms ease-out, opacity 160ms ease-out;
  }
  .menu-toggle span::before { position: absolute; top: -6px; }
  .menu-toggle span::after { position: absolute; top: 6px; }

  @media (max-width: 760px) {
    nav.links { position: fixed; inset: 65px 0 auto 0; background: var(--paper); flex-direction: column;
      padding: 18px 28px 24px; border-bottom: 1px solid var(--line); gap: 4px; transform: translateY(-8px);
      opacity: 0; pointer-events: none; transition: opacity 180ms ease-out, transform 180ms ease-out; }
    nav.links.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
    nav.links a { padding: 12px 0; border-bottom: 1px solid var(--line); }
    .menu-toggle { display: flex; }
    .nav-cta.desktop-only { display: none; }
  }

  /* ===== Hero ===== */
  .hero { padding: 84px 0 64px; position: relative; }
  .hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: end; }
  .hero h1 { font-size: clamp(2.4rem, 4.6vw, 3.9rem); font-weight: 500; line-height: 1.05; }
  .hero h1 .accent-word { color: var(--ink); font-style: italic; font-weight: 400; }
  .hero p.sub { margin-top: 22px; font-size: 1.125rem; color: var(--ink-soft); }
  .hero-actions { margin-top: 34px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
  .btn-primary {
    background: var(--ledger); color: #fff; padding: 14px 26px; text-decoration: none;
    font-weight: 600; font-size: 0.9375rem; border-radius: var(--radius); border: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 10px;
    transition: background 160ms ease-out, transform 160ms ease-out;
  }
  .btn-primary:hover { background: var(--ledger-dark); transform: translateY(-1px); }
  .btn-ghost {
    color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.9375rem;
    border-bottom: 1px solid var(--ink); padding-bottom: 2px;
  }
  .btn-ghost:hover { color: var(--ledger-dark); border-color: var(--ledger-dark); }

  /* Signature graphic: ledger growth line */
  .ledger-graphic { position: relative; }
  .ledger-graphic svg { width: 100%; height: auto; }
  .path-draw {
    stroke-dasharray: 900; stroke-dashoffset: 900;
    animation: draw 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
  }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @media (prefers-reduced-motion: reduce) { .path-draw { animation: none; stroke-dashoffset: 0; } }

  @media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; }
    .ledger-graphic { display: none; }
  }

  /* ===== Section scaffolding ===== */
  section { padding: 76px 0; border-top: 1px solid var(--line); }
  .section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 44px; flex-wrap: wrap; }
  .section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 500; }
  .section-head .note { max-width: 40ch; color: var(--muted); font-size: 0.9375rem; }

  /* ===== Scroll reveal (progressive enhancement only) ===== */
  /* Default: everything visible. Works with no JS and with reduced motion. */
  html.js-reveal-ready .reveal {
    opacity: 0; transform: translateY(18px);
    transition: opacity 560ms cubic-bezier(0.16,1,0.3,1), transform 560ms cubic-bezier(0.16,1,0.3,1);
  }
  html.js-reveal-ready .reveal.in-view { opacity: 1; transform: translateY(0); }
  html.js-reveal-ready .reveal-row { transition-delay: calc(var(--i, 0) * 70ms); }

  /* ===== Market News (TradingView widget) ===== */
  .market-news-card {
    border-radius: var(--radius);
    background: transparent; padding: 4px; overflow: hidden;
  }
  .market-news-attribution {
    margin-top: 14px; font-family: 'IBM Plex Mono', monospace; font-size: 0.6875rem;
    color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
  }
  .tradingview-widget-placeholder {
    display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
    padding: 40px 24px; min-height: 460px; justify-content: center;
    border: 1px dashed var(--line); border-radius: var(--radius);
    color: var(--muted); font-size: 0.9375rem; max-width: 420px;
  }
  .tradingview-widget-placeholder .legal-btn {
    display: inline-flex; align-items: center; background: var(--ledger); color: #fff;
    padding: 10px 18px; min-height: 44px; border-radius: var(--radius); text-decoration: none;
    font-size: 0.875rem; font-weight: 600; border: none; cursor: pointer; font-family: inherit;
  }
  .tradingview-widget-placeholder .legal-btn:hover { background: var(--ledger-dark); }

  /* ===== Strategies (ledger rows, not cards) ===== */
  .ledger-rows { border-top: 1px solid var(--line); }
  .ledger-row {
    display: grid; grid-template-columns: 260px 1fr; gap: 40px;
    padding: 30px 0; border-bottom: 1px solid var(--line);
    align-items: baseline;
  }
  .ledger-row .name {
    font-family: 'Piazzolla', serif; font-weight: 500; font-size: 1.5rem;
  }
  .ledger-row p { color: var(--ink-soft); max-width: 58ch; margin: 0; }
  @media (max-width: 700px) {
    .ledger-row { grid-template-columns: 1fr; gap: 10px; }
  }

  /* ===== Crypto ===== */
  .crypto-panel {
    background: var(--ink); color: var(--paper);
    border-radius: var(--radius); padding: 52px;
  }
  .crypto-panel h2 { color: #fff; font-size: clamp(1.6rem, 2.8vw, 2.1rem); font-weight: 500; }
  .crypto-panel p { color: #c7ccd1; margin-top: 16px; max-width: 52ch; }
  @media (max-width: 700px) {
    .crypto-panel { padding: 34px 26px; }
  }

  /* ===== Pricing ===== */
  .price-table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--line); }
  .price-table th {
    text-align: left; font-family: 'IBM Plex Mono', monospace; font-size: 0.7188rem;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 500;
    padding: 12px 0; border-bottom: 1px solid var(--line);
  }
  .price-table td { padding: 22px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
  .price-table td:last-child, .price-table th:last-child { text-align: right; }
  .price-table .service { font-family: 'Piazzolla', serif; font-size: 1.125rem; font-weight: 500; width: 30%; }
  .price-table .desc { color: var(--ink-soft); font-size: 0.9062rem; padding-right: 24px; }
  .price-table .price {
    font-family: 'IBM Plex Mono', monospace; font-weight: 500; font-size: 1rem;
    color: var(--ledger-dark); white-space: nowrap; text-align: right; width: 15%;
  }
  .price-table .price small { display: block; color: var(--muted); font-weight: 400; font-size: 0.7188rem; margin-top: 3px; }
  .price-note { margin-top: 18px; font-size: 0.7812rem; color: var(--muted); }
  @media (max-width: 700px) {
    .price-table thead { display: none; }
    .price-table tr {
      display: grid;
      grid-template-columns: 1fr auto;
      grid-template-areas: "service price" "desc desc";
      column-gap: 14px; row-gap: 6px;
      padding: 16px 0; border-bottom: 1px solid var(--line);
    }
    .price-table td { padding: 0; border-bottom: none; width: auto; }
    .price-table .service { grid-area: service; font-size: 1.0312rem; }
    .price-table .price { grid-area: price; text-align: right; align-self: start; }
    .price-table .desc { grid-area: desc; font-size: 0.8438rem; padding-right: 0; }
  }

  .rate-panel { background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: 44px; margin-top: 48px; }
  .rate-panel h3 { color: #fff; font-size: 1.1875rem; font-weight: 500; }
  .rate-panel > p { color: #c7ccd1; margin-top: 10px; font-size: 0.9062rem; max-width: 52ch; }
  .rate-panel .limit { font-family: 'IBM Plex Mono', monospace; font-size: 0.8125rem; color: var(--ledger-light); margin-top: 14px; }
  .rate-grid { margin-top: 26px; display: grid; gap: 0; }
  .rate-row { padding: 12px 0; border-bottom: 1px solid rgba(242,242,236,0.14); }
  .rate-row:last-child { border-bottom: none; }
  .rate-row-top {
    display: flex; justify-content: space-between;
    font-family: 'IBM Plex Mono', monospace; font-size: 0.8438rem;
  }
  .rate-row .pct { color: var(--ledger-light); font-weight: 500; }
  .rate-bar-track { height: 4px; background: rgba(242,242,236,0.14); border-radius: 2px; margin-top: 10px; overflow: hidden; }
  .rate-bar-fill {
    height: 100%; width: var(--target); background: var(--ledger-light); border-radius: 2px;
    transform-origin: left center; transform: scaleX(1);
  }
  html.js-reveal-ready .rate-bar-fill {
    transform: scaleX(0);
    transition: transform 900ms cubic-bezier(0.16,1,0.3,1);
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  html.js-reveal-ready .rate-row.in-view .rate-bar-fill { transform: scaleX(1); }

  /* ===== About ===== */
  .about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
  .about-grid .stat-block { border-left: 2px solid var(--ledger); padding-left: 20px; }
  .about-grid .stat-block + .stat-block { margin-top: 28px; }
  .about-grid .stat-block .k { font-family: 'IBM Plex Mono', monospace; font-size: 0.8125rem; color: var(--ledger-dark); text-transform: uppercase; letter-spacing: 0.05em; }
  .about-grid .stat-block .v { font-size: 1rem; margin-top: 4px; color: var(--ink-soft); }
  @media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }

  /* ===== Team ===== */
  .team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); border: 1px solid var(--line); }
  .team-card { background: var(--paper); padding: 40px; position: relative; overflow: hidden; }
  .team-card .photo {
    width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
    filter: grayscale(1) contrast(1.05); margin-bottom: 20px; position: relative;
    border: 1px solid var(--line);
  }
  .team-card h3 { font-size: 1.3125rem; font-weight: 500; position: relative; }
  .team-card .role {
    font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--ledger-dark);
    text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; margin-bottom: 16px; position: relative;
  }
  .team-card p { color: var(--ink-soft); font-size: 1rem; position: relative; max-width: 50ch; }
  @media (max-width: 700px) { .team-grid { grid-template-columns: 1fr; } }

  /* ===== CTA / Contact ===== */
  .cta-section { background: var(--paper-raised); }
  .cta-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 60px; }
  .cta-copy h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 500; }
  .cta-copy p { color: var(--muted); margin-top: 16px; max-width: 40ch; }
  .cta-copy .contact-line { margin-top: 28px; font-family: 'IBM Plex Mono', monospace; font-size: 0.875rem; }
  .cta-copy .contact-line a { text-decoration: underline; text-underline-offset: 3px; }

  form.consult {
    display: grid; gap: 18px;
  }
  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .field { display: flex; flex-direction: column; gap: 7px; }
  .field label { font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); }
  .field input, .field textarea {
    font: inherit; font-size: 0.9375rem; padding: 12px 14px; border: 1px solid var(--line);
    border-radius: var(--radius); background: #fff; color: var(--ink);
    transition: border-color 160ms ease-out;
  }
  .field input:hover, .field textarea:hover { border-color: var(--muted); }
  .field textarea { resize: vertical; min-height: 120px; }
  .field .hint { font-size: 0.7812rem; color: var(--muted); }
  form.consult .submit-row { display: flex; align-items: center; gap: 16px; margin-top: 6px; flex-wrap: wrap; }
  .form-status { font-size: 0.8438rem; color: var(--muted); }
  .form-status.form-status-error { color: #b3312c; }
  /* Honeypot: hidden from sighted users and kept out of the tab order, but
     still present in the DOM/accessibility tree for basic bots that fill in
     every field regardless of visibility. Real assistive-tech users never
     reach it since it's not focusable. */
  .hp-field {
    position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
  }
  @media (max-width: 860px) { .cta-grid { grid-template-columns: 1fr; } .field-row { grid-template-columns: 1fr; } }

  /* ===== Footer ===== */
  footer {
    border-top: 1px solid var(--line); padding: 48px 0 28px; color: var(--muted); font-size: 0.8125rem;
  }
  .footer-grid {
    display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
    padding-bottom: 28px; border-bottom: 1px solid var(--line);
  }
  .footer-col h4 {
    font-family: 'IBM Plex Mono', monospace; font-size: 0.6875rem; color: var(--ink-soft);
    text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; margin: 0 0 14px;
  }
  .footer-col p { margin: 0; max-width: 32ch; }
  .footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
  .footer-bottom {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
    gap: 12px; padding-top: 22px; font-size: 0.7812rem;
  }
  footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
  footer a:hover { color: var(--ink); }
  @media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
    .footer-col:first-child { grid-column: 1 / -1; }
    .footer-col:first-child p { max-width: 42ch; }
  }

  /* ===== Cookie consent banner ===== */
  .cookie-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
    max-width: 560px; margin: 0 auto;
    background: var(--ink); color: var(--paper);
    border-radius: var(--radius); padding: 22px 24px;
    box-shadow: 0 12px 32px rgba(16,21,27,0.28);
    display: none;
  }
  .cookie-banner.is-visible { display: block; }
  html.js-reveal-ready .cookie-banner.is-visible {
    animation: cookie-in 420ms cubic-bezier(0.16,1,0.3,1);
  }
  @keyframes cookie-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
  .cookie-banner p {
    margin: 0 0 16px; font-size: 0.8438rem; color: #c7ccd1; max-width: 60ch;
  }
  .cookie-banner p a { color: var(--ledger-light); text-decoration: underline; text-underline-offset: 2px; }
  .cookie-actions { display: flex; gap: 12px; flex-wrap: wrap; }
  .cookie-actions button {
    font: inherit; font-size: 0.8438rem; font-weight: 600; padding: 10px 18px;
    min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius); cursor: pointer; border: 1px solid transparent;
  }
  .cookie-accept { background: var(--ledger); color: #fff; }
  .cookie-accept:hover { background: var(--ledger-dark); }
  .cookie-reject { background: transparent; color: var(--paper); border-color: rgba(242,242,236,0.35); }
  .cookie-reject:hover { border-color: var(--paper); }
