:root {
  color-scheme: light;
  --ink: #1c2136;
  --muted: #555c72;
  --indigo: #242443;
  --navy: #171a30;
  --purple: #4c3e86;
  --gold: #eac175;
  --paper: #f6f6fb;
  --line: #e3e4ee;
  --radius: 19px;
  --shadow: 0 14px 32px #2320420a;
  font-family: "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 288px; color: var(--ink); background: var(--paper); line-height: 1.6; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2 { letter-spacing: -0.048em; line-height: 1.04; }
h3 { line-height: 1.25; letter-spacing: -0.025em; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #8d62e6; outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 10; transform: translateY(-150%); padding: 10px 15px; background: #fff; }
.skip-link:focus { transform: translateY(0); }

.site-header { color: #fff; background: var(--navy); }
.navigation { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 6px; font-size: 1.125rem; font-weight: 720; letter-spacing: -0.035em; text-decoration: none; white-space: nowrap; }
.brand-accent { color: var(--gold); }
.brand-mark { display: inline-grid; place-items: center; flex: 0 0 35px; width: 35px; height: 35px; margin-right: 5px; border-radius: 10px; color: var(--gold); background: #eac17520; font-size: 1.5rem; line-height: 1; }
nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); }
nav a { font-size: .94rem; color: #deddf0; text-decoration: none; }
nav a:hover, .footer-content > a:last-child:hover { text-decoration: underline; }
.header-chat { padding: 8px 14px; color: #fff3d9; border: 1px solid #eac17555; background: #eac17511; border-radius: 9px; font-size: .88rem; font-weight: 650; white-space: nowrap; }
.header-chat span { color: var(--gold); margin-right: 4px; }
.header-chat:hover { background: #eac17526; }

.hero { display: grid; align-items: center; min-height: 438px; margin-top: 28px; border-radius: 24px; isolation: isolate; color: white; background: linear-gradient(90deg, #16182dfc 0%, #1a1c34eb 24%, #1a1c348c 48%, #181a3433 75%), #222544 url("./assets/ames-home.webp") center 53% / cover; overflow: hidden; scroll-margin-top: 16px; }
.hero-copy { width: min(570px, 100%); padding: 46px 0 49px 56px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--purple); font-size: .875rem; font-weight: 730; letter-spacing: .09em; text-transform: uppercase; }
.hero .eyebrow, .estimate-card .eyebrow { color: #f4cd89; }
.hero .eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.hero h1 { margin: 15px 0 17px; font-size: clamp(3.1rem, 6.3vw, 5.1rem); font-weight: 740; }
.hero-description { max-width: 455px; color: #eceaf6; font-size: clamp(1rem, 1.6vw, 1.15rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 25px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 1px solid transparent; border-radius: 9px; font-size: .94rem; font-weight: 730; text-decoration: none; text-align: center; }
.primary { background: var(--gold); color: #221c30; }
.primary:hover { background: #f4d293; }
.hero-secondary { border-color: #f9f7ff70; color: white; background: #fdfaff11; }
.hero-secondary:hover { background: #fdfaff26; }
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.metric-strip > div { padding: 19px 23px; }
.metric-strip > div + div { border-left: 1px solid var(--line); }
.metric-strip dt { color: var(--muted); font-size: .9rem; font-weight: 660; }
.metric-strip dd:not(.metric-note) { margin: 2px 0; font-size: clamp(1.6rem, 3vw, 2.15rem); line-height: 1.22; font-weight: 740; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.metric-note { color: var(--muted); font-size: .83rem; }

.notice { padding: 14px 18px; margin: 20px 0; border: 1px solid #e6ba87; border-radius: 10px; background: #fff1de; color: #5d3516; }
.section { margin-top: 56px; scroll-margin-top: 22px; }
.section-intro { display: grid; grid-template-columns: 1.15fr .85fr; align-items: end; gap: 23px; margin-bottom: 21px; }
.section-intro h2 { margin-top: 6px; font-size: clamp(2rem, 4vw, 3rem); }
.section-intro > p { color: var(--muted); max-width: 490px; }
.estimator-grid, .chart-grid, .method-grid { display: grid; gap: 16px; }
.estimator-grid { grid-template-columns: 1.18fr .82fr; }
.chart-grid { grid-template-columns: 1fr 1fr; }
.method-grid { grid-template-columns: repeat(3, 1fr); }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.form-panel, .chart-panel, .method-panel { padding: clamp(19px, 3vw, 28px); }
.panel h3 { font-size: 1.31rem; }
.panel-heading p, .chart-panel p, .method-panel p { color: var(--muted); margin-top: 5px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 17px 0 19px; }
.presets button, .suggestions button { padding: 6px 12px; color: var(--purple); background: #f7f5fc; border: 1px solid #e5ddf4; border-radius: 99px; font-size: .88rem; font-weight: 680; }
.presets button:hover, .suggestions button:hover { background: #ece5f7; }
.presets button[aria-pressed="true"] { color: #fff; background: var(--purple); border-color: var(--purple); }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 17px; }
.field-grid label { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 5px; font-weight: 650; }
.field-grid label span { font-size: .8rem; color: var(--muted); font-weight: 450; }
input { min-height: 42px; min-width: 0; padding: 6px 11px; border: 1px solid #cbcde0; border-radius: 8px; color: var(--ink); background: #fafaff; }
.field-grid input { grid-column: 1 / -1; width: 100%; font-variant-numeric: tabular-nums; }
.estimate-button { width: 100%; margin-top: 18px; background: var(--purple); color: white; }
.estimate-button:hover { background: #3b306f; }
.estimate-button:disabled { opacity: .55; }
.form-note { margin-top: 8px; color: var(--muted); text-align: center; font-size: .88rem; }
.estimate-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(22px, 4vw, 42px); color: white; background: radial-gradient(ellipse at 96% 0%, #554582, transparent 66%), var(--indigo); border-color: #373457; }
.card-mark { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 20px; color: #f4cd89; background: #eac17522; border: 1px solid #eac17545; border-radius: 13px; font-size: 1.9rem; line-height: 1; }
.estimate-card h3 { margin-top: 5px; color: #f0ecfa; }
.prediction { margin: 8px 0 20px; font-size: clamp(2.65rem, 5vw, 4.15rem); font-weight: 750; letter-spacing: -.075em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.range { display: grid; gap: 2px; padding: 12px 15px; border-radius: 11px; border: 1px solid #d4c4fc38; background: #f1e5ff13; }
.range span, .range-note, .estimate-caption { color: #e5dff3; font-size: .9rem; }
.range strong { color: #fff2d6; font-size: 1.12rem; }
.range-note { margin-top: 8px; }
.result-divider { height: 1px; margin: 18px 0 14px; background: #eee0ff38; }
.estimate-caption { display: flex; gap: 9px; }
.estimate-caption > span { color: #f4cd89; }

.table-wrap { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { background: #f4f1fb; color: #45366f; font-size: .88rem; }
th:not(:first-child), td { text-align: right; }
tbody th { font-weight: 650; }
tbody tr[data-highlight] { background: #f8f5fe; color: #3c2b68; }
tbody tr:last-child > * { border-bottom: 0; }
.importance { display: grid; gap: 8px; list-style: none; margin: 15px 0 0; padding: 0; }
.importance li { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(48px, 1.25fr) minmax(64px, .6fr); gap: 8px; align-items: center; font-size: .9rem; }
.importance strong, .trend strong { text-align: right; font-variant-numeric: tabular-nums; font-size: .88rem; }
meter { display: block; width: 100%; min-width: 0; height: 11px; border: none; background: #eceaf4; border-radius: 99px; overflow: hidden; }
meter::-webkit-meter-bar { background: #eceaf4; border: 0; height: 11px; }
meter::-webkit-meter-optimum-value { background: #7e64ba; border-radius: 99px; }
meter::-moz-meter-bar { background: #7e64ba; border-radius: 99px; }
.kaggle-panel, .trend-panel { margin-top: 16px; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tag { flex: 0 0 auto; padding: 4px 10px; border-radius: 99px; color: #4b3878; background: #ede7fa; font-size: .82rem; font-weight: 670; }
.chart-panel .table-note { margin-top: 14px; font-size: .88rem; }
.download-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.download-links a, .method-panel a, .text-button { color: var(--purple); text-decoration: underline; text-underline-offset: 3px; font-size: .92rem; font-weight: 650; }
.trend { display: grid; gap: 8px; margin-top: 18px; }
.trend-row { display: grid; grid-template-columns: 48px 1fr 82px 66px; align-items: center; gap: 12px; }
.trend-row > span:last-child { text-align: right; color: var(--muted); font-size: .84rem; }
.method-panel p { margin: 9px 0 13px; }
.text-button { text-align: left; border: 0; padding: 0; background: transparent; }

footer { margin-top: 54px; background: var(--navy); color: white; }
.footer-content { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; padding-block: 23px; }
.footer-content p, .footer-content > a:last-child { font-size: .9rem; color: #e7e2f4; }
.footer-content > a:last-child { text-decoration: none; }
dialog { position: fixed; inset: auto max(12px, calc((100% - 1160px) / 2)) 19px auto; margin: 0; width: min(420px, calc(100% - 24px)); max-height: calc(100dvh - 38px); padding: 0; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 24px 90px #18152f55; color: var(--ink); }
dialog::backdrop { background: #18152f55; }
.chat-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 15px 17px; color: white; background: var(--indigo); }
.chat-header h2 { font-size: 1.37rem; }
.chat-header h2 span { color: var(--gold); }
.chat-header p { color: #e8e2f3; font-size: .88rem; }
#close-chat { padding: 0 8px; border: 0; border-radius: 7px; background: #ffffff17; color: white; font-size: 1.5rem; line-height: 1.35; }
.chat-body { padding: 12px; }
.messages { max-height: min(280px, 43dvh); overflow: auto; display: grid; gap: 8px; padding: 3px; }
.message { max-width: 92%; overflow-wrap: anywhere; border-radius: 11px; padding: 8px 10px; font-size: .94rem; }
.answer { background: #efebf8; }
.question { margin-left: auto; color: #31274e; background: #f7e4be; }
.suggestions { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0; }
#chat-form { display: grid; grid-template-columns: 1fr auto; gap: 6px; }

@media (max-width: 820px) {
  .wrap { width: calc(100% - 36px); }
  .hero { min-height: 390px; }
  .hero-copy { padding-left: 32px; }
  .metric-strip > div { padding: 15px; }
  .estimator-grid, .chart-grid { grid-template-columns: 1fr; }
  .estimate-card { min-height: 350px; }
  .method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 590px) {
  .wrap { width: calc(100% - 28px); }
  .navigation { flex-wrap: wrap; gap: 0 7px; padding: 10px 0 8px; }
  .brand { font-size: 1rem; gap: 4px; }
  .brand-mark { width: 31px; height: 31px; flex-basis: 31px; }
  nav { order: 3; width: 100%; padding-top: 8px; }
  .header-chat { padding: 6px 8px; }
  .hero { margin-top: 16px; border-radius: 18px; min-height: 384px; background-position: 62% 52%; }
  .hero-copy { padding: 23px 17px; }
  .hero h1 { font-size: clamp(2.65rem, 10vw, 3.6rem); }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-strip > div:nth-of-type(n+3) { border-top: 1px solid var(--line); }
  .metric-strip > div:nth-of-type(3) { border-left: 0; }
  .section { margin-top: 37px; }
  .section-intro { grid-template-columns: 1fr; gap: 9px; }
  .field-grid { gap: 11px 9px; }
  .field-grid label { grid-template-columns: 1fr; }
  .field-grid label span { line-height: 1; }
  .field-grid input { align-self: end; }
  .method-grid { grid-template-columns: 1fr; }
  .trend-row { grid-template-columns: 41px 1fr 69px 54px; gap: 6px; }
  .footer-content { align-items: start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
