/* ==========================================================================
   TALOS TERMINAL — Endfield Dual-Theme Visual Tokens (Day / Night)
   Source of Truth for Codex UI implementation (Route 1 CSS + Route 2 Assets)
   ========================================================================== */

:root {
  /* Light / Day Industrial Paper */
  --ef-paper: #f4f4f2;
  --ef-panel: #ffffff;
  --ef-slot: #e4e4e0;
  --ef-slot-dark: #1d1d1d;
  --ef-ink: #161616;
  --ef-ink-2: #5c5c5c;
  --ef-rule: #d9d9d6;
  --ef-chip: #e4e4e0;

  /* Fixed Brand & Semantic Accents */
  --ef-cmdbar: #161616;
  --ef-cmdbar-text: #ededed;
  --ef-signal: #fffa00;
  --ef-on-signal: #161616;
  --ef-trace: #161616;
  --ef-tag-bg: #161616;
  --ef-tag-fg: #ffffff;
  --ef-danger: #b3261e;
  --ef-mint: #00b876;

  /* Official 3px Tri-Color Strip (Top Edge / Gacha Accent Only) */
  --ef-tri-a: #ff00f0;
  --ef-tri-b: #fffa00;
  --ef-tri-c: #00ffa2;

  /* Texture & Watermark */
  --ef-contour-opacity: 0.085;
  --ef-hatch: repeating-linear-gradient(
    -45deg,
    transparent 0 5px,
    rgba(22, 22, 22, 0.2) 5px 6.5px
  );
  --ef-hatch-soft: repeating-linear-gradient(
    -45deg,
    transparent 0 6px,
    rgba(22, 22, 22, 0.08) 6px 7.5px
  );

  /* Typography */
  --ef-font-ui: 'Saira Variable', 'Saira', 'DIN Alternate', 'PingFang SC', 'Noto Sans SC', 'Hiragino Sans GB', sans-serif;
  --ef-font-text: 'PingFang SC', 'Noto Sans SC', 'Hiragino Sans GB', sans-serif;
  --ef-font-mono: ui-monospace, 'SFMono-Regular', 'Cascadia Code', Consolas, monospace;

  /* Geometry (Strict 0px border-radius; 45-deg cut corners) */
  --ef-cut: 7px;
  --ef-cut-btn: 9px;
  --ef-cut-panel: 22px;

  /* Mechanical Motion Curves */
  --ef-ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ef-snap: cubic-bezier(0.16, 1, 0.3, 1);
  --ef-mech: cubic-bezier(0.7, 0, 0.2, 1);

  color-scheme: light;
}

:root[data-theme='dark'] {
  --ef-paper: #191919;
  --ef-panel: #222222;
  --ef-slot: #2a2a2a;
  --ef-slot-dark: #161616;
  --ef-ink: #ededed;
  --ef-ink-2: #a3a3a3;
  --ef-rule: #353535;
  --ef-chip: #2e2e2e;
  --ef-trace: #fffa00;
  --ef-tag-bg: #3a3a3a;
  --ef-tag-fg: #ededed;
  --ef-danger: #ff8a7a;
  --ef-mint: #00ffa2;
  --ef-contour-opacity: 0.11;
  --ef-hatch: repeating-linear-gradient(
    -45deg,
    transparent 0 5px,
    rgba(237, 237, 237, 0.22) 5px 6.5px
  );
  --ef-hatch-soft: repeating-linear-gradient(
    -45deg,
    transparent 0 6px,
    rgba(237, 237, 237, 0.09) 6px 7.5px
  );

  color-scheme: dark;
}

/* Monochrome White-Ink Game PNG Auto-Adaptation (Day = Black, Night = White) */
:root:not([data-theme='dark']) .ef-mono-asset {
  filter: invert(1);
}

/* View-Transition Diagonal Shutter Wipe for Day/Night Switching */
@keyframes ef-shutter {
  from { clip-path: polygon(0 0, 0 0, -14% 100%, -14% 100%); }
  to { clip-path: polygon(0 0, 114% 0, 100% 100%, -14% 100%); }
}
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: none; }
  ::view-transition-new(root) { animation: ef-shutter 360ms var(--ef-mech) both; }
}
