/* Coppelia: blueprint theme
   Cool white page, blue-black ink, deep teal accent.
   Dark bands carry Victorian engravings tinted blue-black. */

:root {
  --paper: #f4f6f8;
  --plate: #e8edf1;
  --ink: #141b24;
  --muted: #5b6773;
  --rule: #d3dae1;
  --teal: #0f5c63;

  --night: #0e141c;
  --night-ink: #eef2f5;
  --night-muted: #b3bfcb;
  --night-faint: #8d9aa7;
  --night-rule: rgba(238, 242, 245, .18);
  --teal-night: #6fb7b4;

  --display: "Libre Caslon Display", Georgia, "Times New Roman", serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --measure: 64ch;
  --width: 1080px;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.6 var(--body);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.dark :focus-visible { outline-color: var(--teal-night); }

.wrap {
  max-width: var(--width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(42px, 6.5vw, 76px); line-height: 1.04; }
h2 { font-size: clamp(30px, 4vw, 42px); line-height: 1.15; }
h3 { font-size: 23px; line-height: 1.25; }
p { margin: 0; max-width: var(--measure); }
.prose { display: grid; gap: 1em; }
.prose p, .prose li { max-width: var(--measure); }
.prose ol, .prose ul { margin: 0; padding-left: 1.3em; display: grid; gap: .4em; }
.label {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal);
}
.dark .label { color: var(--teal-night); }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  justify-self: start;
  padding: 11px 22px;
  border: 1.5px solid var(--teal);
  background: var(--teal);
  color: var(--paper);
  font: 500 14px/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: transparent; color: var(--teal); }
.dark .btn { border-color: var(--teal-night); color: var(--night-ink); }
.dark .btn:hover { background: transparent; color: var(--night-ink); }
.btn.ghost { background: transparent; color: var(--teal); }
.btn.ghost:hover { background: var(--teal); color: var(--paper); }

/* ---------- Dark engraved bands (hero, page headers, CTA) ---------- */
.dark { background: var(--night); color: var(--night-ink); }
.dark a { color: var(--night-ink); }
.engraved { position: relative; isolation: isolate; overflow: hidden; }
.engraved-bg { position: absolute; inset: 0; z-index: -1; background: var(--night); }
.engraved-bg img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
  display: block;
  /* tint the engraving blue-black */
  filter: grayscale(1) sepia(1) hue-rotate(175deg) saturate(1.5) brightness(.7) contrast(1.15);
}
.engraved-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(14,20,28,.55) 0%, rgba(14,20,28,0) 22%),
    linear-gradient(90deg, rgba(14,20,28,.92) 0%, rgba(14,20,28,.78) 42%, rgba(14,20,28,.25) 100%);
}
.engraved-bg.heavy::after { background: rgba(14,20,28,.82); }
.fig-note {
  display: flex; justify-content: flex-end; gap: 16px;
  padding-block: 0 16px;
  font: 12px var(--mono); color: var(--night-faint);
}

/* ---------- Site header ---------- */
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 20px;
  border-bottom: 1px solid var(--night-rule);
}
.wordmark { font-family: var(--display); font-size: 28px; line-height: 1; color: var(--night-ink); text-decoration: none; }
.dark .wordmark { color: var(--night-ink); }
.wordmark-sub { font-family: var(--body); font-size: 17px; color: var(--night-muted); letter-spacing: .01em; }
.site-head .wordmark { font-family: var(--body); font-size: 19px; line-height: 1.3; }
.site-head .wordmark-sub { font-size: inherit; }
.site-head .wordmark { display: flex; align-items: center; gap: 12px; }
.wordmark-key { width: 36px; height: 36px; flex: none; display: block; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; flex-wrap: wrap; font-size: 16px; }
.nav-list a { text-decoration: none; color: var(--night-ink); padding-block: 4px; border-bottom: 1px solid transparent; }
.nav-list a:hover, .nav-list a[aria-current="page"] { border-bottom-color: var(--teal-night); }
.nav-mobile { display: none; position: relative; }
.nav-mobile summary {
  list-style: none; cursor: pointer;
  font: 500 13px var(--mono); letter-spacing: .1em; text-transform: uppercase;
  padding: 8px 12px; border: 1px solid var(--night-rule);
}
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile[open] summary { border-color: var(--teal-night); }
.nav-mobile .nav-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  flex-direction: column; gap: 4px; min-width: 200px;
  padding: 12px 18px; background: var(--night); border: 1px solid var(--night-rule);
}

/* ---------- Home hero ---------- */
.hero-body { padding-block: 120px 96px; }
.hero-text { display: grid; gap: 24px; max-width: 620px; min-width: 0; }
.lede { font-size: 21px; color: var(--night-muted); }

/* ---------- Inner page header ---------- */
.page-band .page-title { padding-block: 72px 64px; display: grid; gap: 16px; }
.page-band .page-title p { font-size: 20px; color: var(--night-muted); max-width: 52ch; }

/* ---------- Sections ---------- */
.section { border-top: 1px solid var(--rule); }
.section:first-of-type { border-top: 0; }
.section > .wrap { padding-block: 72px; display: grid; gap: 32px; }
.section-head { display: grid; gap: 12px; }
.section-head p { color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.pair > * { display: grid; gap: 14px; align-content: start; min-width: 0; }
.tint { background: var(--plate); }

/* Faint engraving behind a light section */
.etched { position: relative; isolation: isolate; overflow: hidden; }
.etched::before {
  content: ""; position: absolute; z-index: -1;
  top: 0; right: 0; bottom: 0; width: 55%;
  background: var(--etching, none) right center / cover no-repeat;
  filter: grayscale(1) sepia(1) hue-rotate(175deg) saturate(.8);
  opacity: .1;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 45%);
}

/* ---------- How it works ---------- */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--ink); background: var(--paper);
}
.steps > li { padding: 22px 18px 26px; display: grid; gap: 10px; align-content: start; border-left: 1px solid var(--rule); min-width: 0; }
.steps > li:first-child { border-left: 0; }
.steps .n { font: 500 12px var(--mono); color: var(--teal); letter-spacing: .1em; text-transform: uppercase; }
.steps p { font-size: 16px; line-height: 1.55; color: var(--muted); }

/* ---------- Why us facts ---------- */
.facts { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--ink); }
.facts div { display: grid; grid-template-columns: 9ch 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.facts dt { font-family: var(--display); font-size: 30px; line-height: 1; }
.facts dd { margin: 0; color: var(--muted); font-size: 16px; }

/* ---------- Parts we've built ---------- */
.parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.part { border: 1px solid var(--ink); background: var(--paper); display: grid; grid-template-rows: auto auto 1fr; min-width: 0; }
.part-head { padding: 18px 20px 14px; display: grid; gap: 8px; border-bottom: 1px solid var(--rule); }
.part-no { font: 500 12px var(--mono); letter-spacing: .1em; color: var(--teal); text-transform: uppercase; display: grid; gap: 4px; }
.part-no span:last-child { color: var(--muted); }
.part-spec { margin: 0; padding: 6px 20px 18px; font-size: 15px; }
.part-spec div { padding: 10px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 2px; }
.part-spec div:last-child { border-bottom: 0; }
.part-spec dt { font: 12px var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.part-spec dd { margin: 0; color: var(--ink); }

/* ---------- Clients ---------- */
.logos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.logos li { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; place-items: center; padding: 14px; aspect-ratio: 1 / 1; }
.logos img { width: 100%; max-width: 96px; height: auto; mix-blend-mode: multiply; filter: grayscale(1) contrast(1.05); opacity: .8; transition: filter .2s, opacity .2s; }
.logos li:hover img { filter: none; opacity: 1; }

/* ---------- Testimonials ---------- */
.carousel { display: grid; gap: 24px; }
.carousel-track { list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 2px solid var(--teal); outline-offset: 6px; }
.slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
.quote { margin: 0; padding-left: 28px; border-left: 2px solid var(--teal); display: grid; gap: 16px; align-content: start; max-width: 46em; }
.quote p { font-size: 22px; font-style: italic; line-height: 1.55; }
.quote cite { font: 13px/1.5 var(--mono); color: var(--muted); font-style: normal; }
.carousel-controls { display: flex; align-items: center; gap: 16px; padding-left: 28px; }
.carousel-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 1.5px solid var(--teal); background: transparent; color: var(--teal); font: 18px/1 var(--mono); cursor: pointer; }
.carousel-btn:hover:not(:disabled) { background: var(--teal); color: var(--paper); }
.carousel-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.carousel-btn:disabled { opacity: .3; cursor: default; }
.carousel-count { font: 13px var(--mono); letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .carousel-track { scroll-behavior: auto; } }

/* ---------- Melt ---------- */
.members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 20px; }
.member { display: grid; gap: 8px; align-content: start; }
.member img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; filter: grayscale(1) contrast(1.05); border: 1px solid var(--rule); background: var(--plate); }
.member a { text-decoration: none; color: inherit; }
.member a:hover h3 { color: var(--teal); }
.member h3 { font-size: 20px; }
.member p { font-size: 14px; color: var(--muted); line-height: 1.4; }
.member .links { display: flex; gap: 12px; font: 12px var(--mono); letter-spacing: .04em; }

/* ---------- Call to action band ---------- */
.cta .wrap { padding-block: 80px; display: grid; gap: 20px; justify-items: start; }
.cta p { color: var(--night-muted); font-size: 20px; }

/* ---------- Glasseye page ---------- */
.ge-sections { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; border-top: 1px solid var(--ink); }
.ge-sections div { padding: 16px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 4px; align-content: start; }
.ge-sections dt { font-family: var(--display); font-size: 22px; }
.ge-sections dd { margin: 0; color: var(--muted); font-size: 16px; }
.issues { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; }
.issue a { display: grid; gap: 10px; text-decoration: none; color: inherit; }
.issue img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--rule); background: var(--plate);
  /* nudge the black-and-white covers towards the page's blue-grey */
  filter: grayscale(1) sepia(.14) hue-rotate(155deg) saturate(1.1) brightness(.98);
}
.issue .meta { font: 12px var(--mono); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.issue h3 { font-size: 21px; }
.issue a:hover h3 { color: var(--teal); }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Team / member profile ---------- */
.profile { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; align-items: start; }
.profile img { width: 100%; filter: grayscale(1) contrast(1.05); border: 1px solid var(--rule); }
.profile .prose h2 { margin-bottom: 4px; }
.link-row { display: flex; gap: 18px; flex-wrap: wrap; font: 13px var(--mono); letter-spacing: .04em; }

/* ---------- Contact ---------- */
.contact-details { margin: 0; display: grid; border-top: 1px solid var(--ink); }
.contact-details div { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 2px; }
.contact-details dt { font: 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.contact-details dd { margin: 0; font-size: 19px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form .full { grid-column: 1 / -1; }
.form label { display: grid; gap: 6px; font: 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.form input, .form textarea {
  font: 17px/1.5 var(--body); color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--muted); border-radius: 0; background: #fff; width: 100%;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }

/* ---------- Article (blog post) ---------- */
.article { max-width: 760px; grid-template-columns: minmax(0, 1fr); overflow-wrap: break-word; }
.article > * { min-width: 0; max-width: 100%; }
.article img { border: 1px solid var(--rule); }
.article img, .article iframe, .article video, .article embed, .article object { max-width: 100%; }
.article pre, .article table { display: block; overflow-x: auto; }

/* ---------- Footer ---------- */
.site-foot .wrap { padding-block: 40px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.site-foot .brand { display: grid; gap: 6px; }
.site-foot .brand p { color: var(--night-faint); font-size: 14px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; font-size: 15px; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps > li { border-left: 0; border-top: 1px solid var(--rule); }
  .steps > li:nth-child(even) { border-left: 1px solid var(--rule); }
  .steps > li:nth-child(-n+2) { border-top: 0; }
  .parts, .issues { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .nav-desktop { display: none; }
  .nav-mobile { display: block; }
  .site-head .wordmark-text { display: grid; gap: 6px; }
  .wordmark-key { width: 40px; height: 40px; }
  .site-head .wordmark { font-size: 17px; }
  .wordmark-sub .dash { display: none; }
  .hero-body { padding-block: 72px 56px; }
  .engraved-bg img { object-position: 70% center; }
  .engraved-bg::after { background: rgba(14,20,28,.8); }
  .pair, .profile, .ge-sections, .form { grid-template-columns: 1fr; }
  .pair { gap: 40px; }
  .steps { grid-template-columns: 1fr; }
  .steps > li, .steps > li:nth-child(even) { border-left: 0; border-top: 1px solid var(--rule); }
  .steps > li:first-child { border-top: 0; }
  .steps > li:nth-child(2) { border-top: 1px solid var(--rule); }
  .parts, .issues { grid-template-columns: 1fr; }
  .section > .wrap { padding-block: 56px; }
  .profile img { max-width: 240px; }
  .etched::before { width: 100%; opacity: .07; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
