/* Property Scout — reset, typography, browser surfaces and shared control states.
   Values come from tokens.css only. See DESIGN.md. */

/* ---- typefaces: self-hosted, no network dependency ---------------------- */
/* IBM Plex Sans carries the interface. Greek is real content: several sources
   publish Greek copy, so the Greek subset is declared, not left to fallback. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-greek-400-normal.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1,
    U+03A3-03FF, U+1F00-1FFF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-greek-500-normal.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1,
    U+03A3-03FF, U+1F00-1FFF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-greek-600-normal.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1,
    U+03A3-03FF, U+1F00-1FFF;
}

/* IBM Plex Mono is used only where a figure is a measurement: prices, areas,
   asking rates, scores, source references, timestamps. Never as decoration. */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
}

/* ---- reset -------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line-strong) var(--canvas);
}

body {
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

input,
button,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* ---- typography --------------------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: var(--w-semibold);
  text-wrap: balance;
}

h1 { font-size: var(--t-xl); line-height: var(--lh-xl); letter-spacing: var(--track-tight); }
h2 { font-size: var(--t-lg); line-height: var(--lh-lg); }
h3 { font-size: var(--t-md); line-height: var(--lh-md); }
h4 { font-size: var(--t-body); line-height: var(--lh-body); }

p { text-wrap: pretty; max-width: var(--measure); }

/* Space above a heading is always larger than the space below it. */
* + h2 { margin-top: var(--s6); }
* + h3 { margin-top: var(--s5); }
* + h4 { margin-top: var(--s4); }
h2 + *, h3 + *, h4 + * { margin-top: var(--s2); }

small { font-size: var(--t-meta); line-height: var(--lh-meta); }

a {
  color: var(--ink);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

/* Every figure that is a measurement lines up in columns. */
.num,
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---- browser surfaces --------------------------------------------------- */
::selection {
  background: var(--selection);
  color: var(--ink);
}

::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

:focus:not(:focus-visible) { outline: none; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--canvas);
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ---- controls: one shape across the whole surface ----------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  min-height: 36px;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  font-weight: var(--w-medium);
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.btn:hover { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn:active { background: var(--chrome); }
.btn[aria-pressed="true"],
.btn.is-selected {
  background: var(--accent-quiet);
  border-color: var(--accent);
  color: var(--ink);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-3);
  cursor: not-allowed;
}
.btn.is-loading { color: transparent; position: relative; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink-2);
  border-radius: var(--r-pill);
  animation: spin var(--dur-slow) linear infinite;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: var(--w-semibold);
}
.btn-primary:hover { background: var(--accent); border-color: var(--ink); color: var(--accent-ink); }
.btn-primary:active { background: var(--accent); filter: brightness(0.92); }
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-3);
}

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
}
.btn-quiet:hover { background: var(--surface-raised); border-color: var(--line); color: var(--ink); }

/* ---- fields ------------------------------------------------------------- */
.field { display: grid; gap: var(--s1); }

.field > label {
  font-size: var(--t-meta);
  line-height: var(--lh-meta);
  font-weight: var(--w-medium);
  color: var(--ink-2);
}

input[type="text"],
input[type="search"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: var(--s2) var(--s3);
  min-height: 36px;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: var(--t-body); /* 16px floor: anything smaller makes iOS zoom on focus */
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
input[type="number"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) { border-color: var(--line-strong); }
input:focus,
select:focus,
textarea:focus { border-color: var(--accent); }
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface);
  color: var(--ink-3);
  cursor: not-allowed;
}
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] { border-color: var(--risk); }

select {
  appearance: none;
  padding-right: var(--s6);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right var(--s4) center, right var(--s3) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

textarea { min-height: 88px; resize: vertical; line-height: var(--lh-body); }

/* ---- shared states ------------------------------------------------------ */
.skeleton {
  background: var(--surface-raised);
  border-radius: var(--r-sm);
  animation: pulse 1.2s var(--ease) infinite;
}

.empty {
  display: grid;
  gap: var(--s3);
  justify-items: start;
  padding: var(--s7) var(--s5);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  color: var(--ink-2);
}
.empty p { color: var(--ink-2); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.45; } }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
