/** * ============================================================================= * QWHPI — Quebec Weekly Housing Price Index * Author : Simon-Pierre Boucher * Contact : contact@spboucher.ai * File : web/styles/globals.css * Purpose : Global styles — validated palette tokens (light + dark), * editorial layout, refined cards, hero, chart chrome. * ============================================================================= */ :root { color-scheme: light; --surface-0: #f6f5f1; --surface-1: #fcfcfb; --surface-2: #f0efec; --border: #e3e2db; --border-strong: #d2d1c8; --text-primary: #0b0b0b; --text-secondary: #52514e; --text-muted: #716f66; --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --band: rgba(42, 120, 214, 0.14); --accent-soft: rgba(42, 120, 214, 0.08); --good: #008300; --serious: #e34948; --shadow-card: 0 1px 2px rgba(20, 20, 15, 0.04), 0 4px 16px rgba(20, 20, 15, 0.05); --shadow-card-hover: 0 2px 4px rgba(20, 20, 15, 0.06), 0 10px 28px rgba(20, 20, 15, 0.09); } :root[data-theme="dark"] { color-scheme: dark; --surface-0: #131312; --surface-1: #1a1a19; --surface-2: #262624; --border: #33332f; --border-strong: #45453f; --text-primary: #ffffff; --text-secondary: #c3c2b7; --text-muted: #98968d; --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --band: rgba(57, 135, 229, 0.22); --accent-soft: rgba(57, 135, 229, 0.12); --good: #37a437; --serious: #e66767; --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25); --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.35); } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; --surface-0: #131312; --surface-1: #1a1a19; --surface-2: #262624; --border: #33332f; --border-strong: #45453f; --text-primary: #ffffff; --text-secondary: #c3c2b7; --text-muted: #98968d; --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --band: rgba(57, 135, 229, 0.22); --accent-soft: rgba(57, 135, 229, 0.12); --good: #37a437; --serious: #e66767; --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25); --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.35); } } * { box-sizing: border-box; } html { scroll-behavior: smooth; } body { margin: 0; background: radial-gradient(1200px 400px at 50% -200px, var(--accent-soft), transparent), var(--surface-0); color: var(--text-primary); font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif); line-height: 1.55; font-feature-settings: "tnum"; } a { color: var(--series-1); text-decoration: none; } a:hover { text-decoration: underline; } .container { max-width: 1160px; margin: 0 auto; padding: 0 24px 24px; } /* ------------------------------------------------------------------ header */ .site-header { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 24px; background: color-mix(in srgb, var(--surface-1) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); } .brand { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-display, serif); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; color: var(--text-primary); } .brand:hover { text-decoration: none; } .brand small { font-family: var(--font-sans); color: var(--text-muted); font-weight: 400; font-size: 12.5px; } .site-header nav { display: flex; gap: 4px; flex-wrap: wrap; } .site-header nav a { color: var(--text-secondary); font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 999px; transition: background 0.15s, color 0.15s; } .site-header nav a:hover { color: var(--text-primary); background: var(--surface-2); text-decoration: none; } .site-footer { border-top: 1px solid var(--border); color: var(--text-muted); font-size: 13px; padding: 28px 24px 36px; text-align: center; margin-top: 56px; } /* -------------------------------------------------------------------- hero */ .hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 40px 0 8px; } .hero h1 { font-family: var(--font-display, serif); font-size: clamp(28px, 4vw, 42px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; line-height: 1.15; } .hero .lede { margin: 0; } .hero-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--series-1); margin-bottom: 12px; } .hero-kicker::before { content: ""; width: 22px; height: 2px; background: var(--series-1); border-radius: 2px; } /* ------------------------------------------------------------------- cards */ .card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow-card); transition: box-shadow 0.2s, transform 0.2s; } .card.hoverable:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-1px); } .card-title { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-secondary); margin: 0 0 10px; } .stat-tile { display: flex; flex-direction: column; gap: 3px; } .stat-tile .label { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); } .stat-tile .value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; font-family: var(--font-display, serif); line-height: 1.15; } .stat-tile .value.money { font-variant-numeric: tabular-nums; } .stat-tile .delta { font-size: 13px; color: var(--text-secondary); } .delta.up { color: var(--good); font-weight: 600; } .delta.down { color: var(--serious); font-weight: 600; } .grid { display: grid; gap: 16px; } .grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); } .grid.cols-5 { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); } .grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); } /* ---------------------------------------------------------------- controls */ .controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0; } .controls label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); } select, button.ctrl, input[type="date"] { background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 13px; font-size: 14px; font-family: inherit; box-shadow: 0 1px 2px rgba(20, 20, 15, 0.03); } button.ctrl { cursor: pointer; transition: background 0.15s, border-color 0.15s; } button.ctrl:hover { background: var(--surface-2); } button.ctrl[aria-pressed="true"] { border-color: var(--series-1); color: var(--series-1); background: var(--accent-soft); } a.ctrl { background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 13px; font-size: 14px; } a.ctrl:hover { background: var(--surface-2); text-decoration: none; } .seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(20, 20, 15, 0.03); } .seg button { border: none; background: var(--surface-1); color: var(--text-secondary); padding: 8px 14px; font-size: 13.5px; font-weight: 500; cursor: pointer; font-family: inherit; } .seg button + button { border-left: 1px solid var(--border); } .seg button[aria-pressed="true"] { background: var(--series-1); color: #fff; font-weight: 600; } /* ------------------------------------------------------------------ badges */ .badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); color: var(--text-secondary); background: var(--surface-1); } .badge .dot { width: 8px; height: 8px; border-radius: 50%; } .chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-1); color: var(--text-primary); padding: 6px 13px; font-size: 13.5px; cursor: pointer; transition: border-color 0.15s, background 0.15s; font-family: inherit; } .chip:hover { border-color: var(--serious); background: var(--surface-2); } /* ------------------------------------------------------------------ tables */ table.data { width: 100%; border-collapse: collapse; font-size: 14px; } table.data th, table.data td { text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; } table.data th:first-child, table.data td:first-child { text-align: left; } table.data th { color: var(--text-muted); font-weight: 600; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; } table.data tr:last-child td { border-bottom: none; } table.data tbody tr { transition: background 0.12s; } table.data tbody tr:hover { background: var(--surface-2); } /* ---------------------------------------------------------------- headings */ h1 { font-family: var(--font-display, serif); font-size: 30px; letter-spacing: -0.02em; margin: 30px 0 6px; } h2 { font-family: var(--font-display, serif); font-size: 21px; letter-spacing: -0.01em; margin: 34px 0 12px; } p.lede { color: var(--text-secondary); margin-top: 0; font-size: 15.5px; } .note { font-size: 13px; color: var(--text-muted); } .low-reliability-note { font-size: 13px; color: var(--text-secondary); background: var(--surface-2); border-radius: 10px; padding: 10px 14px; border-left: 3px solid var(--series-4); margin: 10px 0; } /* ------------------------------------------------------------ chart pieces */ .chart-tooltip { background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 13px; font-size: 13px; box-shadow: var(--shadow-card-hover); } .chart-tooltip .tt-label { color: var(--text-muted); font-size: 12px; } .chart-tooltip .tt-value { font-weight: 700; font-size: 15px; } .chart-tooltip .tt-ci { color: var(--text-muted); font-weight: 400; font-size: 12.5px; } .chart-tooltip .tt-raw { color: var(--text-secondary); } .chart-tooltip .tt-n { color: var(--text-muted); font-size: 12px; } code { background: var(--surface-2); border-radius: 6px; padding: 1px 6px; font-size: 0.9em; } /* ------------------------------------------------------------- v3: pulse */ button.primary, a.primary { background: var(--series-1); color: #fff; border: none; border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 2px 8px rgba(42, 120, 214, 0.3); transition: transform 0.15s, box-shadow 0.15s; } button.primary:hover, a.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(42, 120, 214, 0.4); text-decoration: none; } table.pulse { width: 100%; border-collapse: collapse; font-size: 13.5px; } table.pulse th, table.pulse td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; } table.pulse th:first-child, table.pulse td:first-child { text-align: left; } table.pulse th { color: var(--text-muted); font-weight: 600; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; background: var(--surface-1); } table.pulse tbody tr { cursor: pointer; transition: background 0.12s; } table.pulse tbody tr:hover { background: var(--surface-2); } td.heat { font-weight: 600; border-radius: 4px; } .record-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--good); } .mini-tile { padding: 12px 14px; } .mini-tile .label { font-size: 10.5px; } .mini-tile .value { font-size: 20px; } .grid.cols-8 { grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); } /* ---------------------------------------------------------- v4 foundations */ body, .card, .site-header, .site-footer, select, button.ctrl, a.ctrl, input, .seg button, .badge, .chip, table.pulse th { transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.2s ease; } @keyframes qhpi-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } } .fade-up { animation: qhpi-fade-up 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both; } .fade-up.d1 { animation-delay: 0.06s; } .fade-up.d2 { animation-delay: 0.12s; } .fade-up.d3 { animation-delay: 0.18s; } @keyframes qhpi-shimmer { 0% { background-position: 180% 0; } 100% { background-position: -20% 0; } } .skeleton { border-radius: 10px; background: linear-gradient(100deg, var(--surface-2) 40%, color-mix(in srgb, var(--border) 65%, var(--surface-2)) 50%, var(--surface-2) 60%); background-size: 200% 100%; animation: qhpi-shimmer 1.4s linear infinite; } @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } } .brand-mark { flex: none; display: inline-flex; align-self: center; } :focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; border-radius: 4px; } @media (max-width: 680px) { .container { padding: 0 14px 20px; } .site-header { padding: 10px 14px; gap: 8px; } .site-header nav a { padding: 5px 9px; font-size: 13px; } .hero { padding: 22px 0 4px; } .stat-tile .value { font-size: 25px; } .card { padding: 14px; border-radius: 13px; } .controls { gap: 8px; margin: 12px 0; } table.pulse { font-size: 12.5px; } table.pulse th, table.pulse td { padding: 6px 7px; } h1 { font-size: 25px; } h2 { font-size: 18px; } } /* -------------------------------------------------------------- v5: hot */ /* Subtle film grain over the whole app */ body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0.35; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E"); } main, header, footer { position: relative; z-index: 2; } /* Ticker tape */ .ticker-shell { overflow: hidden; white-space: nowrap; border-bottom: 1px solid var(--border); background: var(--surface-1); margin: 0 -24px; padding: 7px 0; min-height: 36px; } .ticker-track { display: inline-flex; } .ticker-group { display: inline-flex; align-items: center; animation: ticker-scroll 55s linear infinite; } .ticker-shell:hover .ticker-group { animation-play-state: paused; } @keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } } .ticker-item { display: inline-flex; align-items: baseline; gap: 7px; padding: 0 18px; font-size: 12.5px; color: var(--text-primary); border-right: 1px solid var(--border); } .ticker-item:hover { text-decoration: none; background: var(--surface-2); } .ticker-name { color: var(--text-secondary); font-weight: 600; } .ticker-val { font-variant-numeric: tabular-nums; font-weight: 700; } .ticker-item .delta { font-size: 11.5px; } /* Mega hero number */ .hero-mega { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; } .hero-mega .big { font-family: var(--font-display, serif); font-size: clamp(52px, 7vw, 84px); font-weight: 700; line-height: 1; letter-spacing: -0.03em; background: linear-gradient(160deg, var(--text-primary) 55%, var(--series-1)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; } .hero-mega .sub { font-size: 13.5px; color: var(--text-secondary); } /* Hero chart draw-in */ .hero-chart { padding: 14px 14px 6px; overflow: hidden; } .hero-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: hero-draw 1.6s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards; } .hero-area, .hero-band { opacity: 0; animation: hero-fade 0.8s ease 1.25s forwards; } .hero-dot { opacity: 0; animation: hero-fade 0.5s ease 1.6s forwards; } .hero-pulse { opacity: 0; transform-origin: center; transform-box: fill-box; animation: hero-fade 0.5s ease 1.6s forwards, hero-ping 2.4s ease-out 2.1s infinite; } @keyframes hero-draw { to { stroke-dashoffset: 0; } } @keyframes hero-fade { to { opacity: 1; } } @keyframes hero-ping { 0% { transform: scale(0.6); opacity: 0.45; } 70% { transform: scale(1.7); opacity: 0; } 100% { opacity: 0; } } /* Podium */ .podium { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); } .podium .card { position: relative; overflow: hidden; } .podium .card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; } .podium .p1::after { background: linear-gradient(90deg, #eda100, #ffd977); } .podium .p2::after { background: linear-gradient(90deg, #9a9a94, #d8d8d2); } .podium .p3::after { background: linear-gradient(90deg, #b0713d, #dda67a); } .podium .medal { font-size: 20px; } /* Command palette */ .palette-backdrop { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--surface-0) 55%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 0; animation: qhpi-fade-up 0.18s ease both; } .palette { width: 100%; max-width: 560px; background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-card-hover); overflow: hidden; } .palette-input { width: 100%; border: none; outline: none; background: transparent; color: var(--text-primary); padding: 16px 18px; font-size: 16px; font-family: inherit; border-bottom: 1px solid var(--border); } .palette-list { list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow-y: auto; } .palette-item { width: 100%; display: flex; justify-content: space-between; gap: 10px; border: none; background: none; text-align: left; cursor: pointer; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: var(--text-primary); font-family: inherit; } .palette-item.active { background: var(--accent-soft); color: var(--series-1); } .palette-hint { color: var(--text-muted); font-size: 12px; } .palette-empty { padding: 14px; color: var(--text-muted); font-size: 13.5px; } .palette-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 11.5px; } .kbd-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-1); color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: 10px; padding: 6px 11px; font-size: 13px; cursor: pointer; font-family: inherit; } .kbd-btn:hover { background: var(--surface-2); } .kbd-btn kbd { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; font-size: 11px; font-family: inherit; color: var(--text-muted); } @media (max-width: 680px) { .ticker-shell { margin: 0 -14px; } .hero-mega { align-items: flex-start; } } /* -------------------------------------------------- v5.1: mobile polish */ @media (max-width: 680px) { /* Compact header: brand + toggle on one row, nav scrolls on its own row */ .brand small { display: none; } .kbd-btn { display: none; } .site-header { row-gap: 6px; } .site-header nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; } .site-header nav::-webkit-scrollbar { display: none; } .site-header nav a { flex: none; } /* Hero: number below the title, full width */ .hero { flex-direction: column; align-items: stretch; gap: 12px; } .hero-mega { align-items: flex-start; } /* Pulse table: drop secondary columns (1m, 6m, vs peak, $ value) — the full set remains in Explore's data table and the CSV/PDF exports */ table.pulse th:nth-child(4), table.pulse td:nth-child(4), table.pulse th:nth-child(6), table.pulse td:nth-child(6), table.pulse th:nth-child(9), table.pulse td:nth-child(9), table.pulse th:nth-child(11), table.pulse td:nth-child(11) { display: none; } .controls input[type="text"] { flex: 1 1 160px; min-width: 0; } .controls input[type="range"] { flex: 1 1 110px; min-width: 0; } .ticker-item { padding: 0 12px; } .hero-chart { padding: 10px 8px 4px; } .primary, a.primary { padding: 8px 13px; font-size: 13.5px; } .palette-backdrop { padding: 8vh 10px 0; } } @media (max-width: 400px) { .stat-tile .value { font-size: 22px; } .mini-tile .value { font-size: 17px; } h2 { font-size: 17px; } }