/*
 * Design System — Components
 * Owner: Architect Agent
 * -----------------------------------------------
 * Shared component styles used across all pages.
 * All values reference tokens from tokens.css.
 *
 * Add components only via the Architect agent.
 */

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

/* ─── Base ───────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Navigation ─────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.625rem max(2rem, calc((100vw - 1200px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
}

.logo-img {
  height: 56px;
  width: auto;
}

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

nav a.nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  text-decoration: none;
  color: var(--color-text);
  transition: color 0.2s;
}

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

/* Active page indicator — 3px line flush with nav bottom edge */
nav .nav-links a.nav-link[aria-current="page"] {
  color: var(--color-primary);
  position: relative;
}

nav .nav-links a.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -1.25rem;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
}

/* Desktop text CTA */
nav a.cta-nav-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: #ffffff;
  background: var(--color-primary);
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

nav a.cta-nav-text:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 20px rgba(31, 58, 52, 0.2);
}

/* Mobile icon CTA — hidden on desktop */
nav a.cta-nav-icon {
  display: none;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #ffffff;
  background: var(--color-primary);
  width: 38px;
  height: 38px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

nav a.cta-nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

nav a.cta-nav-icon:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 20px rgba(31, 58, 52, 0.2);
}

/* Hamburger — hidden on desktop */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.hamburger svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-text);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Mobile menu overlay */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a.nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  text-decoration: none;
  color: var(--color-text);
  transition: color 0.2s;
}

.mobile-menu a.nav-link:hover {
  color: var(--color-highlight);
}

.mobile-menu a.cta-nav {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: #ffffff;
  background: var(--color-primary);
  padding: 0.75rem 2rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: 1rem;
}

/* ─── Section utilities ──────────────────────────── */
.section-inner {
  max-width: 960px;
  margin: 0 auto;
}

.section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-highlight);
  margin-bottom: 1.25rem;
}

/* ─── CTA button ─────────────────────────────────── */
.cta-btn {
  display: inline-block;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--color-primary);
  padding: 1.1rem 3rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.cta-btn:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 25px rgba(31, 58, 52, 0.25);
  transform: translateY(-2px);
}

/* ─── CTA section ────────────────────────────────── */
.cta-section {
  padding: 7rem 2rem;
  text-align: center;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.cta-section h2 {
  font-family: 'Source Serif 4', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  color: var(--color-text);
  max-width: 600px;
  margin: 0 auto 1.25rem;
  line-height: 1.2;
}

.cta-section p {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  color: var(--color-text-secondary);
  max-width: 500px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.cta-secondary-link {
  margin-top: 1.25rem !important;
  margin-bottom: 0 !important;
  font-size: 0.85rem !important;
}

.cta-secondary-link a {
  color: var(--color-text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cta-secondary-link a:hover {
  color: var(--color-primary);
}

.cta-note {
  margin-top: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* ─── Footer ─────────────────────────────────────── */
footer {
  padding: 2.5rem max(2rem, calc((100vw - 1200px) / 2));
  text-align: center;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
}

footer p {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--color-text);
}

/* ─── Animations ─────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Calculator widget ──────────────────────────── */
.calc-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-field label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.lbl-gem {
  font-size: 0.72em;
  opacity: 0.7;
}

.lbl-short { display: none; }

.input-wrap {
  position: relative;
}

.input-prefix {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  pointer-events: none;
}

.input-wrap input[type="number"] {
  width: 100%;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-6);
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -moz-appearance: textfield;
}

.input-wrap input[type="number"]::-webkit-outer-spin-button,
.input-wrap input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.input-wrap input[type="number"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 58, 52, 0.08);
}

.slider-block {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.slider-meta {
  flex-shrink: 0;
  min-width: 160px;
}

.slider-meta label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.slider-value-display {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  line-height: 1;
}

.slider-value-display span {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-normal);
  color: var(--color-text-secondary);
}

.slider-track-wrap {
  flex: 1;
}

.slider-block input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  outline: none;
  cursor: pointer;
}

.slider-block input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.slider-block input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(31, 58, 52, 0.12);
}

.slider-block input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.output-card {
  background: var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.output-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.output-hero-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.output-hero {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-accent-light);
  line-height: 1;
}

.output-hero-sub {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-normal);
  color: rgba(255, 255, 255, 0.3);
  line-height: 1;
}

.output-hero-sub .output-hero-amount {
  color: rgba(255, 255, 255, 0.65);
}

.output-desc {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.55);
  line-height: var(--line-height-snug);
}

@media (max-width: 640px) {
  .calc-inputs {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
  }

  .lbl-short { display: none; }

  .slider-block {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-5);
    gap: var(--space-4);
  }

  .slider-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }

  .slider-meta label {
    margin-bottom: 0;
  }

  .slider-track-wrap {
    width: 100%;
  }
}

/* ─── Responsive — navigation ────────────────────── */
@media (max-width: 768px) {
  nav {
    padding: 0 0 0 1.25rem; /* flush right and top/bottom — icon fills full height */
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
  }

  .hamburger {
    display: block;
    justify-self: start;
    align-self: center;
  }

  .logo-img {
    height: 44px;
  }

  nav .logo-link {
    justify-self: center;
    align-self: center;
  }

  nav .nav-links {
    display: none;
  }

  nav a.cta-nav-text {
    display: none;
  }

  nav a.cta-nav-icon {
    display: flex;
    width: 56px;
    height: auto;        /* fill full nav height */
    align-self: stretch;
    border-radius: 0;    /* flush — no rounded corners on edges */
    justify-self: end;
    margin: 0;
  }

  nav a.cta-nav-icon svg {
    width: 18px;
    height: 18px;
  }
}
