/* Cormorant Garamond (SIL Open Font License 1.1, see fonts/OFL.txt), served locally so no visitor data goes elsewhere. */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/cormorant-garamond-latin.woff2) format("woff2");
}

:root {
  --ink: #1a1a1a;
  --muted: #8a8a8a;
  --line: #e6e6e6;
  --paper: #fff;
  --serif: "Cormorant Garamond", Garamond, "EB Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--paper); color: var(--ink); }

body {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* Hero: the whole first screen, centred, with plenty of white. */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(3rem + env(safe-area-inset-top, 0px)) 1.25rem 5rem;
}

/* The sketch: portrait, soft white edges of its own. It surfaces from a haze first. */
.sketch {
  display: block;
  width: auto;
  height: min(54vh, 34rem);
  height: min(54svh, 34rem);
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto -1.5rem; /* its lower edge fades to white; let the name sit in it */
  animation: unveil 2.4s cubic-bezier(0.2, 0.6, 0.2, 1) 0.1s both;
}

.wordmark {
  font-weight: 500;
  font-size: clamp(1.7rem, 6vw, 3.4rem);
  letter-spacing: 0.4em;
  margin: 0 0 0 0.4em; /* balance the trailing letter-spacing */
  white-space: nowrap;
  position: relative;
}

.rule { width: clamp(60px, 10vw, 100px); height: 1px; background: #c8c8c8; border: 0; margin: 1.2rem auto 0; }

/* Unconcealment, as in Aletheia: letters surface from a haze, then the rule draws. */
.wordmark > span > span { display: inline-block; animation: unveil 1.6s cubic-bezier(0.2, 0.6, 0.2, 1) both; animation-delay: calc(1.2s + var(--i) * 0.09s); }
.hero .rule { animation: draw 0.9s cubic-bezier(0.4, 0, 0.2, 1) 2.8s both; }

@keyframes unveil {
  from { opacity: 0; filter: blur(14px); transform: translateY(0.06em) scale(1.04); }
  60% { opacity: 1; }
  to { opacity: 1; filter: blur(0); transform: none; }
}
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  .sketch, .wordmark > span > span, .hero .rule { animation: none; }
}

/* Footer: one quiet line. */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: 60rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
.foot .mark { font-size: 0.72rem; letter-spacing: 0.4em; }

/* ---------- app pages (inside Canvas) ---------- */
body.app { display: block; }
.page { max-width: 44rem; margin: 0 auto; padding: calc(2rem + env(safe-area-inset-top, 0px)) 1.25rem 4rem; }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 3rem; color: var(--muted); }
.top .mark { font-size: 0.72rem; letter-spacing: 0.4em; }
.top .who { font-size: 0.9rem; }
.app h1 { font-weight: 500; font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: 0 0 1.5rem; }
.eyebrow { font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }
.muted { color: var(--muted); }
.app a { color: var(--ink); text-underline-offset: 0.2em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; word-break: break-all; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.5rem; margin: 0 0 2rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.button {
  display: inline-block; font: inherit; font-size: 0.75rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--paper); background: var(--ink); border: 1px solid var(--ink); padding: 0.75rem 1.4rem; cursor: pointer; text-decoration: none;
}
.button:hover { background: #000; }
.small { font-size: 0.9rem; }
.disconnect { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
button.link { font: inherit; font-size: 0.9rem; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
button.link:hover { color: var(--ink); }
.top-right { display: flex; gap: 1.25rem; align-items: baseline; }
.settings-link { font-size: 0.9rem; color: var(--muted) !important; }
.form .field { display: flex; flex-direction: column; gap: 0.35rem; margin: 0 0 1.25rem; max-width: 26rem; }
.form label { font-size: 0.8rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.form input { font: inherit; font-size: 1rem; padding: 0.55rem 0.7rem; border: 1px solid #c8c8c8; background: var(--paper); color: var(--ink); }
.form input:focus { outline: 1px solid var(--ink); border-color: var(--ink); }
.problem { color: #9b2c2c; font-size: 0.9rem; }
.notice { border-left: 2px solid var(--ink); padding: 0.3rem 0 0.3rem 0.9rem; }
.scopes { list-style: none; padding: 0; margin: 0 0 1.5rem; font-size: 0.85rem; line-height: 1.9; }
