:root {
  --bg: #f5f6f8; --panel: #ffffff; --panel-2: #f0f2f5; --text: #16181d; --muted: #5f6672; --border: #e2e5ea;
  --ok: #1f8a4c; --bad: #c53030; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 10px 30px rgba(16,24,40,.07);
  --radius: 16px; --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  /* Not black: the page is a deep slate tinted with the site's colour; header and footer a shade darker. */
  :root { --bg: color-mix(in srgb, var(--accent) 16%, #232833); --panel: color-mix(in srgb, var(--accent) 8%, #191c23);
    --panel-2: #22262d; --text: #eceef2; --muted: #a9b0bc; --border: color-mix(in srgb, var(--accent) 14%, #343a45);
    --ok: #4cc283; --bad: #f07070; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }
.wrap.wide { max-width: 1000px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; border-radius: 6px; }

/* Masthead: the brand and the motto. */
.masthead { background: var(--panel); border-bottom: 1px solid var(--border); padding: 30px 0 26px; }
.masthead .wrap { max-width: 1000px; }
.brand { display: inline-flex; align-items: baseline; gap: .02em; color: var(--text); text-decoration: none;
  font-weight: 850; font-size: 42px; letter-spacing: -0.045em; line-height: 1; }
.brand .dot { color: var(--accent); }
.brand .soft { color: var(--muted); font-weight: 500; letter-spacing: -0.02em; }
.motto { margin: 10px 0 0; font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 17px; letter-spacing: .01em; }
.motto::before { content: ""; display: inline-block; width: 22px; height: 1px; background: var(--accent); vertical-align: middle; margin-right: 10px; }

main { flex: 1; padding: 48px 20px 64px !important; }
.lead { color: var(--muted); font-size: 18px; max-width: 560px; }
.page-title { font-size: clamp(30px, 5vw, 40px); font-weight: 800; }
.page-title .star { color: var(--accent); }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
/* In dark mode the cards stay light (soft, not white), so the hCaptcha box (always light) fits in. */
@media (prefers-color-scheme: dark) {
  .card { color-scheme: light; --panel: #e9ecf1; --panel-2: #dde1e8; --bg: #f7f8fa; --text: #16181d; --muted: #545b67;
    --border: #cfd4dc; --ok: #1f8a4c; --bad: #c53030; --accent: var(--accent-light);
    color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 40px rgba(0,0,0,.35); }
}
.grid-2 { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }

/* The contact form. */
.contact { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 650; font-size: 14px; }
.field b { color: var(--bad); font-weight: 600; }
input, textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.h-captcha { min-height: 78px; }
.form-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-status { margin: 0; font-size: 14px; color: var(--muted); }
.form-status.ok { color: var(--ok); } .form-status.bad { color: var(--bad); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 650;
  color: #fff; background: var(--accent); border: 0; border-radius: 10px; padding: 11px 20px; cursor: pointer;
  transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.08); } .btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: default; }
.sent { text-align: center; padding: 26px 8px; }
.sent .check { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px;
  background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.sent .check svg { width: 26px; height: 26px; }

/* Contact details (mvhstefan.com). */
.hello { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 22px; margin-bottom: 22px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.hello svg { width: 46px; height: 46px; }
.details { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 4px; }
.details li { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 8px; min-height: 40px; }
.details .k { color: var(--muted); font-size: 14px; }
.details a { font-weight: 550; overflow-wrap: anywhere; }
.copy { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; }
.copy:hover { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.copy svg { width: 17px; height: 17px; }
.copy.done { color: var(--ok); }
.socials { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.socials a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 550;
  transition: border-color .15s, transform .1s; }
.socials a:hover { border-color: var(--c, var(--accent)); transform: translateY(-1px); }
.socials svg { width: 18px; height: 18px; color: var(--c, var(--accent)); flex: none; }

.aside { margin-top: 28px; padding: 18px 22px; border-radius: 14px; border: 1px dashed var(--border); color: var(--muted);
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; text-align: center; }
.aside svg { width: 20px; height: 20px; color: var(--accent); flex: none; }

.foot { background: var(--panel); color: var(--muted); font-size: 13px; padding: 26px 0 30px; border-top: 1px solid var(--border); text-align: center; }
.foot .wrap { max-width: 1000px; }
.narrow .masthead .wrap, .narrow .foot .wrap { max-width: 760px; }

/* The chat box. */
.chat-launch { position: fixed; z-index: 50; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; }
.chat-fab { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; color: #fff;
  background: var(--accent); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent); display: grid; place-items: center;
  transition: transform .15s; }
.chat-fab:hover { transform: scale(1.05); }
.chat-fab svg { width: 26px; height: 26px; }
.chat-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.chat-panel { position: fixed; z-index: 60; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  width: 370px; height: min(560px, calc(100vh - 40px)); display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: chat-in .18s ease both; }
@keyframes chat-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) {
  .chat-panel { inset: 0; width: auto; height: auto; max-width: 100vw; border-radius: 0; border: 0; }
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 18px; background: var(--accent); color: #fff; }
.chat-head .who { flex: 1; min-width: 0; }
.chat-head strong { display: block; font-size: 16px; }
.chat-head small { opacity: .85; font-size: 12.5px; }
.chat-close { width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer;
  display: grid; place-items: center; }
.chat-close:hover { background: rgba(255,255,255,.24); }
.chat-close svg { width: 18px; height: 18px; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.chat-intro { color: var(--muted); font-size: 14px; text-align: center; margin: 6px 10px 10px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 16px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.visitor { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.msg.owner { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg time { display: block; font-size: 11px; opacity: .7; margin-top: 3px; }
.msg.pending { opacity: .6; }
.chat-note { align-self: center; font-size: 12.5px; color: var(--muted); text-align: center; max-width: 90%; }
.chat-form { border-top: 1px solid var(--border); padding: 10px; display: grid; gap: 8px; background: var(--panel); }
.chat-who { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.chat-who input, .chat-row textarea { min-width: 0; }
.chat-who input, .chat-row textarea { font-size: 14px; padding: 9px 11px; border-radius: 10px; }
.chat-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-row textarea { min-height: 42px; max-height: 140px; resize: none; }
.chat-send { flex: none; width: 42px; height: 42px; padding: 0; border-radius: 10px; }
.chat-send svg { width: 19px; height: 19px; }
.chat-small { font-size: 12px; color: var(--muted); margin: 0 2px; }
.chat-small.bad { color: var(--bad); }

/* Phones: 16px or more in the chat fields, else iPhones zoom in when one is tapped (and stay zoomed in, so the
   send button and the messages end up past the right edge). */
@media (max-width: 520px) {
  .chat-who input, .chat-row textarea { font-size: 16px; }
}
