/* FGFT LLC - shared styles. System fonts only; no external resources. */

:root {
  color-scheme: light dark;

  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f0ec;
  --text: #1a1d1f;
  --muted: #5b6167;
  --line: #e3e0da;
  --line-strong: #c9c5bd;
  --accent: #0c6a60;
  --accent-hover: #08534b;
  --accent-soft: #e4f1ed;
  --on-accent: #ffffff;

  /* Gem facet tints, lightest to deepest */
  --gem-1: #c9ebe3;
  --gem-2: #93d4c6;
  --gem-3: #52b4a3;
  --gem-4: #23917f;
  --gem-5: #0f6f64;
  --gem-6: #0a4e47;
  --gem-line: var(--bg);

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --max: 70rem;
  --prose: 42rem;
  --gutter: clamp(1rem, 3vw + 0.5rem, 2.5rem);
  --radius: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101315;
    --surface: #171b1e;
    --surface-2: #1b2023;
    --text: #ebeae6;
    --muted: #a2a9ae;
    --line: #262c30;
    --line-strong: #3a4247;
    --accent: #6dd1be;
    --accent-hover: #93e0d1;
    --accent-soft: #14302b;
    --on-accent: #06201b;

    --gem-1: #b4e9dd;
    --gem-2: #7fd3c2;
    --gem-3: #47b09f;
    --gem-4: #23897a;
    --gem-5: #146a60;
    --gem-6: #0d4b45;
  }

  /* Deepest tiles sit close to the card colour; give the tile an edge. */
  .mosaic {
    box-shadow: 0 0 0 1px var(--line-strong);
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 650;
  text-wrap: balance;
  margin: 0;
}

p,
li,
dd {
  text-wrap: pretty;
}

p {
  margin: 0 0 1rem;
}

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

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

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

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

address {
  font-style: normal;
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--line-strong);
}

.skip-link:focus {
  top: 0.75rem;
}

/* ---------- Gem mark ---------- */

.gem polygon {
  stroke: var(--gem-line);
  stroke-width: 3;
  stroke-linejoin: round;
}

.f1 { fill: var(--gem-1); }
.f2 { fill: var(--gem-2); }
.f3 { fill: var(--gem-3); }
.f4 { fill: var(--gem-4); }
.f5 { fill: var(--gem-5); }
.f6 { fill: var(--gem-6); }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: 0.16em;
  padding-block: 0.25rem;
}

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

.brand svg {
  width: 1.9rem;
  height: 1.9rem;
  flex: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.site-nav a:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.5em;
}

@media (max-width: 30rem) {
  .site-header .wrap {
    padding-block: 0.85rem 0.35rem;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav ul {
    gap: 0 1.35rem;
  }
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.5rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
}

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button-primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.button-quiet {
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.button-quiet:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ---------- Home: hero ---------- */

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (max-width: 30rem) {
  .eyebrow .sep {
    display: none;
  }

  .eyebrow span {
    display: block;
  }
}

.hero {
  padding-block: clamp(2.5rem, 8vw, 6.5rem) clamp(3rem, 8vw, 6rem);
}

.hero .wrap {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.15rem, 1.35rem + 3.6vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 15ch;
  margin-bottom: 1.4rem;
}

.lead {
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 1rem + 0.45vw, 1.3rem);
  line-height: 1.6;
}

.hero-art {
  order: -1;
  width: 5.5rem;
}

.hero-art svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (min-width: 52rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 4rem;
  }

  .hero-art {
    order: 0;
    width: min(100%, 21rem);
    justify-self: center;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(3rem, 8vw, 5.5rem);
  border-top: 1px solid var(--line);
}

.section-flush {
  border-top: 0;
  padding-top: 0;
}

.section h2 {
  font-size: clamp(1.55rem, 1.2rem + 1.3vw, 2.15rem);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-intro {
  max-width: 40rem;
  color: var(--muted);
}

.features {
  display: grid;
  gap: 2rem 2.5rem;
  grid-template-columns: 1fr;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 45rem) {
  .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 1.75rem;
  }
}

.features li {
  border-top: 2px solid var(--accent);
  padding-top: 1.25rem;
}

.features h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.features p {
  margin: 0;
  color: var(--muted);
}

/* ---------- Home: first app card ---------- */

.project {
  display: grid;
  gap: 2rem;
  align-items: center;
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 3.25rem);
}

.project h2 {
  margin-bottom: 1rem;
}

.project p {
  max-width: 34rem;
}

.facts {
  display: grid;
  margin: 1.75rem 0 0;
  max-width: 34rem;
}

.facts div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-weight: 600;
}

.mosaic {
  width: 100%;
  max-width: 17rem;
  justify-self: center;
  border-radius: 1rem;
  overflow: hidden;
  line-height: 0;
}

.mosaic svg {
  display: block;
  width: 100%;
  height: auto;
}

.mosaic polygon {
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linejoin: round;
}

@media (max-width: 51.99rem) {
  .mosaic {
    max-width: 13rem;
  }
}

@media (min-width: 40rem) and (max-width: 51.99rem) {
  .project {
    grid-template-columns: minmax(0, 1fr) 11rem;
    gap: 2rem;
  }

  .project .mosaic {
    align-self: start;
  }
}

@media (min-width: 52rem) {
  .project {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 3.5rem;
  }

  .project .mosaic {
    max-width: 21rem;
    justify-self: center;
  }
}

/* ---------- Home: contact ---------- */

.contact-grid {
  display: grid;
  gap: 2rem 2.5rem;
  grid-template-columns: 1fr;
  margin-top: 2.25rem;
}

@media (min-width: 36rem) {
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid > :last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 56rem) {
  .contact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contact-grid > :last-child {
    grid-column: auto;
  }
}

.contact-grid h3 {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.contact-grid p,
.contact-grid address {
  margin: 0;
}

.email-large {
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------- Content pages ---------- */

.page-head {
  padding-block: clamp(2.5rem, 7vw, 4.75rem) clamp(1.5rem, 3vw, 2.25rem);
}

.page-head h1 {
  font-size: clamp(2rem, 1.45rem + 2.4vw, 3rem);
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.page-head .meta {
  color: var(--muted);
  margin: 0;
}

.page-head .lead {
  margin-top: 1rem;
}

.prose {
  max-width: var(--prose);
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

.prose,
.site-footer {
  overflow-wrap: break-word;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  font-size: 1.4rem;
  letter-spacing: -0.015em;
  margin: 2.75rem 0 0.9rem;
  scroll-margin-top: 1.5rem;
}

.prose h3 {
  font-size: 1.075rem;
  margin: 1.9rem 0 0.6rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose li::marker {
  color: var(--accent);
}

.summary {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 2rem);
  margin-bottom: 2rem;
}

.summary h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.summary ul {
  margin: 0;
}

.summary li:last-child {
  margin-bottom: 0;
}

.toc {
  border-left: 2px solid var(--line);
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.toc h2 {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.toc li {
  margin-bottom: 0.25rem;
}

.contact-card {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 2rem);
}

.contact-card p:last-child,
.contact-card address:last-child {
  margin-bottom: 0;
}

.contact-card address {
  margin-bottom: 1rem;
}

/* Support page email block */

.email-panel {
  display: grid;
  gap: 1.25rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 1rem;
}

.email-panel .label {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.email-panel .email-large {
  margin: 0;
}

.email-panel .actions {
  margin-top: 0;
}

@media (min-width: 40rem) {
  .email-panel {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.prose .checklist {
  list-style: none;
  padding-left: 0;
  counter-reset: item;
}

.prose .checklist li {
  counter-increment: item;
  position: relative;
  padding: 0.9rem 0 0.9rem 2.75rem;
  border-top: 1px solid var(--line);
  margin: 0;
}

.checklist li:last-child {
  border-bottom: 1px solid var(--line);
}

.checklist li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0.95rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.75rem;
  text-align: center;
}

.checklist strong {
  display: block;
}

.checklist span {
  color: var(--muted);
}

/* 404 */

.not-found {
  padding-block: clamp(3.5rem, 12vw, 8rem);
}

.not-found .gem {
  width: 4rem;
  height: 4rem;
  margin-bottom: 1.5rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.925rem;
  line-height: 1.6;
}

.site-footer .wrap {
  display: grid;
  gap: 1.75rem 3rem;
  padding-block: 2.5rem 3rem;
}

.site-footer .brand {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.site-footer .brand svg {
  width: 1.5rem;
  height: 1.5rem;
}

.site-footer p,
.site-footer address {
  margin: 0;
}

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

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-block;
  padding-block: 0.3rem;
}

@media (min-width: 48rem) {
  .site-footer .wrap {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .footer-links {
    justify-content: flex-end;
  }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  a,
  .button {
    transition: color 0.15s ease, background-color 0.15s ease,
      border-color 0.15s ease, text-decoration-thickness 0.15s ease;
  }
}

.not-found h1 {
  font-size: clamp(2rem, 1.45rem + 2.4vw, 3rem);
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

/* ---------- Windows High Contrast / forced colors ---------- */

@media (forced-colors: active) {
  .project,
  .summary,
  .email-panel,
  .contact-card {
    border: 1px solid CanvasText;
  }
}
