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

:root {
  --paper: #f5f0e8;
  --navy: #1a2a3a;
  --emerald: #059669;
  --emerald-hover: #047857;
  --amber: #d97706;
  --text: #1a2a3a;
  --text-light: #6b7280;
  --border: #e5e2dc;
  --white: #ffffff;
  --radius: 8px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
  background: var(--navy);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}

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

.nav-link--signin {
  color: var(--white);
  font-weight: 600;
  background: var(--emerald);
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.nav-link--signin:hover {
  background: var(--emerald-hover) !important;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 1px;
}

/* Hero */
.hero {
  padding: 80px 24px 60px;
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.hero-title {
  font-size: 3.25rem;
  line-height: 1.1;
  color: var(--navy);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--text-light);
  line-height: 1.7;
  max-width: 420px;
}

/* Calculator Card */
.calculator-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.calc-row {
  margin-bottom: 24px;
}

.calc-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.calc-value {
  font-weight: 700;
  color: var(--navy);
  font-size: 1rem;
}

/* Custom Slider */
.slider-wrap {
  position: relative;
}

.calc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #d4d0c8;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.calc-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--emerald);
  border: 2px solid var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  margin-top: -7px;
  transition: transform 0.1s;
}

.calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.calc-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #d4d0c8;
}

.calc-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--emerald);
  border: 2px solid var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

/* Fill effect via JS will handle the track fill */

/* Result */
.calc-result {
  background: var(--paper);
  border-left: 4px solid var(--amber);
  padding: 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

.result-number {
  font-size: 4.5rem;
  line-height: 1;
  color: var(--navy);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.result-unit {
  font-size: 2rem;
  color: var(--amber);
  font-weight: 700;
}

.result-label {
  font-size: 1rem;
  color: var(--text-light);
  margin-left: 4px;
  align-self: flex-end;
  padding-bottom: 4px;
}

.result-label--impossible {
  font-size: 1rem;
  color: #dc2626;
  margin-left: 4px;
  align-self: flex-end;
  padding-bottom: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  text-decoration: none;
}

.btn--premium {
  background: var(--emerald);
  color: var(--white);
}

.btn--premium:hover {
  background: var(--emerald-hover);
}

.btn--add {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--border);
}

.btn--add:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

.btn--outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}

.btn--outline:hover {
  background: var(--navy);
  color: var(--white);
}

/* Tools Section */
.tools {
  padding: 0 24px 80px;
}

.tools-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.15s;
}

.tool-card:hover {
  border-color: var(--emerald);
}

.tool-icon {
  margin-bottom: 12px;
  line-height: 1;
}

.tool-icon img {
  display: block;
}

.tool-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--navy);
}

.tool-desc {
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 16px;
}

.tool-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--emerald);
  text-decoration: none;
}

.tool-link:hover {
  color: var(--emerald-hover);
}

/* FAQ Section */
.faq {
  padding: 0 24px 64px;
}

.faq-inner {
  max-width: 720px;
  margin: 0 auto;
}

.faq-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 32px;
  text-align: center;
  letter-spacing: -0.02em;
}

.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.faq-item h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.faq-item p {
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-light);
}

.footer-tag {
  font-size: 0.8125rem;
  color: var(--text-light);
  font-style: italic;
}

/* Responsive */
@media (max-width: 800px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .tools-inner {
    grid-template-columns: 1fr;
  }

  .nav {
    display: none;
  }

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

  .nav--open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 16px 24px;
    gap: 12px;
  }

  .result-number {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 48px 16px 40px;
  }

  .calculator-card {
    padding: 20px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .result-number {
    font-size: 2.5rem;
  }
}
