/* Ceraluna Labs, ceralunalabs.com */

/* ---------- Fonts (self-hosted, latin subset, variable) ---------- */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: normal;
  font-display: swap;
  src: url("/fonts/fraunces-latin-var.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: normal;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin-var.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  --paper: #faf8f4;
  --surface: #f1eee7;
  --ink: #1f242e;
  --ink-soft: #4b5260;
  --accent: #1d5564;
  --accent-deep: #11333d;
  --line: #e1ddd3;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  --measure: 40rem;
  --gutter: 1.25rem;
  --section: clamp(4rem, 10vw, 7rem);
}

/* ---------- Reset and base ---------- */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 550;
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.3rem, 4.5vw + 1rem, 3.7rem);
}

h2 {
  font-size: clamp(1.7rem, 2.5vw + 0.8rem, 2.4rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1rem;
}

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

a:hover {
  color: var(--accent-deep);
}

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

::selection {
  background: var(--accent);
  color: var(--paper);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent-deep);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 10;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ---------- Layout ---------- */

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

.section {
  padding: var(--section) 0 0;
}

.section:last-of-type {
  padding-bottom: var(--section);
}

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

.lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}

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

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

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

.wordmark {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--accent);
}

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

.site-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}

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

/* ---------- Hero ---------- */

.hero {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

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

.hero h1 {
  max-width: 24ch;
}

.hero-figure {
  display: none;
  justify-self: center;
}

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

@media (min-width: 56em) {
  .hero .wrap {
    grid-template-columns: 7fr 5fr;
  }

  .hero-figure {
    display: block;
    max-width: 26rem;
  }
}

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

.button {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.button-solid {
  background: var(--accent);
  color: var(--paper);
}

.button-solid:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--paper);
}

.button-ghost {
  background: transparent;
  color: var(--accent);
}

.button-ghost:hover {
  background: var(--surface);
  color: var(--accent-deep);
}

/* ---------- Services ---------- */

.service-grid {
  display: grid;
  gap: 1.2rem;
  margin-top: 2.5rem;
}

.service {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.8rem 1.6rem;
  background: #fff;
}

.service h3 {
  margin-bottom: 0.6rem;
}

.service p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 0.98rem;
}

.service-index {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

@media (min-width: 44em) {
  .service-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Work ---------- */

.work-list {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.work-item {
  border-bottom: 1px solid var(--line);
  padding: 2rem 0;
  display: grid;
  gap: 0.4rem 2.5rem;
}

.work-kind {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.work-item h3 {
  margin: 0.2rem 0 0.5rem;
}

.work-item p {
  margin: 0;
  color: var(--ink-soft);
  max-width: var(--measure);
}

@media (min-width: 44em) {
  .work-item {
    grid-template-columns: 11rem 1fr;
  }

  .work-kind {
    padding-top: 0.45rem;
  }
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  gap: 2.5rem;
  margin-top: 2.5rem;
}

.portrait {
  width: min(16rem, 60vw);
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

.about-body p {
  max-width: var(--measure);
}

.credentials {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.credentials li {
  padding-left: 1.3rem;
  position: relative;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.credentials li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
}

@media (min-width: 56em) {
  .about-grid {
    grid-template-columns: auto 1fr;
    align-items: start;
  }
}

/* ---------- Contact ---------- */

.contact {
  background: var(--accent-deep);
  color: var(--paper);
  margin-top: var(--section);
  padding: var(--section) 0;
}

.contact .eyebrow {
  color: #9fc4cd;
}

.contact h2 {
  color: var(--paper);
}

.contact p {
  color: #cfdde1;
  max-width: var(--measure);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2rem;
}

.contact .button-solid {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--accent-deep);
}

.contact .button-solid:hover {
  background: #e8e4dc;
  border-color: #e8e4dc;
}

.contact .button-ghost {
  color: var(--paper);
  border-color: #56808c;
}

.contact .button-ghost:hover {
  background: #1d4450;
  color: var(--paper);
}

.contact-note {
  font-size: 0.9rem;
  margin: 1.6rem 0 0;
  color: #9fb9c0;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 2rem;
  justify-content: space-between;
}

.footer-legal {
  list-style: none;
  display: flex;
  gap: 1.4rem;
  margin: 0;
  padding: 0;
}

.footer-legal a {
  color: var(--ink-soft);
}

.footer-legal a:hover {
  color: var(--accent);
}

.contact + .site-footer {
  border-top: none;
}

/* ---------- Legal pages and prose ---------- */

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

.prose h1 {
  font-size: clamp(2rem, 3.5vw + 0.8rem, 2.8rem);
}

.prose h2 {
  font-size: 1.35rem;
  margin-top: 2.6rem;
}

.prose h3 {
  font-size: 1.1rem;
  margin-top: 1.8rem;
}

.prose address {
  font-style: normal;
}

.prose .placeholder {
  background: #fdf3d7;
  padding: 0 0.25em;
  border-radius: 2px;
}

.prose .stand {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ---------- 404 ---------- */

.error-page {
  min-height: 55vh;
  display: grid;
  align-content: center;
  padding-top: var(--section);
  padding-bottom: var(--section);
}

.error-page p {
  max-width: var(--measure);
  color: var(--ink-soft);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
