/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #2c2c2c;
    background-color: #f9f7f3;
    background-image: radial-gradient(circle at 20% 30%, rgba(180, 160, 130, 0.08) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

img,
svg {
    max-width: 100%;
    display: block;
}

a {
    color: #5a4a32;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus-visible {
    color: #3a2e1e;
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* ===== SKIP LINK ===== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: #2c2c2c;
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 1000;
    font-weight: 600;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* ===== HEADER ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e6e0d5;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: #3a2e1e;
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
    color: #5a4a32;
}

.logo svg {
    color: #8b7355;
}

.site-nav ul {
    display: flex;
    gap: 1.25rem;
}

.site-nav a {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.site-nav a.active,
.site-nav a:hover {
    border-bottom-color: #8b7355;
    text-decoration: none;
}

/* ===== HERO ===== */
.hero {
    padding: 3rem 0 1.5rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #2c2416;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #5c5347;
    max-width: 540px;
    margin: 0 auto;
}

/* ===== CALCULATOR ===== */
.calculator-section {
    padding: 1.5rem 0 2.5rem;
}

.calculator-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: #2c2416;
}

.calculator-card {
    background: #fff;
    border: 1px solid #e6e0d5;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: repeating-linear-gradient(90deg, #8b7355 0px, #8b7355 8px, #c4b393 8px, #c4b393 16px);
    border-radius: 12px 12px 0 0;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #3a2e1e;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 0.8rem 3.5rem 0.8rem 1rem;
    font-size: 1.1rem;
    border: 2px solid #d9d0c0;
    border-radius: 8px;
    background: #fdfbf7;
    color: #2c2c2c;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    -moz-appearance: textfield;
}

.input-wrapper input::-webkit-inner-spin-button,
.input-wrapper input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #8b7355;
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.15);
}

.input-wrapper .unit {
    position: absolute;
    right: 1rem;
    font-weight: 600;
    color: #8b7355;
    font-size: 0.9rem;
    pointer-events: none;
}

.hint {
    font-size: 0.8rem;
    color: #7a7062;
    margin-top: 0.35rem;
    line-height: 1.4;
}

.btn-primary {
    display: inline-block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    background: #5a4a32;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    letter-spacing: 0.01em;
    margin-top: 0.5rem;
    font-family: inherit;
}

.btn-primary:hover {
    background: #3a2e1e;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:focus-visible {
    outline: 3px solid #8b7355;
    outline-offset: 2px;
}

/* ===== RESULTS ===== */
.results-panel {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f4efe6;
    border-radius: 10px;
    border: 1px solid #e0d7c5;
    animation: fadeIn 0.3s ease;
}

.results-panel h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2c2416;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.6rem 0;
    border-bottom: 1px dashed #d9d0c0;
}

.result-row:last-of-type {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: #5c5347;
}

.result-value {
    font-weight: 700;
    font-size: 1.3rem;
    color: #2c2416;
}

.result-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #7a7062;
    line-height: 1.5;
}

.error-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #fdecea;
    color: #a13e3e;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid #f5c6c6;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== INFO SECTIONS ===== */
.info-section {
    padding: 2.5rem 0;
    background: #fff;
    border-top: 1px solid #e6e0d5;
    border-bottom: 1px solid #e6e0d5;
}

.info-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    color: #2c2416;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 600px) {
    .info-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.info-card {
    background: #fdfbf7;
    border: 1px solid #e6e0d5;
    border-radius: 10px;
    padding: 1.5rem;
}

.info-icon {
    color: #8b7355;
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #3a2e1e;
}

.info-card p {
    font-size: 0.95rem;
    color: #5c5347;
    line-height: 1.6;
}

/* ===== TIPS ===== */
.tips-section {
    padding: 2.5rem 0 3rem;
}

.tips-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #2c2416;
}

.tips-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid #e6e0d5;
    font-size: 0.95rem;
    color: #3a2e1e;
    line-height: 1.6;
    padding-left: 1.5rem;
    position: relative;
}

.tips-list li::before {
    content: '•';
    position: absolute;
    left: 0.2rem;
    color: #8b7355;
    font-weight: 700;
    font-size: 1.2rem;
}

.tips-list li:last-child {
    border-bottom: none;
}

.tips-list strong {
    color: #2c2416;
}

/* ===== FOOTER ===== */
.site-footer {
    margin-top: auto;
    background: #2c2416;
    color: #d9d0c0;
    padding: 2rem 0;
    text-align: center;
    font-size: 0.85rem;
}

.footer-disclaimer {
    margin-bottom: 1rem;
    line-height: 1.5;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-nav a {
    color: #c4b393;
    font-weight: 500;
}

.footer-nav a:hover {
    color: #fff;
}

.copyright {
    color: #8b7355;
    font-size: 0.8rem;
}

/* ===== ABOUT PAGE ===== */
.about-page {
    padding: 3rem 0;
}

.about-page h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #2c2416;
    margin-bottom: 1.5rem;
}

.about-content {
    max-width: 680px;
    font-size: 1rem;
    color: #3a2e1e;
    line-height: 1.7;
}

.about-content p {
    margin-bottom: 1rem;
}

/* ===== LEGAL PAGES ===== */
.legal-page {
    padding: 3rem 0;
    max-width: 680px;
    margin: 0 auto;
}

.legal-page h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #2c2416;
    margin-bottom: 1.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.7rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .calculator-card {
        padding: 1.25rem;
    }
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .site-nav ul {
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .hero {
        padding: 4rem 0 2rem;
    }
    .hero h1 {
        font-size: 2.6rem;
    }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
