/*
  brand.css - fiziqaz.academy look for the /sim/ pages.
  Loaded after app.css. app.css stays the single source of structure; this file
  only swaps the palette, fonts and component shapes for the brand ones, and
  carries the site header/footer rules (the markup is injected at build time
  from src/templates.js, see build.js "chromeSim").
  Light is the brand default; dark is the opt-in toggle, built on the midnight purple.
*/

:root {
  --ink: #16132a;
  --midnight: #2D2745;
  --plum: #63598B;
  --plum-soft: #ebe8f3;
  --coral: #FE614A;
  --coral-dark: #e34a33;
  --sky: #6698FE;
  --sky-soft: #e7eeff;
  --apricot: #F18E61;
  --leaf: #43866C;
  --leaf-soft: #e3f0ea;
  --cream: #F4E2D9;
  --cream-soft: #faf3ee;
  --text: #2a2640;
  --muted: #6f6a86;
  --radius: 18px;
  --font-mono: 'Inter', system-ui, sans-serif; /* JetBrains Mono mangles the Kazakh letters */
  --font-head: 'Comfortaa', 'Inter', system-ui, sans-serif;
  --container: 1160px;
}

/* --- brand palette, light (default) ----------------------------- */
:root,
:root[data-theme="light"] {
  --p-ground:    #ffffff;
  --p-surface:   #ffffff;
  --p-surface-2: #faf3ee;
  --p-sunken:    #fffdfb;
  --p-line:      #e6e2ee;
  --p-line-2:    #cfc9df;
  --p-ink:       #2a2640;
  --p-ink-2:     #5b5675;
  --p-ink-3:     #8a85a3;
  --p-grid:      #efecf5;
  --p-axis:      #9a94b3;

  --p-cyan:      #3f6fe0;   /* sky, deepened for contrast on white */
  --p-cyan-2:    #9db9f5;
  --p-on-cyan:   #ffffff;
  --p-amber:     #d9822b;   /* apricot */
  --p-pink:      #e34a33;   /* coral */
  --p-lime:      #43866C;   /* leaf */
  --p-violet:    #63598B;   /* plum */
  --p-rust:      #c9572c;
  --p-contrast:  #2D2745;

  --shadow-sm: 0 3px 12px rgba(45, 39, 69, .08);
  --shadow-md: 0 10px 30px rgba(45, 39, 69, .10);
  --shadow-lg: 0 18px 44px rgba(45, 39, 69, .16);
}

/* --- brand palette, dark (opt-in) ------------------------------- */
:root[data-theme="dark"] {
  --p-ground:    #1d1a30;
  --p-surface:   #2D2745;
  --p-surface-2: #38315a;
  --p-sunken:    #171428;
  --p-line:      #433c66;
  --p-line-2:    #5a5280;
  --p-ink:       #f4f1fa;
  --p-ink-2:     #c2bcd8;
  --p-ink-3:     #8f89ad;
  --p-grid:      #2a2548;
  --p-axis:      #766f9c;

  --p-cyan:      #8db4ff;
  --p-cyan-2:    #3d5a99;
  --p-on-cyan:   #16132a;
  --p-amber:     #ffb27d;
  --p-pink:      #ff8a78;
  --p-lime:      #6fc9a4;
  --p-violet:    #b9aef0;
  --p-rust:      #F18E61;
  --p-contrast:  #ffffff;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .30);
  --shadow-md: 0 8px 22px rgba(0, 0, 0, .38);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .50);
}

:root,
:root[data-theme="light"],
:root[data-theme="dark"] {
  /* links and active states are plum on the site; coral is reserved for the primary action */
  --accent:      var(--plum);
  --accent-ink:  #ffffff;
  --accent-wash: color-mix(in srgb, var(--plum) 12%, transparent);

  --font-heading: 'Comfortaa', 'Inter', system-ui, sans-serif;
  --font-heading-weight: 700;
  --radius-sm: 10px; --radius-md: 12px; --radius-lg: 18px;
}
:root[data-theme="dark"] {
  --accent:      #b9aef0;
  --accent-ink:  #16132a;
}

/* --- base ------------------------------------------------------- */
html { scroll-behavior: smooth; }
body { font-size: 16px; }
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--midnight); font-weight: 700; letter-spacing: -.01em; }
:root[data-theme="dark"] h1, :root[data-theme="dark"] h2, :root[data-theme="dark"] h3, :root[data-theme="dark"] h4 { color: #fff; }
a { text-decoration: none; }
a:hover { color: var(--coral-dark); }
.fz-container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: 20px; }
.fz-skip { position: absolute; left: -999px; top: 8px; background: var(--midnight); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 1000; }
.fz-skip:focus { left: 8px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
.fz-icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

/* eyebrow labels keep the mono look but take the coral accent */
[data-i18n="heroEyebrow"], #heroTopic { color: var(--coral) !important; font-family: var(--font-head) !important; font-weight: 700; letter-spacing: .14em !important; }

/* --- buttons and chips: pills ----------------------------------- */
.btn { border-radius: 999px; font-family: var(--font-head); font-weight: 700; height: 40px; padding: 0 18px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--coral); border-color: var(--coral); color: #fff; box-shadow: 0 6px 18px rgba(254, 97, 74, .30); }
.btn-primary:hover { background: var(--coral-dark); border-color: var(--coral-dark); color: #fff; }
.btn-secondary { color: var(--midnight); border-color: var(--midnight); background: transparent; }
.btn-secondary:hover { background: var(--midnight); border-color: var(--midnight); color: #fff; }
:root[data-theme="dark"] .btn-secondary { color: #fff; border-color: #fff; }
:root[data-theme="dark"] .btn-secondary:hover { background: #fff; color: var(--midnight); }
.btn-icon { width: 40px; padding: 0; }
.chip { border-radius: 999px; padding: 7px 14px; background: var(--plum-soft); border-color: transparent; color: var(--plum); }
:root[data-theme="dark"] .chip { background: var(--surface-2); color: var(--fg-2); }
.chip:hover { border-color: var(--plum); }
.chip.active { background: var(--plum); border-color: var(--plum); color: #fff; }
:root[data-theme="dark"] .chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tag { border-radius: 999px; padding: 4px 12px; }
.theme-switch { border-radius: 999px; }
.lang-switch { border-radius: 999px; }
.lang-switch-btn { border-radius: 999px; }
.lang-switch-btn.active { background: var(--plum); color: #fff; }
.card, .fx-card { border-radius: var(--radius); }

/* generated simulation cards and the featured card carry small inline radii */
#simGrid > *, #featuredCard { border-radius: var(--radius) !important; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
#simGrid > a:hover, #featuredCard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* --- site header ------------------------------------------------ */
.fz-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.fz-header.is-scrolled { box-shadow: var(--shadow-sm); }
.fz-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.fz-brand img { height: 52px; width: auto; }
.fz-nav { display: flex; align-items: center; gap: 28px; }
.fz-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; }
.fz-nav__list a { font-weight: 600; color: #2D2745; font-size: .98rem; position: relative; }
.fz-nav__list a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--coral); transform: scaleX(0); transition: transform .2s; transform-origin: left; }
.fz-nav__list a:hover::after, .fz-nav__list .current-menu-item a::after { transform: scaleX(1); }
.fz-nav-toggle { display: none; background: none; border: 0; color: #2D2745; padding: 8px; cursor: pointer; }
.fz-nav-toggle .fz-icon { width: 28px; height: 28px; }
.fz-nav-toggle__close { display: none; }
.fz-nav-toggle[aria-expanded="true"] .fz-nav-toggle__open { display: none; }
.fz-nav-toggle[aria-expanded="true"] .fz-nav-toggle__close { display: inline; }
.fz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  font-family: var(--font-head); font-weight: 700; font-size: .95rem; line-height: 1; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.fz-btn:hover { transform: translateY(-1px); }
.fz-btn--primary { background: var(--coral); color: #fff; box-shadow: 0 6px 18px rgba(254, 97, 74, .35); }
.fz-btn--primary:hover { background: var(--coral-dark); color: #fff; }
@media (max-width: 860px) {
  .fz-nav-toggle { display: inline-flex; }
  .fz-nav {
    position: fixed; inset: 76px 0 auto 0; background: #fff; flex-direction: column; align-items: stretch;
    padding: 16px 20px 24px; gap: 8px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .2s;
  }
  .fz-nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .fz-nav__list { flex-direction: column; gap: 0; }
  .fz-nav__list a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .fz-nav__list a::after { display: none; }
  .fz-nav__cta { margin-top: 12px; }
}

/* --- in-page navigation: breadcrumb (inner pages) and tools in the heading row (index) --- */
.sim-crumbs { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-top: 22px; font-size: .88rem; color: var(--fg-3); }
.sim-crumbs a { color: var(--plum); font-weight: 600; }
:root[data-theme="dark"] .sim-crumbs a { color: var(--accent); }
.sim-crumbs + section { padding-top: 26px !important; }
.sim-tools { display: inline-flex; align-items: center; gap: 8px; }
.sim-tools .theme-switch { height: 32px; font-size: 12.5px; }
.sim-tools .lang-switch-btn { padding: 4px 8px; }
.sim-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.sim-head__title { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.sim-head__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-search { border-radius: 999px !important; background: var(--surface); height: 36px; }
@media (max-width: 700px) { .sim-head__tools { width: 100%; } .nav-search { flex: 1 1 100%; } .nav-search input { width: 100% !important; } }

/* --- site footer ------------------------------------------------ */
.fz-footer { background: #2D2745; color: #cfcadf; padding-top: 56px; margin-top: 40px; }
.fz-footer a { color: #fff; }
.fz-footer a:hover { color: var(--apricot); }
.fz-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.fz-footer__brand img { height: 56px; width: auto; margin-bottom: 14px; }
.fz-footer__brand p { max-width: 36ch; font-size: .95rem; color: #cfcadf; }
.fz-footer h3 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.fz-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fz-footer__list a { display: inline-flex; align-items: center; gap: 8px; }
.fz-footer__bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: .88rem; }
@media (max-width: 800px) { .fz-footer__grid { grid-template-columns: 1fr; gap: 28px; } }
.fz-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 90; width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(37, 211, 102, .45);
}
.fz-fab:hover { color: #fff; }
.fz-fab .fz-icon { width: 30px; height: 30px; }

/* --- simulation workspace (sim.html) ---------------------------- */
.app .app-head { height: 60px; gap: 12px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.app .brand img { height: 36px; width: auto; }
.app .brand .logo-dark { display: none; }
:root[data-theme="dark"] .app .brand .logo-light { display: none; }
:root[data-theme="dark"] .app .brand .logo-dark { display: block; }
.app-back {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--plum);
  background: var(--plum-soft); flex: none;
}
.app-back:hover { background: var(--plum); color: #fff; }
.app-back svg { width: 18px; height: 18px; }
:root[data-theme="dark"] .app-back { background: var(--surface-2); color: var(--accent); }
.app .crumb { font-family: var(--font-head); font-weight: 600; }
.app .crumb b { color: var(--coral); }
.app .tab-btn { border-radius: 999px; font-family: var(--font-head); }
.app .tab-btn.active { background: var(--plum); border-color: var(--plum); color: #fff; }
:root[data-theme="dark"] .app .tab-btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.app .stage { border-radius: var(--radius); }
.app .card { box-shadow: var(--shadow-sm); }
.app .card-title, .app .claim { font-family: var(--font-heading); }
:root[data-present] .app-back { display: none; }
@media (max-width: 700px) { .app .crumb { display: none; } }

/* --- responsive: the page templates hardcode multi-column grids inline --- */
@media (max-width: 1000px) {
  #simGrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 900px) {
  section[style*="grid-template-columns"] { grid-template-columns: 1fr !important; gap: 28px !important; padding-inline: 20px !important; }
  section h1[style*="font-size"] { font-size: clamp(2rem, 8vw, 3rem) !important; }
}
@media (max-width: 560px) {
  #simGrid { grid-template-columns: 1fr !important; }
}

/* problem-bank cards on the simulation landing pages */
.fz-sim-go { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--coral); }
#documentsGrid .fx-card:hover { border-color: var(--coral); transform: translateY(-2px); box-shadow: var(--shadow-md); }
#documentsGrid .fx-card { transition: transform .2s, box-shadow .2s, border-color .2s; }
@media (max-width: 900px) { #documentsGrid, #relatedGrid { grid-template-columns: 1fr !important; } section[style*="1fr 1.6fr"] { grid-template-columns: 1fr !important; gap: 16px !important; } }
