/* FamOK LLC website. Night, and the lights of homes: safety, privacy, trust.
   Fonts are served from famok.app itself (OFL, see /fonts); nothing is fetched from anyone else. */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #0d131c;
  --dusk: #1a2433;
  --surface: #131b26;
  --paper: #efe9dd;
  --muted: #a5acb6;
  --line: #273140;
  --lamp: #ffd08a;
  --ridge-far: #151e2b;
  --ridge-mid: #101823;
  --ridge-near: #0a1018;
  --serif: "Newsreader", ui-serif, Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --max: 72rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--night);
}

body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Skip link: hidden until focused */
.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  color: var(--night);
  border-radius: 0.375rem;
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

a {
  color: var(--paper);
  text-decoration-color: color-mix(in srgb, var(--lamp) 70%, transparent);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--lamp);
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
}

p,
ul,
ol,
dl {
  margin: 0;
}

/* Header */
.site-header {
  position: relative;
  z-index: 2;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--paper);
}

.mark {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
}

.mark .roof {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.mark .lamp {
  fill: var(--lamp);
}

.site-nav ul,
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.375rem 0;
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--paper);
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -1px 0 var(--lamp);
}

/* Home: the hero is the night itself */
.home-page .site-header {
  position: absolute;
  inset: 0 0 auto;
}

.hero {
  position: relative;
  min-height: clamp(36rem, 88svh, 50rem);
  overflow: hidden;
  background: linear-gradient(180deg, var(--night) 0%, var(--night) 35%, var(--dusk) 100%);
}

.hero .wrap {
  position: relative;
  z-index: 1;
  padding-top: clamp(7.5rem, 5rem + 10vh, 11rem);
}

.hero h1 {
  font-size: clamp(2.75rem, 1.4rem + 5.6vw, 5.75rem);
  font-weight: 350;
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 72;
}

.hero h1 span {
  display: block;
}

.hero h1 span:last-child {
  color: var(--muted);
}

.hero .lede {
  margin-top: 1.5rem;
  max-width: 38rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
}

@media (max-width: 40rem) {
  .hero {
    min-height: 34rem;
  }

  .night {
    height: 44%;
  }
}

.night {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 50%;
  display: block;
}

.ridge.far { fill: var(--ridge-far); }
.ridge.mid { fill: var(--ridge-mid); }
.ridge.near { fill: var(--ridge-near); }

.home .core {
  fill: #ffe2b0;
}

.home.kin .core {
  fill: #fff1d6;
}

.threads path {
  fill: none;
  stroke: var(--lamp);
  stroke-opacity: 0.3;
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  vector-effect: non-scaling-stroke;
}

/* One moment on arrival: the homes light up, then the far-apart ones find each other. */
@media (prefers-reduced-motion: no-preference) {
  .home {
    opacity: 0;
    animation: light-on 0.9s ease-out forwards;
  }

  .home:nth-child(8n + 1) { animation-delay: 0.2s; }
  .home:nth-child(8n + 2) { animation-delay: 0.55s; }
  .home:nth-child(8n + 3) { animation-delay: 0.35s; }
  .home:nth-child(8n + 4) { animation-delay: 0.9s; }
  .home:nth-child(8n + 5) { animation-delay: 0.7s; }
  .home:nth-child(8n + 6) { animation-delay: 1.15s; }
  .home:nth-child(8n + 7) { animation-delay: 1.35s; }
  .home:nth-child(8n + 8) { animation-delay: 1s; }

  .threads path {
    stroke-dashoffset: 1;
    animation: thread 1.6s ease-in-out 1.9s forwards;
  }
}

@keyframes light-on {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes thread {
  to { stroke-dashoffset: 0; }
}

/* Safety, privacy, trust */
.motto {
  padding: clamp(4rem, 3rem + 5vw, 7rem) 0;
  border-top: 1px solid var(--line);
}

.motto ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 3rem clamp(2rem, 1rem + 3vw, 4rem);
  padding: 0;
  list-style: none;
}

.motto li {
  padding-top: 1.5rem;
  border-top: 1px solid var(--lamp);
}

.motto h2 {
  font-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem);
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.015em;
}

.motto p {
  margin-top: 0.75rem;
  max-width: 24rem;
  color: var(--muted);
}

.motto .punch {
  margin-top: 1rem;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.375rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

/* The proof: this page, measured */
.proof {
  padding: clamp(4rem, 3rem + 5vw, 7rem) 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.proof .counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6em;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 1.2rem + 4.4vw, 4.75rem);
  font-weight: 350;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 72;
}

.proof .counts b {
  color: var(--lamp);
  font-weight: 350;
}

.proof .counts span {
  white-space: nowrap;
}

.proof p:not(.counts) {
  margin-top: 1.5rem;
  max-width: 34rem;
  color: var(--muted);
}

/* Now, and how to reach us */
.now {
  padding: clamp(4rem, 3rem + 5vw, 7rem) 0;
}

.now .wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 3rem clamp(2rem, 1rem + 4vw, 6rem);
  align-items: start;
}

.now h2 {
  font-size: clamp(1.75rem, 1.45rem + 1.2vw, 2.375rem);
  letter-spacing: -0.01em;
}

.now .wrap > div > p {
  margin-top: 0.875rem;
  color: var(--muted);
}

.reach {
  display: grid;
  gap: 1.25rem;
}

.reach dt {
  color: var(--muted);
  font-size: 0.875rem;
}

.reach dd {
  margin: 0.125rem 0 0;
}

.reach .note {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

address {
  font-style: normal;
}

/* Inner pages: one readable column */
.page {
  padding: clamp(3rem, 2rem + 4vw, 5.5rem) 0 clamp(4rem, 3rem + 4vw, 6.5rem);
  border-top: 1px solid var(--line);
}

.page .wrap {
  max-width: calc(42rem + 2 * var(--gutter));
}

.page h1 {
  font-size: clamp(2.5rem, 1.7rem + 3.2vw, 4rem);
  font-weight: 350;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 72;
}

.page h2 {
  margin-top: 3rem;
  font-size: 1.625rem;
  letter-spacing: -0.01em;
}

.page .updated {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.page .lede {
  margin-top: 1.5rem;
  font-size: 1.1875rem;
}

.page p,
.page ul {
  margin-top: 1rem;
}

.page p:not(.lede):not(.updated),
.page li {
  color: #cfd3d9;
}

.page ul {
  padding-left: 1.25rem;
}

.page li + li {
  margin-top: 0.5rem;
}

.page li::marker {
  color: var(--lamp);
}

.page .reach {
  margin-top: 2.5rem;
  gap: 2rem;
}

.page .reach dd {
  font-size: 1.1875rem;
}

/* Footer */
.site-footer {
  color: var(--muted);
  font-size: 0.9375rem;
  border-top: 1px solid var(--line);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--paper);
}

@media print {
  .site-nav,
  .skip,
  .night {
    display: none;
  }
}
