/* ============================================
   TECHSAVVY SOLUTIONS · DESIGN SYSTEM
   Refined Bold · Edition 2026
   ============================================ */

:root {
  /* YMChess Palette — indigo board, sunrise gold pieces, coral energy, sage focus */
  --ink: #1e2154;          /* royal indigo - chess board navy */
  --ink-95: #252a63;
  --ink-90: #2c3273;
  --ink-80: #3a4090;
  --bone: #f9f5ec;         /* cream paper */
  --bone-warm: #f3ecda;
  --bone-50: #fcf9f2;
  --flame: #f4b942;        /* sunrise gold - kept as --flame for variable compatibility */
  --flame-light: #f9d176;
  --flame-deep: #d99820;
  --electric: #ff6b5b;     /* coral energy - replaces electric blue */
  --electric-deep: #e54d3d;
  --crimson: #c0301c;
  --jade: #7ba88a;         /* sage focus */

  /* Type families */
  --display: 'Bricolage Grotesque', 'Anton', Impact, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --body: 'Geist', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', 'JetBrains Mono', monospace;

  /* Type scale — Major Third 1.250 */
  --t-xs: 0.64rem;
  --t-sm: 0.8rem;
  --t-base: 1rem;
  --t-md: 1.25rem;
  --t-lg: 1.563rem;
  --t-xl: 1.953rem;
  --t-2xl: 2.441rem;
  --t-3xl: 3.052rem;
  --t-4xl: 3.815rem;
  --t-5xl: 4.768rem;
  --t-6xl: 5.96rem;
  --t-7xl: 7.451rem;

  /* Spacing — 8pt base */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 3rem;
  --s-6: 4rem;
  --s-7: 6rem;
  --s-8: 8rem;
  --s-9: 12rem;

  /* Rules */
  --rule-dark: rgba(244, 240, 230, 0.12);
  --rule-light: rgba(30, 33, 84, 0.12);
  --rule-flame: rgba(244, 185, 66, 0.4);

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --max-w: 1480px;
  --gutter: 2rem;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--body);
  background: var(--ink);
  color: var(--bone);
  line-height: 1.5;
  font-size: var(--t-base);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  cursor: none;
  max-width: 100vw;
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; cursor: none; }
button { background: none; border: none; color: inherit; font: inherit; cursor: none; }
input, textarea, select, button { font-family: var(--body); cursor: none; }
::selection { background: var(--flame); color: var(--ink); }

/* Reset cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
  body, a, button, input, textarea, select { cursor: auto; }
  #custom-cursor, #custom-cursor-dot { display: none !important; }
}

/* ============================================
   GRAIN OVERLAY — atmospheric texture
   ============================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.45;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--flame);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out-back),
              height 0.3s var(--ease-out-back),
              background 0.3s var(--ease-out-expo),
              border-color 0.3s var(--ease-out-expo),
              opacity 0.2s ease;
  mix-blend-mode: difference;
}
#custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--flame);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease, transform 0.1s ease;
}
#custom-cursor.hover {
  width: 70px;
  height: 70px;
  background: rgba(244, 185, 66, 0.15);
  border-color: var(--flame);
}
#custom-cursor.text {
  width: 4px;
  height: 30px;
  border-radius: 1px;
  border-width: 0;
  background: var(--flame);
}
#custom-cursor.text + #custom-cursor-dot { opacity: 0; }

/* ============================================
   PAGE TRANSITION OVERLAY
   ============================================ */
#page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--ink);
  transform: translateY(0);
  pointer-events: none;
  display: grid;
  place-items: center;
  will-change: transform;
}
#page-transition.idle {
  /* After entering animation completes, parked off-screen below */
  transform: translateY(100%);
}
#page-transition.entering {
  /* Starts covering the screen, slides up and away to reveal */
  animation: pageEnter 0.55s var(--ease-out-expo) forwards;
}
#page-transition.exiting {
  /* Slides up from bottom to cover the screen before navigation */
  animation: pageExit 0.4s var(--ease-in-out-quart) forwards;
}
.transition-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-3xl);
  color: var(--flame);
  letter-spacing: -0.04em;
  opacity: 0.8;
}
@keyframes pageEnter {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100%); }
}
@keyframes pageExit {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

/* ============================================
   TOP RIBBON — kinetic marquee
   ============================================ */
.ribbon {
  background: var(--ink);
  color: var(--bone);
  padding: 0.75rem 0;
  overflow: hidden;
  border-bottom: 1px solid var(--rule-dark);
}
.ribbon-track {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  animation: ribbonScroll 50s linear infinite;
  width: max-content;
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-warm);
}
.ribbon-track span { display: flex; align-items: center; gap: 3rem; }
.ribbon-track span::after { content: '·'; color: var(--flame); font-size: 1.2rem; }
.ribbon-track .accent { color: var(--flame); }
@keyframes ribbonScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  background: rgba(30, 33, 84, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--rule-dark);
  z-index: 100;
  padding: 0.875rem var(--gutter);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 3rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  transition: opacity 0.2s;
}
.nav-brand:hover { opacity: 0.85; }
.nav-mark {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: transparent;
  border: none;
  border-radius: 0;
  transition: transform 0.5s var(--ease-out-back);
  display: block;
  flex-shrink: 0;
}
.nav-brand:hover .nav-mark { transform: rotate(-8deg) scale(1.06); }
.nav-wordmark { display: flex; flex-direction: column; line-height: 1; }
.nav-wordmark .primary {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--bone);
}
.nav-wordmark .secondary {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  color: var(--flame);
  margin-top: 0.25rem;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.nav-links a {
  position: relative;
  padding: 0.375rem 0;
  color: var(--bone-warm);
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--bone); }
.nav-links a::before {
  content: '';
  position: absolute;
  inset: auto 0 -2px 0;
  height: 1px;
  background: var(--flame);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out-expo);
}
.nav-links a:hover::before, .nav-links a.active::before {
  transform: scaleX(1);
  transform-origin: left;
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.25rem;
  background: var(--flame);
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--flame);
  border-radius: 100px;
  transition: all 0.3s var(--ease-out-expo);
}
.nav-cta::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--ink);
  border-radius: 50%;
}
.nav-cta:hover {
  background: var(--bone);
  border-color: var(--bone);
  transform: translateY(-1px);
}

/* Language toggle */
.nav-lang {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rule-dark);
  border-radius: 100px;
  padding: 0.25rem;
  margin-right: 0.75rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.nav-lang a {
  padding: 0.4rem 0.7rem;
  border-radius: 100px;
  color: var(--bone-warm);
  transition: all 0.25s var(--ease-out-expo);
  line-height: 1;
}
.nav-lang a.active {
  background: var(--flame);
  color: var(--ink);
  font-weight: 700;
}
.nav-lang a:not(.active):hover {
  color: var(--flame);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 0;
}
@media (max-width: 920px) {
  .nav-lang {
    margin-right: 0.5rem;
    padding: 0.125rem;
  }
  .nav-lang a { padding: 0.35rem 0.55rem; font-size: 0.5625rem; }
}
.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  position: relative;
}
.nav-burger span {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 1.5px;
  background: var(--bone);
  transition: transform 0.3s var(--ease-out-expo), opacity 0.2s;
}
.nav-burger span:nth-child(1) { top: 14px; }
.nav-burger span:nth-child(2) { top: 20px; }
.nav-burger span:nth-child(3) { top: 26px; }
.nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 920px) {
  .nav-inner { grid-template-columns: auto 1fr auto; }
  .nav-links {
    position: fixed;
    inset: 76px 0 0 0;
    background: var(--ink);
    flex-direction: column;
    justify-content: flex-start;
    padding: 3rem 2rem;
    gap: 2rem;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-in-out-quart);
    font-size: var(--t-md);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-burger { display: block; }
  .nav-cta { padding: 0.625rem 1rem; font-size: 0.75rem; }
  .nav-cta::after { display: none; }
}

/* ============================================
   SHARED BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.125rem 1.75rem;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  border-radius: 100px;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}
.btn-arrow {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--flame);
  transition: transform 0.4s var(--ease-out-expo);
}
.btn:hover .btn-arrow { transform: translateX(4px) rotate(-45deg); }
.btn-primary {
  background: var(--flame);
  color: var(--ink);
}
.btn-primary:hover {
  background: var(--bone);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -15px rgba(244, 185, 66, 0.4);
}
.btn-ghost {
  background: transparent;
  color: var(--bone);
  border-color: var(--rule-dark);
}
.btn-ghost:hover {
  border-color: var(--bone);
  transform: translateY(-2px);
}
.btn-ghost .btn-arrow { background: var(--bone); color: var(--ink); }
.btn-dark {
  background: var(--ink);
  color: var(--bone);
}
.btn-dark:hover {
  background: var(--ink-90);
  transform: translateY(-2px);
}
.btn-dark .btn-arrow { background: var(--flame); color: var(--ink); }

/* Light section variants */
.section-light .btn-ghost {
  color: var(--ink);
  border-color: var(--rule-light);
}
.section-light .btn-ghost:hover { border-color: var(--ink); }
.section-light .btn-ghost .btn-arrow { background: var(--ink); color: var(--flame); }

/* ============================================
   SECTION SHELLS
   ============================================ */
section {
  padding: var(--s-8) var(--gutter);
  position: relative;
}
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.section-light {
  background: var(--bone);
  color: var(--ink);
}
.section-dark {
  background: var(--ink);
  color: var(--bone);
}
.section-warm {
  background: var(--bone-warm);
  color: var(--ink);
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--flame);
  margin-bottom: 1.5rem;
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--flame);
}
.eyebrow.dark { color: var(--flame-deep); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.96;
}
h1 { font-size: clamp(3rem, 8vw, var(--t-7xl)); font-weight: 800; }
h2 { font-size: clamp(2.25rem, 5vw, var(--t-5xl)); }
h3 { font-size: var(--t-2xl); }
h4 { font-size: var(--t-lg); }
.serif-italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.accent { color: var(--flame); }
.accent-blue { color: var(--electric); }

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out-expo),
              transform 0.9s var(--ease-out-expo);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out-expo),
              transform 0.7s var(--ease-out-expo);
}
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 0.15s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 0.25s; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 0.35s; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 0.45s; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 0.55s; }
.reveal-stagger.in > * { opacity: 1; transform: translateY(0); }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--ink-95);
  color: var(--bone);
  padding: var(--s-7) var(--gutter) var(--s-4);
  border-top: 1px solid var(--rule-dark);
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; }
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 4rem;
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--rule-dark);
}
.footer-brand .nav-mark { width: 80px; height: 80px; margin-bottom: 1.5rem; }
.footer-brand p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--bone-warm);
  max-width: 360px;
  margin-bottom: 1.5rem;
}
.footer-cert-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-cert-row span {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  padding: 0.5rem 0.75rem;
  background: rgba(244, 185, 66, 0.12);
  border: 1px solid var(--flame);
  color: var(--flame);
  border-radius: 3px;
}
.footer-col h5 {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--flame);
  margin-bottom: 1.25rem;
  font-weight: 500;
}
.footer-col ul { list-style: none; }
.footer-col li {
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
  color: var(--bone-warm);
}
.footer-col a {
  color: var(--bone-warm);
  transition: color 0.2s;
  position: relative;
  display: inline-block;
}
.footer-col a:hover { color: var(--flame); }
.footer-col a::before {
  content: '→';
  position: absolute;
  left: -1.25rem;
  top: 50%;
  transform: translate(-4px, -50%);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s var(--ease-out-expo);
  color: var(--flame);
}
.footer-col a:hover::before {
  opacity: 1;
  transform: translate(0, -50%);
}
.footer-bottom {
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-warm);
  opacity: 0.7;
}

@media (max-width: 920px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}

/* ============================================
   RESPONSIVE BASE
   ============================================ */
@media (max-width: 920px) {
  section { padding: var(--s-6) var(--gutter); }
  :root { --gutter: 1.25rem; }
}

/* ============================================
   CHATBOT — see chatbot.css component
   ============================================ */
