/* studentstay.sg
   Light, restrained, statistical. Two rules held throughout:

   1. Colour carries meaning or it is not used. Category dots and warnings get
      hue; prices, headings and body text stay near-black. The previous version
      coloured everything orange, so nothing stood out.
   2. One dark element only — the radar panel — so it reads as an instrument
      inset into a document rather than a dashboard.

   Neutral is cool grey, deliberately not the warm cream used elsewhere in the
   portfolio and nowhere near exchangestay.sg's teal. */

:root {
  --bg: #f1f3f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --line: #dfe3e8;
  --line-soft: #ebeef1;

  --ink: #14161a;
  --soft: #5b626d;
  --dim: #8a919c;

  /* Muted, print-like. Category identity, not decoration. */
  --hdb: #8a5a2b;
  --hdb-tint: #f5efe8;
  --condo: #3d5a80;
  --condo-tint: #eaeff5;

  --danger: #a8261d;
  --danger-tint: #fbeeec;
  --go: #2c6a4c;
  --go-tint: #ecf4ef;

  --radius: 8px;
  --font-sans: "Public Sans", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  --font-data: "Archivo", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-size: 18px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 18px 96px; }
.wrap--narrow { max-width: 840px; }
a { color: inherit; }
.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; }

h1 { font-size: 38px; line-height: 1.08; letter-spacing: -0.025em; margin: 8px 0 0; }
h2 { font-size: 23px; line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
h3 { font-size: 17px; margin: 0; }
@media (max-width: 560px) { h1 { font-size: 29px; } h2 { font-size: 20px; } }

.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 30px 0 8px; }
.eyebrow { font-family: var(--font-data); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin: 0; }
.lede { font-size: 17px; line-height: 1.6; color: var(--soft); margin: 10px 0 0; max-width: 64ch; }
.lede--lead { font-size: 21px; line-height: 1.55; color: var(--ink); margin: 16px 0 30px; }

.lang {
  display: inline-flex; align-items: center; gap: 9px; flex-shrink: 0;
  background: var(--ink); color: #fff; font-size: 20px; font-weight: 700;
  line-height: 1; padding: 14px 22px; border-radius: var(--radius); text-decoration: none;
}
.lang:hover { background: #2c3038; }
.lang--quiet { background: var(--surface); color: var(--soft); border: 1px solid var(--line); font-size: 15px; padding: 10px 16px; }
.lang--quiet:hover { color: var(--ink); border-color: var(--dim); }

/* The date travels with the numbers, never only in the footer. */
.window {
  display: inline-flex; align-items: center; gap: 9px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 15px; margin-top: 14px;
  font-family: var(--font-data); font-size: 13px; color: var(--soft);
}
.window i { width: 7px; height: 7px; border-radius: 50%; background: var(--go); }

.stats { display: flex; flex-wrap: wrap; gap: 10px 34px; margin: 18px 0 0; }
.stats dt { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); }
.stats dd { margin: 3px 0 0; font-family: var(--font-data); font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.card + .card { margin-top: 18px; }
section { scroll-margin-top: 80px; }

/* ---------- campus picker ---------- */

.campus-grid { display: grid; gap: 12px; margin-top: 20px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .campus-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .campus-grid { grid-template-columns: repeat(3, 1fr); } }

.campus {
  display: block; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.campus:hover { border-color: var(--ink); box-shadow: 0 2px 10px rgba(20,22,26,.07); transform: translateY(-1px); }
.campus__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.campus__code { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; }
.campus__go { font-family: var(--font-data); font-size: 19px; color: var(--dim); }
.campus:hover .campus__go { color: var(--ink); }
.campus__name { font-size: 13px; color: var(--dim); margin: 3px 0 0; }
.campus__meta { display: flex; gap: 22px; margin: 15px 0 0; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.campus__meta span { font-family: var(--font-data); font-size: 12px; color: var(--dim); }
.campus__meta b { display: block; font-size: 17px; color: var(--ink); font-weight: 700; }

/* ---------- block cards ---------- */

.grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin-top: 18px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1240px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.block { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.block:hover { border-color: var(--dim); }
.block__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-data); font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--hdb); }
.chip i { width: 7px; height: 7px; border-radius: 2px; background: var(--hdb); }
.chip--condo { color: var(--condo); }
.chip--condo i { background: var(--condo); }
.block__unit { font-family: var(--font-data); font-size: 12px; color: var(--dim); }
.block__name { font-size: 16px; font-weight: 600; line-height: 1.3; margin: 12px 0 0; }
.block__name a { text-decoration: none; }
.block__name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.block__town { font-size: 13px; color: var(--dim); margin: 2px 0 0; }

.rent { display: flex; align-items: baseline; gap: 7px; margin-top: 14px; }
.rent b { font-family: var(--font-data); font-size: 31px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rent span { font-size: 13px; color: var(--dim); }

/* Delta against the town median for the same flat type. This is what makes one
   card differ from the next when forty Clementi 3-rooms all sit near $2,800. */
.delta { display: inline-block; font-family: var(--font-data); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 4px; margin-top: 10px; }
.delta--under { background: var(--go-tint); color: var(--go); }
.delta--over { background: var(--danger-tint); color: var(--danger); }
.delta--mid { background: var(--surface-2); color: var(--soft); }

.range { font-family: var(--font-data); font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; margin: 10px 0 0; }
.range em { font-style: normal; color: var(--dim); }

.rail { height: 3px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 14px; }
.rail i { display: block; height: 100%; border-radius: 999px; background: var(--hdb); }
.rail--condo i { background: var(--condo); }
.rail-label { font-family: var(--font-data); font-size: 13px; color: var(--soft); margin: 7px 0 0; font-variant-numeric: tabular-nums; }
.block__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 14px; }
.block__foot span { font-family: var(--font-data); font-size: 11px; color: var(--dim); }
.block__foot a { font-family: var(--font-data); font-size: 13px; font-weight: 700; text-decoration: none; }
.block__foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- filters ---------- */

.filters {
  position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center;
  gap: 9px; margin: 0 -18px; padding: 13px 18px; background: rgba(241,243,245,.94);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(10px);
}
.seg { display: flex; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 3px; }
.seg button { flex: 1; border: 0; background: none; cursor: pointer; font-family: var(--font-data); font-size: 14px; font-weight: 600; color: var(--soft); padding: 8px 15px; border-radius: 5px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
select { font-family: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; }
select:hover { border-color: var(--dim); }
.count { margin-left: auto; font-family: var(--font-data); font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; }

/* ---------- collapsible ---------- */

details.fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
details.fold + details.fold { margin-top: 10px; }
details.fold > summary { cursor: pointer; list-style: none; padding: 18px 22px; font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; font-family: var(--font-data); font-size: 22px; color: var(--dim); line-height: 1; }
details.fold[open] > summary::after { content: "–"; }
details.fold > div { padding: 0 22px 22px; }

/* ---------- calculator ---------- */

.fields { display: grid; gap: 18px; margin-top: 22px; }
@media (min-width: 640px) { .fields { grid-template-columns: repeat(2, 1fr); } .fields .full { grid-column: 1 / -1; } }
.fields label > span { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.money { display: flex; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; }
.money span { padding-left: 13px; font-family: var(--font-data); font-size: 16px; color: var(--dim); }
.money input { width: 100%; border: 0; background: none; font-family: var(--font-data); font-size: 19px; font-variant-numeric: tabular-nums; padding: 11px; outline: none; color: inherit; }
.money:focus-within { border-color: var(--ink); }

.results { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; margin-top: 22px; }
@media (min-width: 640px) { .results { grid-template-columns: repeat(2, 1fr); } }
.result { background: var(--ink); padding: 22px; }
.result p:first-child { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.result b { display: block; font-family: var(--font-data); font-size: 42px; font-weight: 700; line-height: 1; color: #fff; margin-top: 10px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.result p:last-child { margin: 10px 0 0; font-family: var(--font-data); font-size: 13px; color: rgba(255,255,255,.55); font-variant-numeric: tabular-nums; }

.lines { margin: 10px 0 0; }
.lines .row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.lines dt { font-size: 16px; color: var(--soft); }
.lines dd { margin: 0; font-family: var(--font-data); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

.notice { border-radius: 6px; padding: 13px 16px; font-size: 16px; line-height: 1.6; margin: 18px 0 0; }
.notice--warn { background: var(--danger-tint); color: var(--danger); }
.notice--info { background: var(--hdb-tint); color: var(--hdb); }
.notice--ok { background: var(--go-tint); color: var(--go); }
[hidden] { display: none !important; }

/* ---------- red flags ---------- */

.flags { border-color: var(--danger); border-width: 1px; }
.flags h2 { color: var(--danger); }
.flag { display: flex; gap: 15px; padding: 17px 0; border-top: 1px solid var(--line-soft); }
.flag:first-of-type { border-top: 0; }
.flag__mark { flex-shrink: 0; width: 30px; height: 30px; border-radius: 6px; background: var(--danger-tint); color: var(--danger); display: flex; align-items: center; justify-content: center; font-family: var(--font-data); font-size: 17px; font-weight: 700; }
.flag__rule { font-size: 18px; font-weight: 700; color: var(--ink); margin: 2px 0 0; letter-spacing: -0.01em; }
.flag__why { margin: 5px 0 0; font-size: 16px; line-height: 1.6; color: var(--soft); }

/* ---------- radar: the one dark panel ---------- */

.radar { margin-top: 18px; border-radius: var(--radius); background: #10141c; overflow: hidden; }
.radar svg { display: block; width: 100%; height: auto; }
.sweep { transform-origin: 50% 50%; animation: sweep 7s linear infinite; }
@keyframes sweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.ping { animation: ping 3.4s ease-out infinite; }
@keyframes ping { 0%,72%,100% { opacity: .4; } 36% { opacity: .85; } }
.radar-key { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 13px 18px; border-top: 1px solid rgba(255,255,255,.08); font-family: var(--font-data); font-size: 12px; color: rgba(255,255,255,.55); }

@media (prefers-reduced-motion: reduce) { .sweep, .ping { animation: none; } * { transition: none !important; } }

/* ---------- market ---------- */

.market-list { display: grid; gap: 12px; margin-top: 18px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .market-list { grid-template-columns: repeat(3, 1fr); } }
.mrow { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 19px; }
.mrow p { margin: 0; font-family: var(--font-data); font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--dim); }
.mrow b { display: block; font-family: var(--font-data); font-size: 29px; font-weight: 700; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.mrow .sub { display: block; margin-top: 7px; font-family: var(--font-data); font-size: 13px; color: var(--soft); text-transform: none; letter-spacing: 0; }
.up { color: var(--danger); font-weight: 700; }
.down { color: var(--go); font-weight: 700; }

/* ---------- misc ---------- */

ul.rules { list-style: none; margin: 18px 0 0; padding: 0; }
ul.rules li { position: relative; padding: 0 0 0 22px; margin-top: 15px; font-size: 17px; line-height: 1.6; color: var(--soft); }
ul.rules li:first-child { margin-top: 0; }
ul.rules li b { color: var(--ink); font-weight: 700; }
ul.rules li::before { content: ""; position: absolute; left: 0; top: 11px; width: 7px; height: 7px; border-radius: 2px; background: var(--dim); }

.btn { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 12px 18px; font-size: 15px; font-weight: 600; text-decoration: none; margin: 18px 9px 0 0; }
.btn:hover { border-color: var(--ink); }
.btn--danger { border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger-tint); }

.split { display: grid; gap: 12px; margin-top: 16px; }
@media (min-width: 640px) { .split { grid-template-columns: repeat(2, 1fr); } }
.split > div { border: 1px solid var(--line); border-radius: 7px; padding: 16px 18px; background: var(--surface-2); }
.split h3 { font-family: var(--font-data); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.split p { margin: 8px 0 0; font-size: 16px; line-height: 1.6; color: var(--soft); }

.facts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 26px 0 0; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts > div { background: var(--surface); padding: 15px 17px; }
.facts dt { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); }
.facts dd { margin: 4px 0 0; font-family: var(--font-data); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }

.faq dt { font-size: 17px; font-weight: 600; margin-top: 22px; }
.faq dd { margin: 6px 0 0; font-size: 16px; line-height: 1.65; color: var(--soft); }

.foot { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 24px; font-size: 14px; line-height: 1.7; color: var(--dim); }
.foot a { color: var(--ink); }
.crumb { font-family: var(--font-data); font-size: 14px; color: var(--soft); text-decoration: none; }
.crumb:hover { color: var(--ink); }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 56px 24px; text-align: center; margin-top: 40px; background: var(--surface); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[lang^="zh"] { line-height: 1.8; }
