/* hajavi.com - restrained service selector. */

:root {
  --bg: #f8f9f8;
  --text: #1c201f;
  --text-strong: #060807;
  --muted: #6a716e;
  --rule: rgba(28, 32, 31, 0.12);
  --accent: #315f5a;
  --accent-hover: #1f756e;
  --focus: #315f5a;
  --selection: #dbe7e2;
  --row-hover: rgba(49, 95, 90, 0.06);

  --measure: 56rem;
  --gutter: clamp(1rem, 4vw, 2rem);

  --font-body: Georgia, "Times New Roman", Times, serif;
  --font-ui: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111312;
  --text: #e9ebe9;
  --text-strong: #f8f9f8;
  --muted: #9aa39f;
  --rule: rgba(233, 235, 233, 0.14);
  --accent: #9fd8ce;
  --accent-hover: #c4eee6;
  --focus: #9fd8ce;
  --selection: #203c38;
  --row-hover: rgba(159, 216, 206, 0.08);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--selection);
  color: var(--text-strong);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  color: var(--text-strong);
  border: 1px solid var(--rule);
  border-radius: 0.35rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 120ms ease;
}

.skip-link:focus {
  top: 0.75rem;
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

main:focus {
  outline: none;
}

.site-frame {
  width: 100%;
  max-width: var(--measure);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 3rem;
}

@media (min-width: 48rem) {
  .site-frame {
    padding-top: 3.5rem;
  }
}

@media (min-width: 72rem) {
  .site-frame {
    padding-top: 5rem;
  }
}

.site-header {
  margin-bottom: 2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.site-header__top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.9rem 1.5rem;
  flex-wrap: wrap;
}

.site-title {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-ui);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  margin: -0.08rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 120ms ease, transform 120ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--text-strong);
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle__icon {
  display: block;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:root[data-theme="dark"] .theme-toggle {
  color: var(--accent);
}

.theme-toggle[hidden] {
  display: none;
}

.content {
  min-width: 0;
}

.prose {
  max-width: 40rem;
}

.selector-page {
  max-width: none;
}

.prose p,
.prose ol,
.prose dl {
  margin: 0 0 1.15rem;
}

.prose p + p {
  margin-top: -0.15rem;
}

.prose h2,
.prose h3 {
  color: var(--text-strong);
  font-family: var(--font-ui);
  font-size: 0.98rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.prose h2 {
  margin: 0 0 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
}

.prose h3 {
  margin: 2.1rem 0 0.7rem;
  font-weight: 650;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

a:hover,
a:focus-visible {
  color: var(--accent-hover);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.selector-group {
  margin-top: 2.1rem;
}

.selector-group:first-of-type {
  margin-top: 0;
}

.selector-group__title {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.service-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-height: 7.25rem;
  padding: 1rem;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
  text-align: center;
}

.service-tile:hover,
.service-tile:focus-visible {
  background: var(--row-hover);
  color: var(--text-strong);
  text-decoration: none;
}

.service-tile__name {
  display: block;
  width: 100%;
  color: var(--text-strong);
  font-family: var(--font-ui);
  font-size: 1.08rem;
  font-weight: 720;
  line-height: 1.18;
  text-align: center;
  overflow-wrap: anywhere;
}

.service-tile.is-primary .service-tile__name {
  color: var(--accent);
}

@media (max-width: 46rem) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 32rem) {
  .site-header__top {
    align-items: flex-start;
    flex-direction: column;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }
}

.site-footer {
  margin-top: 4rem;
  padding-top: 1rem;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
}

.page-404 .prose {
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.error-code {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  :root {
    --bg: #fff;
    --text: #000;
    --text-strong: #000;
    --muted: #444;
    --accent: #000;
    --rule: #ccc;
  }

  .skip-link {
    display: none;
  }

  .site-frame {
    display: block;
    max-width: none;
    padding: 0;
  }

  body {
    font-size: 11pt;
  }
}
