@import "tailwindcss";

/* ==========================================================
   Finzone Design Tokens — B v2 "Premium Editorial"
   ========================================================== */

@theme {
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-display-vi: "Newsreader", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --container-content: 1280px;
  --container-reading: 720px;

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.3, 0, 0, 1);

  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;
}

/* B v2 light tokens — DEFAULT SKIN: finzone-v1 (Premium Editorial) */
:root,
[data-skin="v1"] {
  --bg: #F5F1E8;
  --bg-2: #EAE3D2;
  --paper: #FBF8F0;
  --ink: #1F1810;
  --ink-2: #4A3F30;
  --ink-3: #87796A;
  --line: #C5B89E;
  --line-soft: #D8CDB5;
  --accent: #B8742E;
  --accent-2: #8B5A1F;
  --gold: #C9A55C;
  --up: #5A7C3A;
  --down: #A03830;

  /* Aliases used by existing components */
  --bg-base: var(--paper);
  --bg-subtle: var(--bg);
  --bg-muted: var(--bg-2);
  --bg-elevated: var(--paper);
  --border: var(--line-soft);
  --border-strong: var(--line);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-tertiary: var(--ink-3);
  --ring-focus: var(--accent);
  --brand-500: var(--accent);
  --brand-600: var(--accent-2);
  --brand-50: var(--bg-2);
  --price-up: var(--up);
  --price-up-bg: color-mix(in oklch, var(--up) 14%, transparent);
  --price-down: var(--down);
  --price-down-bg: color-mix(in oklch, var(--down) 14%, transparent);

  /* Category accents */
  --cat-crypto: #7A3FF2;
  --cat-stock:  #1E5BD9;
  --cat-gold:   #B8860B;
  --cat-forex:  #0E7C6A;
  --cat-analysis: #87796A;
  --cat-breaking: #C8412B;

  --shadow-sm: 0 1px 2px rgba(31,24,16,.06);
  --shadow-md: 0 4px 8px -2px rgba(31,24,16,.1);
  --shadow-lg: 0 10px 20px -4px rgba(31,24,16,.12);

  /* Skin radius scale (V1 = soft, rounded) */
  --skin-radius-card: 4px;
  --skin-radius-pill: 2px;
  --skin-radius-btn: 4px;
}

[data-theme="dark"],
[data-skin="v1"][data-theme="dark"] {
  --bg: #1A130A;
  --bg-2: #251A0E;
  --paper: #20180D;
  --ink: #F5EBD8;
  --ink-2: #C4B89E;
  --ink-3: #8B7A60;
  --line: #4A3D28;
  --line-soft: #2E2516;
  --accent: #D49A57;
  --accent-2: #B8742E;
  --gold: #E5C07B;
  --up: #8FB35F;
  --down: #D6685C;

  --cat-crypto: #9F71FF;
  --cat-stock:  #5083F5;
  --cat-gold:   #E0A82E;
  --cat-forex:  #19A98F;
  --cat-analysis: #A39988;
  --cat-breaking: #E5634A;

  --shadow-sm: 0 1px 0 rgba(255,255,255,.04) inset;
  --shadow-md: 0 0 0 1px rgba(255,255,255,.06);
  --shadow-lg: 0 0 0 1px rgba(255,255,255,.08);
}

/* ==========================================================
   SKIN: finzone-v2 "Trader Terminal"
   Data-dense, mono-first, sharp edges, electric cyan accent
   ========================================================== */
[data-skin="v2"] {
  --bg: #F1F4F8;
  --bg-2: #E2E8F0;
  --paper: #FFFFFF;
  --ink: #0A1628;
  --ink-2: #334155;
  --ink-3: #64748B;
  --line: #CBD5E1;
  --line-soft: #E2E8F0;
  --accent: #0891B2;
  --accent-2: #0E7490;
  --gold: #CA8A04;
  --up: #059669;
  --down: #DC2626;

  --bg-base: var(--paper);
  --bg-subtle: var(--bg);
  --bg-muted: var(--bg-2);
  --bg-elevated: var(--paper);
  --border: var(--line-soft);
  --border-strong: var(--line);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-tertiary: var(--ink-3);
  --ring-focus: var(--accent);
  --brand-500: var(--accent);
  --brand-600: var(--accent-2);
  --brand-50: var(--bg-2);
  --price-up: var(--up);
  --price-up-bg: color-mix(in oklch, var(--up) 14%, transparent);
  --price-down: var(--down);
  --price-down-bg: color-mix(in oklch, var(--down) 14%, transparent);

  --cat-crypto: #7C3AED;
  --cat-stock:  #2563EB;
  --cat-gold:   #CA8A04;
  --cat-forex:  #059669;
  --cat-analysis: #475569;
  --cat-breaking: #DC2626;

  --shadow-sm: 0 1px 0 rgba(10,22,40,.04);
  --shadow-md: 0 0 0 1px rgba(10,22,40,.08);
  --shadow-lg: 0 0 0 1px rgba(10,22,40,.12), 0 4px 12px rgba(10,22,40,.08);

  /* V2 radius = sharp/zero */
  --skin-radius-card: 0px;
  --skin-radius-pill: 0px;
  --skin-radius-btn: 0px;
}

[data-skin="v2"][data-theme="dark"] {
  --bg: #0A0E1A;
  --bg-2: #131826;
  --paper: #0F1421;
  --ink: #E2E8F0;
  --ink-2: #94A3B8;
  --ink-3: #64748B;
  --line: #1E293B;
  --line-soft: #131826;
  --accent: #06B6D4;
  --accent-2: #0891B2;
  --gold: #FCD34D;
  --up: #10B981;
  --down: #F87171;

  --cat-crypto: #A78BFA;
  --cat-stock:  #60A5FA;
  --cat-gold:   #FCD34D;
  --cat-forex:  #34D399;
  --cat-analysis: #94A3B8;
  --cat-breaking: #F87171;

  --shadow-sm: 0 0 0 1px rgba(6,182,212,.08);
  --shadow-md: 0 0 0 1px rgba(6,182,212,.12);
  --shadow-lg: 0 0 0 1px rgba(6,182,212,.18), 0 0 24px rgba(6,182,212,.08);
}

/* Tailwind utility shortcuts */
@theme inline {
  --color-brand-500: var(--brand-500);
  --color-brand-600: var(--brand-600);
  --color-accent: var(--accent);
  --color-gold: var(--gold);
  --color-bg-base: var(--bg-base);
  --color-bg-subtle: var(--bg-subtle);
  --color-bg-muted: var(--bg-muted);
  --color-bg-elevated: var(--bg-elevated);
  --color-paper: var(--paper);
  --color-ink: var(--ink);
  --color-ink-2: var(--ink-2);
  --color-ink-3: var(--ink-3);
  --color-border-base: var(--border);
  --color-border-strong: var(--border-strong);
  --color-text-primary: var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-text-tertiary: var(--text-tertiary);
}

/* ==========================================================
   Base
   ========================================================== */
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" on, "lnum" on;
}

/* ==========================================================
   Display type (B v2 — same structure as B, smaller scale)
   ========================================================== */

.logo-display {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'SOFT' 30, 'WONK' 1;
}

.display-xl {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.8vw, 60px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'SOFT' 30, 'WONK' 1;
}

.display-lg-vi {
  font-family: var(--font-display-vi);
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-weight: 500;
  font-style: italic;
}

.display-md {
  font-family: var(--font-display);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.2;
  letter-spacing: -0.005em;
  font-weight: 500;
  font-variation-settings: 'opsz' 36;
}

.display-sm-vi {
  font-family: var(--font-display-vi);
  font-size: 22px;
  line-height: 1.3;
  font-weight: 500;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
}

/* ==========================================================
   Components
   ========================================================== */

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all var(--duration-base) var(--ease-standard);
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover { background: var(--accent-2); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 13px;
  transition: all var(--duration-base) var(--ease-standard);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-secondary:hover { border-color: var(--ink); background: var(--bg-2); }

/* Card (B v2 — bordered with offset shadow on hover) */
.card-modern {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-standard);
}
.card-modern:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 4px 4px 0 var(--accent);
}

/* Pills (B v2 — outlined w/ dot) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Section bar */
.section-bar {
  display: flex;
  align-items: end;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 32px;
}

/* Article prose styles */
.prose-fz {
  /* Constrain wide WP content (iframes, tables, images) so they never overflow into sidebar */
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.prose-fz > * {
  max-width: 100%;
}
.prose-fz p {
  margin: 0 0 1.25em;
  line-height: 1.75;
  font-size: 17px;
  color: var(--ink);
  overflow-wrap: break-word;
}
.prose-fz p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 5em;
  float: left;
  line-height: 0.85;
  padding: 8px 12px 0 0;
  color: var(--accent);
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
}
.prose-fz h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
  margin: 1.6em 0 0.5em;
  color: var(--ink);
  letter-spacing: -0.015em;
  font-variation-settings: 'opsz' 72;
}
.prose-fz h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.25;
  margin: 1.4em 0 0.4em;
  color: var(--ink);
}
.prose-fz blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 1.5em 0;
  color: var(--ink-2);
  font-style: italic;
  font-family: var(--font-display);
  font-size: 1.15em;
}
.prose-fz a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose-fz a:hover { color: var(--accent-2); }
.prose-fz img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5em 0;
  display: block;
}
.prose-fz iframe,
.prose-fz video,
.prose-fz embed,
.prose-fz object {
  max-width: 100%;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  margin: 1.5em 0;
  border: 0;
}
.prose-fz figure {
  margin: 1.5em 0;
  max-width: 100%;
}
.prose-fz figure img { margin: 0; }
.prose-fz figcaption {
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 8px;
  font-family: var(--font-display);
  font-style: italic;
}
.prose-fz ul, .prose-fz ol {
  padding-left: 1.5em;
  margin: 0 0 1.25em;
}
.prose-fz ul { list-style: disc; }
.prose-fz ol { list-style: decimal; }
.prose-fz li { margin-bottom: 0.4em; line-height: 1.7; }
.prose-fz table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 14px;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.prose-fz table thead, .prose-fz table tbody { display: table; width: 100%; }
.prose-fz th, .prose-fz td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  white-space: normal;
}
.prose-fz th {
  font-weight: 600;
  border-bottom: 2px solid var(--line);
  background: var(--bg-2);
}
.prose-fz code {
  font-family: var(--font-mono);
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 0.9em;
}
.prose-fz pre {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 16px;
  overflow-x: auto;
  margin: 1.5em 0;
}
.prose-fz pre code { background: transparent; padding: 0; }

/* Reading progress */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  width: 0%;
  z-index: 60;
  transition: width 100ms linear;
  pointer-events: none;
}

/* Ticker */
.ticker-track {
  display: flex;
  gap: 48px;
  animation: ticker-scroll 50s linear infinite;
  white-space: nowrap;
  width: max-content;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker-track:hover { animation-play-state: paused; }

/* Hairlines */
.hairline { border-color: var(--line-soft); }
.hairline-strong { border-color: var(--line); }

/* Post row hover */
.post-row { transition: background 200ms; }
.post-row:hover { background: var(--bg-2); }

/* Hide scrollbar */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================
   SKIN V2 OVERRIDES — Trader Terminal
   Mono-first display, sharp edges, no drop-cap, ticker accents
   ========================================================== */

[data-skin="v2"] body {
  font-family: var(--font-sans);
  font-feature-settings: 'cv11', 'tnum', 'lnum';
}

/* V2 display = mono uppercase, no serif */
[data-skin="v2"] .logo-display {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  font-variation-settings: normal;
}
[data-skin="v2"] .display-xl,
[data-skin="v2"] .display-lg-vi,
[data-skin="v2"] .display-md,
[data-skin="v2"] .display-sm-vi {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-style: normal;
  font-variation-settings: normal;
}
[data-skin="v2"] .eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
}

/* V2 buttons = sharp + uppercase mono */
[data-skin="v2"] .btn-primary,
[data-skin="v2"] .btn-secondary {
  border-radius: 0;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
[data-skin="v2"] .btn-primary {
  border: 1px solid var(--accent);
  box-shadow: 2px 2px 0 var(--ink);
}
[data-skin="v2"] .btn-primary:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

/* V2 cards = no radius, hard hairline */
[data-skin="v2"] .card-modern {
  border-radius: 0;
  border-color: var(--line);
}
[data-skin="v2"] .card-modern:hover {
  border-color: var(--accent);
  transform: none;
  box-shadow: 0 0 0 1px var(--accent), 4px 4px 0 var(--accent);
}

/* V2 pills = sharp tag-style, mono */
[data-skin="v2"] .pill {
  border-radius: 0;
  font-family: var(--font-mono);
  background: var(--bg-2);
  border-color: var(--line);
  font-size: 10px;
}

/* V2 section bar = thicker rule + mono label */
[data-skin="v2"] .section-bar {
  border-bottom: 1px solid var(--ink);
}

/* V2 prose: drop the drop-cap, sans body, mono code chips */
[data-skin="v2"] .prose-fz p:first-of-type::first-letter {
  font-family: inherit;
  font-size: inherit;
  float: none;
  padding: 0;
  color: inherit;
  font-variation-settings: normal;
}
[data-skin="v2"] .prose-fz h2,
[data-skin="v2"] .prose-fz h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-variation-settings: normal;
}
[data-skin="v2"] .prose-fz blockquote {
  font-family: var(--font-sans);
  font-style: normal;
  border-left-width: 2px;
  background: var(--bg-2);
  padding: 12px 16px;
}
[data-skin="v2"] .prose-fz img,
[data-skin="v2"] .prose-fz figure img,
[data-skin="v2"] .prose-fz iframe,
[data-skin="v2"] .prose-fz pre,
[data-skin="v2"] .prose-fz code {
  border-radius: 0;
}

/* V2 reading progress = thicker glowy line */
[data-skin="v2"] .reading-progress {
  height: 3px;
  box-shadow: 0 0 8px var(--accent);
}

/* V2 hover row = grid-like */
[data-skin="v2"] .post-row:hover {
  background: var(--bg-2);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
