/* ==========================================================================
   Deoyin PX — shared site stylesheet
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #090c10;
  --bg2: #0e1218;
  --bg3: #141920;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);
  --gold: #c9a84c;
  --gold-hover: #d6b75e;
  --gold-glow: rgba(201,168,76,0.08);
  --gold-line: rgba(201,168,76,0.3);
  --text: #e8eaf0;
  --text-muted: #6b7280;
  --text-mid: #9ca3af;
  --success: #4ade80;
  --error: #f87171;
  --on-gold: #090c10;
  --header-bg: rgba(9,12,16,0.92);
  --grid-line: rgba(201,168,76,0.015);
  --backdrop: rgba(5,7,10,0.85);
  --mono: 'Space Mono', monospace;
  --display: 'Urbanist', sans-serif;
  color-scheme: dark;

  /* Aliases so existing inline styles keep working */
  --text-2: var(--text-mid);
  --accent: var(--gold);
}

/* Light theme: follows the system unless the visitor picked dark with the toggle */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f5ef;
    --bg2: #ffffff;
    --bg3: #fbf8ef;
    --border: rgba(20,24,32,0.10);
    --border-strong: rgba(20,24,32,0.18);
    --gold: #8a6d1a;
    --gold-hover: #6f5712;
    --gold-glow: rgba(176,138,40,0.07);
    --gold-line: rgba(138,109,26,0.35);
    --text: #14181f;
    --text-muted: #6b6f78;
    --text-mid: #474c56;
    --success: #15803d;
    --error: #b91c1c;
    --on-gold: #ffffff;
    --header-bg: rgba(247,245,239,0.9);
    --grid-line: rgba(138,109,26,0.05);
    --backdrop: rgba(20,24,32,0.45);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #f7f5ef;
  --bg2: #ffffff;
  --bg3: #fbf8ef;
  --border: rgba(20,24,32,0.10);
  --border-strong: rgba(20,24,32,0.18);
  --gold: #8a6d1a;
  --gold-hover: #6f5712;
  --gold-glow: rgba(176,138,40,0.07);
  --gold-line: rgba(138,109,26,0.35);
  --text: #14181f;
  --text-muted: #6b6f78;
  --text-mid: #474c56;
  --success: #15803d;
  --error: #b91c1c;
  --on-gold: #ffffff;
  --header-bg: rgba(247,245,239,0.9);
  --grid-line: rgba(138,109,26,0.05);
  --backdrop: rgba(20,24,32,0.45);
  color-scheme: light;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.25s ease, color 0.25s ease;
  font-family: var(--display);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--gold-hover); }

strong { color: var(--text); font-weight: 600; }

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
}

.nav {
  max-width: calc(1080px + 4rem);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.nav-left { display: flex; align-items: center; gap: 12px; }
.nav-left img { display: block; width: 34px; height: 34px; flex-shrink: 0; }

.logo-text { display: flex; flex-direction: column; }

.logo-text-main {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.3;
}

.logo-text-sub {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.nav-center { display: flex; align-items: center; gap: 0.25rem; }

.nav-link {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  padding: 6px 10px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover { color: var(--text); }

.nav-link.nav-active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.nav-right { display: flex; align-items: center; gap: 0.75rem; }

.nav-chip {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 11px 20px;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--on-gold);
}

.btn-primary:hover {
  background: var(--gold-hover);
  border-color: var(--gold-hover);
  color: var(--on-gold);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--gold-line);
  color: var(--gold);
}

.nav-right .btn { padding: 8px 14px !important; }

/* --------------------------------------------------------------------------
   Home hero
   -------------------------------------------------------------------------- */

.hero {
  max-width: calc(1080px + 4rem);
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 3rem;
  align-items: center;
}

.hero-logo { display: flex; align-items: center; gap: 16px; margin-bottom: 2.5rem; }
.hero-logo img { display: block; width: 64px; height: 64px; flex-shrink: 0; }
.hero-logo-name { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--gold); letter-spacing: 0.18em; line-height: 1.2; }
.hero-logo-sub { font-family: var(--mono); font-size: 10px; color: var(--text-muted); letter-spacing: 0.16em; text-transform: uppercase; margin-top: 4px; }

.hero-eyebrow,
.page-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-eyebrow::before,
.page-eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(2.4rem, 4.6vw, 4rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero-highlight { color: var(--gold); }

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-mid);
  max-width: 540px;
  line-height: 1.75;
  font-weight: 300;
  letter-spacing: 0.01em;
}

.hero-cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-right-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}

.hero-right-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.hero-right-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.metric-label { font-size: 0.85rem; color: var(--text-mid); font-weight: 300; }

.metric-value {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.01em;
  text-align: right;
}

.sample-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mid);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 2px;
  margin: 0 4px 6px 0;
  transition: all 0.2s ease;
}

.sample-pill:hover { border-color: var(--gold-line); color: var(--gold); }

/* --------------------------------------------------------------------------
   Sections & page headers
   -------------------------------------------------------------------------- */

.section { padding: 3rem 2rem; }

.section-inner { max-width: 1080px; margin: 0 auto; }

.hero-simple { padding-top: 5rem; padding-bottom: 1rem; }
main > .section:first-child { padding-top: 5rem; }

.page-title {
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.4vw, 3.75rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.25rem;
  max-width: 900px;
}

.page-subtitle {
  font-size: 1.05rem;
  color: var(--text-mid);
  max-width: 640px;
  line-height: 1.75;
  font-weight: 300;
  letter-spacing: 0.01em;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.section-sub {
  font-size: 0.95rem;
  color: var(--text-mid);
  max-width: 640px;
  line-height: 1.7;
  font-weight: 300;
}

.section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.section-inner.two-col { margin-top: 0; }
.section-inner .two-col { margin-top: 2.5rem; }

ul, ol {
  padding-left: 1.1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-mid);
  font-weight: 300;
}

li { margin-bottom: 0.6rem; line-height: 1.65; }
li::marker { color: var(--gold); }

ol li::marker { font-family: var(--mono); font-size: 0.8em; }

/* --------------------------------------------------------------------------
   Cards & grids
   -------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  padding: 1px;
  margin-top: 2rem;
}

.card,
.consult-card,
.post-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease;
}

.grid > .card,
.grid > .post-card {
  border: none;
  border-radius: 0;
  box-shadow: 0 0 0 1px var(--border);
}

.card::before,
.post-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold-glow);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.card:hover,
.post-card:hover { background: var(--bg3); }

.card:hover::before,
.post-card:hover::before { opacity: 1; }

.card h3,
.consult-card h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.card p,
.post-card p {
  font-size: 0.87rem;
  color: var(--text-mid);
  line-height: 1.65;
  font-weight: 300;
}

.card ul { margin-top: 0.75rem; }

/* Numbered index on grid cards (01, 02 …) */
.grid { counter-reset: card; }
.grid > .card { counter-increment: card; }
.grid > .card::after {
  content: counter(card, decimal-leading-zero);
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  transition: color 0.2s ease;
}
.grid > .card:hover::after { color: var(--gold); }
.grid > .card h3 { padding-right: 2rem; }

.tag-list,
.post-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 1.2rem;
}

.tag,
.post-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 7px;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.card:hover .tag,
.post-card:hover .post-tag { border-color: var(--gold-line); color: var(--gold); }

/* --------------------------------------------------------------------------
   Insights
   -------------------------------------------------------------------------- */

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2rem; }

.chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mid);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.chip:hover { border-color: var(--gold-line); color: var(--gold); }

.post-card { display: flex; flex-direction: column; gap: 0.6rem; }

.post-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.post-title {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.post-tag-row { margin-top: auto; padding-top: 0.6rem; }

/* --------------------------------------------------------------------------
   Consultation form
   -------------------------------------------------------------------------- */

.info-block { font-size: 0.87rem; color: var(--text-mid); margin-top: 1rem; font-weight: 300; }

.inline-label { font-family: var(--mono); font-size: 0.82rem; color: var(--gold); }

.consult-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

#consultForm { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.5rem; }

label,
#consultForm label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.6rem;
}

textarea,
input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  font-size: 0.9rem;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea::placeholder,
input::placeholder { color: var(--text-muted); }

textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

#consultForm .btn { margin-top: 1rem !important; align-self: flex-start; }

#form-status { min-height: 18px; font-family: var(--mono); font-size: 11px; margin-top: 0.4rem; }

.h-captcha { margin-top: 0.75rem; }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-backdrop.active { display: flex; }

.modal-content {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 1px solid var(--gold);
  border-radius: 4px;
  padding: 1.75rem;
  max-width: 440px;
  width: calc(100% - 2rem);
}

.modal-title {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}

.modal-body { font-size: 0.9rem; color: var(--text-mid); font-weight: 300; margin-bottom: 1.5rem; }

.modal-footer { display: flex; justify-content: flex-end; gap: 0.6rem; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Thank-you page
   -------------------------------------------------------------------------- */

.thank-card {
  max-width: 640px;
  margin: 6rem auto;
  padding: 2.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.thank-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.thank-title {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.thank-body { font-size: 1rem; color: var(--text-mid); line-height: 1.75; font-weight: 300; }

.thank-meta { font-size: 0.87rem; color: var(--text-muted); line-height: 1.7; margin-top: 1rem; font-weight: 300; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: calc(1080px + 4rem);
  margin: 0 auto;
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}

.footer-inner span[style] { font-size: 10px !important; letter-spacing: 0.08em; text-transform: uppercase; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1440px) {
  .nav-chip { display: none; }
}

@media (max-width: 960px) {
  .nav { flex-wrap: wrap; justify-content: space-between; padding: 0.85rem 1.25rem; }
  .nav-center { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; margin: 0 -10px; }
  .nav-chip { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .hero { padding: 3.5rem 1rem 3rem; gap: 2rem; }
  .section { padding: 2.5rem 1rem; }
  .hero-simple, main > .section:first-child { padding-top: 3.5rem; }
  .grid { grid-template-columns: 1fr; }
  .footer-inner { padding: 1.5rem 1rem; }
  .thank-card { margin: 3rem 1rem; padding: 1.75rem; }
  .logo-text-sub { display: none; }
  .nav { gap: 0.75rem; padding: 0.75rem 1rem; }
  .nav-left { gap: 8px; }
  .nav-right { gap: 0.5rem; }
  .nav-right .btn { padding: 8px 10px !important; letter-spacing: 0.06em; }
}

/* --------------------------------------------------------------------------
   Theme toggle
   -------------------------------------------------------------------------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--text-mid);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover { border-color: var(--gold-line); color: var(--gold); }
.theme-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.theme-toggle svg { width: 16px; height: 16px; }

/* Show the moon in light mode (click to go dark), the sun in dark mode */
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: block; }
}

:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
