:root {
  color-scheme: light;
  --page: #f8f6ff;
  --panel: #fff;
  --text: #211832;
  --muted: #5d536c;
  --line: #d8cfe6;
  --accent: #5d2bb0;
  --button: #52269a;
  --button-text: #fff;
  --wash: #eee6fc;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --page: #171120;
    --panel: #20182c;
    --text: #f6efff;
    --muted: #c5b8d2;
    --line: #453652;
    --accent: #ceb4ff;
    --button: #ceb4ff;
    --button-text: #231435;
    --wash: #2b1e3c;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #171120;
  --panel: #20182c;
  --text: #f6efff;
  --muted: #c5b8d2;
  --line: #453652;
  --accent: #ceb4ff;
  --button: #ceb4ff;
  --button-text: #231435;
  --wash: #2b1e3c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 1rem/1.65 system-ui, sans-serif;
}
a { color: inherit; text-underline-offset: .23em; }
a:hover { color: var(--accent); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
p, figure { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.04; }
h1, h2 { letter-spacing: -.065em; }
h2 { font-size: clamp(2.45rem, 5.3vw, 4.6rem); }
h3 { font-size: 1.25rem; letter-spacing: -.025em; line-height: 1.24; }
.shell { width: min(100% - 3rem, 74rem); margin-inline: auto; }
.skip { position: absolute; z-index: 5; top: 1rem; left: 1rem; padding: .5rem 1rem; background: var(--panel); transform: translateY(-200%); }
.skip:focus { transform: none; }

.site-header, .site-footer { border-block-end: 1px solid var(--line); }
.header-inner, .footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 5rem;
}
.wordmark { display: inline-flex; align-items: center; gap: .35rem; font-weight: 800; text-decoration: none; letter-spacing: -.04em; white-space: nowrap; }
.wordmark img { margin-inline-end: .25rem; }
.wordmark span { color: var(--muted); font-weight: 600; }
nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.4rem); }
nav a { text-decoration: none; font-weight: 650; }
nav a:hover { text-decoration: underline; }
.theme {
  min-width: 6.6rem;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: .45rem .8rem;
  background: var(--panel);
  color: var(--text);
  font-size: .875rem;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-block: clamp(3rem, 8vw, 7.25rem);
}
.label {
  margin-bottom: .9rem;
  color: var(--accent);
  font: 700 .875rem/1.4 ui-monospace, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}
h1 { font-size: clamp(3.3rem, 7.5vw, 7rem); }
h1 em { color: var(--accent); font-family: Georgia, serif; font-weight: 400; letter-spacing: -.08em; }
.intro { max-width: 33ch; margin-block: 1.6rem; color: var(--muted); font-size: clamp(1.12rem, 2vw, 1.35rem); }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .65rem 1rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  font-weight: 750;
  text-decoration: none;
  line-height: 1.35;
}
.primary, .primary:hover { background: var(--button); color: var(--button-text); }
.primary:hover { filter: brightness(1.12); }
.secondary { border-color: var(--line); color: var(--text); background: var(--panel); }
.secondary:hover, .theme:hover { border-color: var(--accent); }
.hero-art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 1.08;
  border: 1px solid #68528c;
  border-radius: 1.25rem;
  background:
    radial-gradient(ellipse at 52% 45%, #6946a9 0%, transparent 68%),
    repeating-linear-gradient(0deg, transparent 0 31px, #b79ade26 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, #b79ade26 31px 32px),
    #221532;
}
.hero-art img { width: 39%; transform: rotate(-12deg); box-shadow: 1rem 1.2rem 0 #100b1f88; border-radius: 20%; }
.frame, .orbit { position: absolute; z-index: -1; border: 1px solid #c9b0ff88; }
.frame { inset: 15%; border-radius: 1.4rem; transform: rotate(12deg); }
.orbit { width: 79%; aspect-ratio: 1; border-radius: 50%; }
.cross { position: absolute; color: #d6c0ff; font: 1.25rem/1 monospace; }
.top-left { top: 1rem; left: 1rem; }
.top-right { top: 1rem; right: 1rem; }
.bottom-left { bottom: 1rem; left: 1rem; }
.bottom-right { bottom: 1rem; right: 1rem; }

.section { border-block-start: 1px solid var(--line); padding-block: clamp(3rem, 7vw, 6rem); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1.3rem; margin-bottom: 2rem; }
.section-head > p { max-width: 32ch; }
.section-head > p, .services p, .about p:not(.label), .contact > div > p:not(.label) { color: var(--muted); }
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.services article { padding: 1.3rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--panel); }
.services h3 { margin-block: 1.25rem .55rem; }
.service-symbol { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: .65rem; color: var(--accent); background: var(--wash); font-size: 1.5rem; line-height: 1; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gallery img, .placeholder { width: 100%; aspect-ratio: 1.55; object-fit: cover; border-radius: .8rem; }
.gallery img.gallery-ches { object-fit: contain; padding: .55rem; background: var(--wash); border: 1px solid var(--line); }
.placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  background: repeating-linear-gradient(var(--angle, 45deg), transparent 0 17px, var(--line) 17px 18px), var(--wash);
}
.stream { --angle: 90deg; }
.community { --angle: 135deg; }
.placeholder span { padding: .35rem .75rem; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--muted); font-size: .875rem; }
figcaption { margin-top: .65rem; font-weight: 700; }
.about, .contact { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: clamp(1.5rem, 5vw, 4rem); }
.about { border-radius: 1rem; background: var(--wash); padding: clamp(1.5rem, 5vw, 3.75rem); }
.about p + p { margin-top: 1rem; }
.contact > div > p:not(.label) { margin-block: 1.1rem; max-width: 44ch; }
address { display: grid; justify-items: start; gap: .4rem; font-style: normal; font-weight: 650; overflow-wrap: anywhere; }
.quote-panel { padding: clamp(1.15rem, 3vw, 1.7rem); background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; }
form { display: grid; gap: .55rem; }
label { font-weight: 690; }
input, textarea, select { width: 100%; min-width: 0; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--page); color: var(--text); }
select { max-width: 100%; }
textarea { resize: vertical; }
form label:not(:first-child), form .actions { margin-top: .45rem; }
.form-note, .form-status { color: var(--muted); font-size: .875rem; }
.form-status:empty { display: none; }
.site-footer { border-block-start: 1px solid var(--line); border-block-end: 0; }
.footer-inner { color: var(--muted); }

@media (max-width: 55rem) {
  .services { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 43rem) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { flex-wrap: wrap; padding-block: .7rem; gap: .35rem 1rem; }
  nav { width: 100%; order: 1; justify-content: space-between; gap: .45rem; }
  nav a { padding-block: .55rem; }
  .hero, .about, .contact { grid-template-columns: 1fr; }
  .hero-art { aspect-ratio: 1.35; }
  .hero-art img { width: 32%; }
  .section-head { display: grid; gap: .7rem; }
  .footer-inner { flex-wrap: wrap; padding-block: 1rem; }
}

@media (max-width: 30rem) {
  .services, .gallery { grid-template-columns: 1fr; }
  .gallery { gap: 1.5rem; }
  .gallery img, .placeholder { aspect-ratio: 2.05; }
}

.ches {
  position: fixed;
  z-index: 4;
  inset-inline-start: max(.8rem, env(safe-area-inset-left));
  inset-block-end: max(.8rem, env(safe-area-inset-bottom));
  display: grid;
  justify-items: start;
  gap: .55rem;
  max-width: calc(100% - 1.6rem);
}
.ches-launch {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .35rem .95rem .35rem .4rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 .35rem 1.4rem #17102533;
  font-weight: 780;
}
.ches-face {
  width: 3.5rem;
  height: 3.5rem;
  flex: none;
  object-fit: contain;
  transform: rotate(-7deg);
}
@media (prefers-reduced-motion: no-preference) {
  .ches-face { animation: ches-hello .85s ease-in-out 2 alternate; }
  .ches-launch:hover .ches-face { transform: rotate(7deg); transition: transform .2s ease; }
}
@keyframes ches-hello {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: translateY(-2px) rotate(7deg); }
}
.ches-panel {
  display: grid;
  grid-template-rows: auto minmax(3rem, 1fr) auto auto;
  width: min(23rem, calc(100vw - 1.6rem));
  height: min(27rem, calc(100dvh - 5.25rem));
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 .5rem 2rem #17102540;
}
.ches-header { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.ches-header h2 { font-size: 1.3rem; letter-spacing: -.025em; }
.ches-header p { font-size: .875rem; color: var(--muted); }
.ches-close { min-width: 2.75rem; min-height: 2.75rem; border: 0; border-radius: .5rem; background: var(--wash); color: var(--text); font-size: 1.4rem; }
.ches-log { overflow: auto; display: flex; flex-direction: column; gap: .55rem; padding: .8rem; }
.ches-message { align-self: start; max-width: 92%; padding: .55rem .7rem; border-radius: .7rem; background: var(--wash); overflow-wrap: anywhere; }
.ches-message a { display: inline-block; margin-top: .35rem; color: var(--accent); font-weight: 750; }
.ches-question { align-self: end; background: var(--button); color: var(--button-text); }
.ches-prompts { display: flex; gap: .35rem; padding: .35rem .8rem; overflow-x: auto; }
.ches-prompts button { flex: none; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--text); font-size: .875rem; }
.ches-prompts button:hover { border-color: var(--accent); }
.ches-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: .6rem .8rem .8rem; }
.ches .ches-form .button { margin: 0; }
.ches-form small { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; }
