/* ==========================================================================
   INDOHILL — Sovereign Luxury & Intelligence design system
   Custom component layer on top of Tailwind (Play CDN utilities).
   ========================================================================== */

:root {
  --obsidian: #0A0E17;
  --charcoal: #111827;
  --gold: #D4AF37;
  --champagne: #E6C687;
  --sapphire: #1E3A8A;
  --cyan: #0EA5E9;
  --platinum: #F8FAFC;
  --muted: #94A3B8;
}

/* ---- Base ---------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  /* Tells the browser to render native form controls (incl. the <select> option
     popup, which ignores our custom background) using a dark palette instead of
     defaulting to a white/light popup that would swallow our light text. */
  color-scheme: dark;
}

body {
  background-color: var(--obsidian);
  color: var(--platinum);
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-display-serif {
  font-family: "Playfair Display", serif;
  letter-spacing: -0.01em;
}

.font-brand {
  font-family: "Cinzel", serif;
  letter-spacing: 0.12em;
}

::selection {
  background: rgba(212, 175, 55, 0.35);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--obsidian); }
::-webkit-scrollbar-thumb { background: #2a3340; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* Focus visibility (keep accessible, styled to match brand) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Background textures ------------------------------------------- */
.bg-sovereign-grid {
  background-image:
    linear-gradient(rgba(212,175,55,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,55,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.bg-dot-map {
  background-image: radial-gradient(rgba(148,163,184,0.35) 1px, transparent 1.5px);
  background-size: 18px 18px;
}

.bg-noise {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* ---- Glass / card system -------------------------------------------- */
.glass {
  background: rgba(17, 24, 39, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-card {
  background: linear-gradient(180deg, rgba(17,24,39,0.75), rgba(10,14,23,0.75));
  border: 1px solid rgba(212, 175, 55, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.glass-card:hover {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 40px -12px rgba(212, 175, 55, 0.35);
  transform: translateY(-3px);
}

.gold-line {
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  height: 1px;
}

.text-gradient-gold {
  background: linear-gradient(90deg, #E6C687, #D4AF37 45%, #F5E9C2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Buttons ---------------------------------------------------------- */
.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(90deg, var(--champagne), var(--gold));
  color: #0A0E17;
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  border-radius: 2px;
  transition: box-shadow 0.3s ease, transform 0.3s ease, filter 0.3s ease;
  letter-spacing: 0.02em;
}
.btn-gold:hover {
  box-shadow: 0 0 30px -4px rgba(212, 175, 55, 0.55);
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid rgba(248, 250, 252, 0.25);
  color: var(--platinum);
  padding: 0.85rem 1.75rem;
  border-radius: 2px;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.btn-ghost:hover {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

/* ---- Nav ---------------------------------------------------------- */
#site-nav {
  transition: background-color 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent;
}
#site-nav.scrolled {
  background-color: rgba(10, 14, 23, 0.85);
  border-bottom-color: rgba(212, 175, 55, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-link {
  position: relative;
  color: var(--muted);
  transition: color 0.25s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.25s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--platinum);
}
.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* ---- Marquee ticker ------------------------------------------------- */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---- Scroll reveal ---------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1), transform 0.9s cubic-bezier(0.16,1,0.3,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ---- Pillar cards flip -------------------------------------------------- */
.pillar-card {
  perspective: 1600px;
  height: 100%;
}
.pillar-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  transition: transform 0.7s cubic-bezier(0.16,1,0.3,1);
  transform-style: preserve-3d;
}
.pillar-card.is-flipped .pillar-card-inner {
  transform: rotateY(180deg);
}
.pillar-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 4px;
}
.pillar-face-back {
  transform: rotateY(180deg);
}

/* ---- Forms ---------------------------------------------------------- */
.field-input {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--platinum);
  padding: 0.85rem 1rem;
  border-radius: 2px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  width: 100%;
}
.field-input::placeholder { color: rgba(148,163,184,0.55); }
/* Belt-and-suspenders for the native <option> popup: some browsers don't fully
   honor color-scheme on <html>, so force a solid dark background + light text
   directly on the options (their background can't be transparent like the closed
   select box, since the popup isn't part of our page's stacking context). */
select.field-input option {
  background-color: var(--charcoal);
  color: var(--platinum);
}
.field-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.12);
  outline: none;
}
/* Validation state — applied by contact.html's form JS when a required field is
   left empty/unselected on "Continue" or "Submit". Removed automatically the
   moment the field becomes valid. */
.field-input.field-invalid {
  border-color: rgba(248, 113, 113, 0.7);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}
.cf-radio-card.field-invalid > div {
  border-color: rgba(248, 113, 113, 0.7);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}
label.field-invalid input[type="checkbox"] {
  outline: 2px solid rgba(248, 113, 113, 0.7);
  outline-offset: 3px;
  border-radius: 3px;
}
.field-error-msg {
  color: #f87171;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}
.field-label {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  display: block;
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: rgba(148,163,184,0.25);
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(212,175,55,0.6);
  cursor: pointer;
  margin-top: -6.5px;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(212,175,55,0.6);
  cursor: pointer;
}
input[type="range"]::-moz-range-track {
  height: 3px;
  background: rgba(148,163,184,0.25);
  border-radius: 2px;
}

/* ---- Tables ---------------------------------------------------------- */
.data-table th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148,163,184,0.15);
  white-space: nowrap;
}
.data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(148,163,184,0.08);
  vertical-align: middle;
}
.data-table tr:hover td {
  background: rgba(212,175,55,0.04);
}

/* ---- Badges ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.badge-gold { background: rgba(212,175,55,0.14); color: var(--champagne); border: 1px solid rgba(212,175,55,0.3); }
.badge-sapphire { background: rgba(30,58,138,0.25); color: #93b4ff; border: 1px solid rgba(59,95,203,0.4); }
.badge-cyan { background: rgba(14,165,233,0.12); color: #7dd3fc; border: 1px solid rgba(14,165,233,0.3); }

/* ---- Step diagram (methodology) ---------------------------------------- */
.step-connector {
  background: repeating-linear-gradient(90deg, rgba(212,175,55,0.5) 0 8px, transparent 8px 16px);
  height: 1px;
}

/* ---- Utilities ---------------------------------------------------------- */
.mask-fade-x {
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Mobile menu */
#mobile-menu {
  transition: max-height 0.4s cubic-bezier(0.16,1,0.3,1), opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}
#mobile-menu.open {
  max-height: 640px;
  opacity: 1;
}

/* Counter animation helper */
.count-up { font-variant-numeric: tabular-nums; }

/* ---- Product window chrome (frames a live tool as an "app window") ---- */
.window-chrome {
  border-radius: 2px 2px 0 0;
  overflow: hidden;
}
.window-chrome-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  background: rgba(10, 14, 23, 0.5);
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}
.window-chrome-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.window-chrome-dot:nth-child(1) { opacity: 0.35; }
.window-chrome-dot:nth-child(2) { opacity: 0.6; }
.window-chrome-dot:nth-child(3) { opacity: 0.9; }
.window-chrome-label {
  margin-left: 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-family: 'Plus Jakarta Sans', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cookie notice */
#cookie-notice {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  transform: translateY(110%);
  transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
#cookie-notice.visible {
  transform: translateY(0);
}
