/* Spaces v4: v2's page, plus a Log in link to the app. Ink on warm paper,
   the rubber cube as the mark, and examples that open in place as small
   shared spaces. */

:root {
  --paper: #f6f5f2;
  --card: #ffffff;
  --ink: #141414;
  --text: #3d3b37;
  --muted: #8a867f;
  --line: #dcd8d1;
  --edge: #e7e4de;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pad: clamp(20px, 3.2vw, 44px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(18px, .55vw + 14px, 21px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: var(--pad); }
main {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  width: 100%; max-width: 40rem; margin: 0 auto;
  padding: clamp(48px, 9vh, 96px) 0;
}
h1 {
  margin: 0 0 .8em;
  font-size: clamp(25px, 1.5vw + 15px, 36px); font-weight: 600;
  line-height: 1.18; letter-spacing: -.022em; color: var(--ink);
}
p { margin: 0 0 1em; max-width: 34em; }

/* The brand sits left; Log in sits top-right. The cube draws itself once. */
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.mark { width: 30px; height: 30px; }
.mark .edges path { stroke-dasharray: 60; stroke-dashoffset: 0; }
.mark .nodes circle { transform-box: fill-box; transform-origin: center; }
.drawn .mark .edges path { animation: draw .9s cubic-bezier(.6, 0, .2, 1) both; }
.drawn .mark .edges path:nth-child(n+5) { animation-delay: .2s; }
.drawn .mark .edges path:nth-child(n+9) { animation-delay: .4s; }
.drawn .mark .nodes circle { animation: pop .35s .85s both; }
@keyframes draw { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

/* Example links: ink text with a soft underline that darkens when open. */
.ex {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1.5px;
  text-underline-offset: .22em;
  transition: text-decoration-color .2s;
}
.ex:hover, .ex[aria-expanded="true"] { text-decoration-color: var(--ink); }

/* An example opens as a small white card. Without JS, the linked one shows
   through :target. */
.example {
  display: none;
  margin: .2em 0 1.4em;
  padding: 18px 20px 14px;
  max-width: 31rem;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 18px;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink);
}
.example:target, .example.open { display: block; animation: rise .22s ease-out both; }
.js .example:target:not(.open) { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.space-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 12px; font-size: 16.5px; font-weight: 600; }
.space-name span { font-size: 13px; font-weight: 400; color: var(--muted); }
.talk { list-style: none; margin: 0; padding: 0; }
.talk li { margin: 0 0 9px; }
.talk b { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.talk .ai { padding-left: 13px; border-left: 2px solid var(--ink); }
.note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }

/* The call to action: a black pill that opens the form. Log in is the
   outline button in the header. */
.join { margin-top: 1.4em; }
.login {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  font-size: 15px; font-weight: 500; line-height: 1;
  padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent;
  transition: border-color .15s, background-color .15s;
}
.login:hover { border-color: var(--ink); background: var(--card); }
.cta, .send {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--paper);
  font: inherit; font-size: 16px; font-weight: 500; line-height: 1;
  padding: 14px 22px;
  transition: transform .15s, background-color .15s;
}
.cta:hover, .send:hover { background: #2b2a27; }
.cta:active, .send:active { transform: scale(.98); }
.cta svg { transition: transform .2s; }
.cta[aria-expanded="true"] svg { transform: rotate(90deg); }
.cta[hidden] { display: none; }

.signup { margin-top: 14px; max-width: 30rem; }
.js .signup:not(.open) { display: none; }
.signup .row { display: flex; gap: 8px; }
.signup input[type="email"] {
  flex: 1; min-width: 0;
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 13px 18px;
}
.signup input[type="email"]::placeholder { color: #aaa59d; }
.signup input[type="email"]:focus { outline: none; border-color: var(--ink); }
.choice { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: 14.5px; color: var(--text); }
.choice input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--ink); flex: none; }
.consent { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 10px 0 0; }
.error { font-size: 14.5px; font-weight: 600; color: var(--ink); margin: 10px 0 0; }
.done { margin: 0; color: var(--ink); font-weight: 500; }
.error[hidden], .done[hidden] { display: none; }

footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13px; color: var(--muted); }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }

@media (max-width: 520px) {
  main { justify-content: flex-start; padding-top: 56px; }
  .example { padding: 16px 16px 12px; }
  .signup .row { flex-direction: column; }
  .send { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .drawn .mark .edges path, .drawn .mark .nodes circle, .example.open, .example:target { animation: none; }
  .cta svg, .cta, .send, .login { transition: none; }
}
