/* sogno · "the site is being built" page. Colours and type from the sogno brand kit (sogno-brand/README.md). */
:root {
  --teal: #00897F; --teal-bright: #00D4C8; --night: #0C1B2A; --night-2: #16293b; --ink: #111111;
  --paper: #F8FBFB; --paper-2: #EEF4F4; --muted: #55666f; --night-muted: #b5c4cc; --rule: #8a9aa2;
  --error: #B42318; --error-bg: #FEF3F2;
  --display: "Varela Round", "Arial Rounded MT Bold", system-ui, sans-serif; --body: "Heebo", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1); --spring: cubic-bezier(.3, 1.35, .6, 1);
  --radius: 28px; --radius-input: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--night); color: var(--paper); font: 400 1rem/1.6 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2 { margin: 0; font-family: var(--display); font-weight: 400; letter-spacing: -.01em; line-height: 1.05; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 3px; }

.page { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 64px; align-items: center; max-width: 1240px; margin: 0 auto; padding: 56px 64px; }
.intro { display: grid; justify-items: start; gap: 20px; }
.logo { width: 220px; height: auto; display: block; margin-bottom: 28px; }
h1 { font-size: clamp(3rem, 7vw, 6rem); max-width: 9ch; }
.lead { font-size: clamp(1.125rem, .4vw + 1rem, 1.375rem); color: var(--night-muted); }

/* the ring: eleven dots in place, the twelfth carried in by a small cursor, again and again */
.ring { width: clamp(120px, 16vw, 190px); height: auto; margin-top: 28px; overflow: visible; }
.ring__dots circle { fill: var(--teal-bright); }
.ring__hand path { fill: var(--teal-bright); stroke: var(--night); stroke-width: 1.4; stroke-linejoin: round; }
.ring__last, .ring__hand { animation: place 4.2s var(--ease) infinite; }
@keyframes place {
  0%, 12% { transform: translate(-46px, -40px); opacity: 0; }
  20% { opacity: 1; }
  52%, 78% { transform: translate(0, 0); opacity: 1; }
  92%, 100% { transform: translate(0, 0); opacity: 0; }
}
.ring__last { animation-name: place-dot; }
@keyframes place-dot {
  0%, 12% { transform: translate(-46px, -40px); opacity: 0; }
  20% { opacity: 1; }
  52%, 100% { transform: translate(0, 0); opacity: 1; }
}

/* the card */
.card { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 40px; }
.card h2 { font-size: 2rem; margin-bottom: 24px; }
.form { display: grid; gap: 18px; }
.card { position: relative; }
.visually-hidden, .trap { position: absolute; top: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.field { display: grid; gap: 6px; }
.field label { font-size: 1rem; color: var(--ink); }
.field input, .field textarea { width: 100%; min-width: 0; min-height: 52px; padding: 12px 16px; border: 1px solid var(--rule); border-radius: var(--radius-input); background: #fff; color: var(--ink); font: inherit; outline: 2px solid transparent; outline-offset: -3px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.field textarea { resize: vertical; min-height: 120px; }
.field input:hover, .field textarea:hover { border-color: var(--ink); }
.field input:focus-visible, .field textarea:focus-visible { outline-color: var(--teal); }
.field input[dir="ltr"] { text-align: left; }
.field.is-bad input, .field.is-bad textarea { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.err { color: var(--error); font-size: .95rem; }

/* email suggestions */
.mail { position: relative; }
.mail__list { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 10; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-input); box-shadow: 0 16px 32px -16px rgba(12, 27, 42, .45); max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.mail__list li { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.mail__list li b { font-weight: 500; }
.mail__list li[aria-selected="true"], .mail__list li:hover { background: var(--paper-2); }

/* send: the label gives way to the logo ring turning while it sends */
.send { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 56px; margin-top: 6px; padding: 0 40px; border: 0; border-radius: 999px; background: var(--night); color: var(--paper); font: 500 1.0625rem/1 var(--body); cursor: pointer; transition: background-color .2s var(--ease), transform .12s var(--ease); }
.send:hover { background: var(--night-2); }
.send:active { transform: translateY(1px) scale(.99); }
.send__spin { position: absolute; width: 26px; height: 26px; fill: var(--teal-bright); opacity: 0; }
.form.is-sending .send { pointer-events: none; }
.form.is-sending .send__label { opacity: 0; }
.form.is-sending .send__spin { opacity: 1; }
.form.is-sending .send__spin g { animation: turn 1.2s linear infinite; transform-origin: 0 0; }
@keyframes turn { to { transform: rotate(360deg); } }

.form__fail { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-input); background: var(--error-bg); color: var(--error); }
.form__fail svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; margin-top: 2px; }
.form__fail svg .dot { fill: currentColor; stroke: none; }
.form__fail a { color: inherit; }

/* done */
.done { display: grid; justify-items: start; gap: 12px; padding: 16px 0; outline: none; }
.done h2 { margin: 0; }
.done p { color: var(--muted); font-size: 1.125rem; }
.done__mark { width: 112px; height: 112px; margin-bottom: 12px; overflow: visible; }
.done__dots circle { fill: var(--teal); }
.done__check { fill: none; stroke: var(--teal); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; }
.done.is-on .done__dots circle { animation: gather .7s var(--spring) both; }
.done.is-on .done__check { animation: draw .5s .55s var(--ease) forwards; }
@keyframes gather { from { transform: scale(.2); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done__dots circle { transform-box: fill-box; transform-origin: center; }
.done__dots circle:nth-child(2) { animation-delay: .03s !important; } .done__dots circle:nth-child(3) { animation-delay: .06s !important; } .done__dots circle:nth-child(4) { animation-delay: .09s !important; }
.done__dots circle:nth-child(5) { animation-delay: .12s !important; } .done__dots circle:nth-child(6) { animation-delay: .15s !important; } .done__dots circle:nth-child(7) { animation-delay: .18s !important; } .done__dots circle:nth-child(8) { animation-delay: .21s !important; }
.done__dots circle:nth-child(9) { animation-delay: .24s !important; } .done__dots circle:nth-child(10) { animation-delay: .27s !important; } .done__dots circle:nth-child(11) { animation-delay: .3s !important; } .done__dots circle:nth-child(12) { animation-delay: .33s !important; }

@media (max-width: 60rem) {
  .page { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 32px 24px 48px; align-items: start; align-content: start; }
  .logo { width: 180px; margin-bottom: 16px; }
  .ring { position: absolute; top: 32px; inset-inline-end: 24px; width: 84px; margin: 0; }
  .intro { position: relative; }
}
@media (max-width: 40rem) {
  .page { padding: 24px 16px 40px; }
  .ring { top: 0; inset-inline-end: 0; width: 64px; }
  .card { padding: 24px; border-radius: 22px; }
  .send { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ring__hand { display: none; }
  .ring__last { opacity: 1; transform: none; }
  .done__check { stroke-dashoffset: 0; }
}
