/* ===========================================================================
   The Potty Hare - holding page
   Mobile first. Light clay background, dark ink text, terracotta accent.
   =========================================================================== */

:root {

    /* colour */
    --porcelain:   #faf5ee;
    --porcelain-2: #f3e9dc;
    --ink:         #241f1c;
    --ink-soft:    #5d5148;
    --ink-faint:   #8b7d72;
    --terracotta:  #c0603b;
    --terracotta-d:#a24a29;
    --sage:        #7e8c6a;
    --line:        rgba(36, 31, 28, .12);
    --card:        rgba(255, 253, 250, .74);

    /* type */
    --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
    --body:    'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* space */
    --gutter: 22px;
    --radius: 20px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100svh;
    background: var(--porcelain);
    color: var(--ink);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ---------------------------------------------------------------- backdrop */

.atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 50% -10%, #fffdfa 0%, rgba(255,253,250,0) 60%),
        linear-gradient(175deg, var(--porcelain) 0%, var(--porcelain-2) 100%);
}

.blob {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(42px);
    opacity: .62;
    will-change: transform;
}

.blob--1 {
    width: 62vw; height: 62vw;
    top: -14vw; left: -20vw;
    background: radial-gradient(circle at 35% 35%, rgba(192,96,59,.34), rgba(192,96,59,0) 70%);
    animation: drift-a 19s ease-in-out infinite;
}

.blob--2 {
    width: 70vw; height: 70vw;
    bottom: -22vw; right: -26vw;
    background: radial-gradient(circle at 60% 40%, rgba(126,140,106,.32), rgba(126,140,106,0) 70%);
    animation: drift-b 24s ease-in-out infinite;
}

.blob--3 {
    width: 48vw; height: 48vw;
    top: 42%; left: 46%;
    background: radial-gradient(circle at 50% 50%, rgba(212,164,120,.34), rgba(212,164,120,0) 70%);
    animation: drift-c 29s ease-in-out infinite;
}

@keyframes drift-a {
    0%, 100% { transform: translate3d(0,0,0) scale(1); }
    50%      { transform: translate3d(6vw, 5vw, 0) scale(1.12); }
}
@keyframes drift-b {
    0%, 100% { transform: translate3d(0,0,0) scale(1.06); }
    50%      { transform: translate3d(-7vw, -4vw, 0) scale(.94); }
}
@keyframes drift-c {
    0%, 100% { transform: translate3d(-50%,-50%,0) scale(1); }
    50%      { transform: translate3d(-58%,-42%,0) scale(1.1); }
}

/* tactile paper grain */
.grain {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    opacity: .16;
    mix-blend-mode: multiply;
}

/* ------------------------------------------------------------------- stage */

.stage {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    width: 100%;
    max-width: 34rem;
    min-height: 100svh;
    margin: 0 auto;
    padding: max(30px, env(safe-area-inset-top)) var(--gutter)
             max(30px, env(safe-area-inset-bottom));
}

/* ------------------------------------------------------------------- brand */

.brand { text-align: center; }

.mark {
    width: 82px;
    margin: 0 auto 18px;
    color: var(--terracotta);
    animation: rise .9s cubic-bezier(.2,.7,.3,1) both;
}

.mark svg { display: block; width: 100%; height: auto; }

.mark__wheel {
    transform-origin: 64px 64px;
    animation: spin 44s linear infinite;
}

.mark__hare path,
.mark__hare ellipse {
    stroke-dasharray: 240;
    stroke-dashoffset: 240;
    animation: draw 1.6s cubic-bezier(.35,.6,.2,1) forwards;
}
.mark__hare path:nth-child(1) { animation-delay: .15s; }
.mark__hare path:nth-child(2) { animation-delay: .3s; }
.mark__hare path:nth-child(3) { animation-delay: .45s; }
.mark__hare ellipse           { animation-delay: .7s; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.eyebrow {
    margin: 0 0 10px;
    font-size: .68rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--ink-faint);
    animation: eyebrow-in 1.4s .1s cubic-bezier(.2,.7,.3,1) both;
}

@keyframes eyebrow-in {
    from { opacity: 0; letter-spacing: .6em; }
    to   { opacity: 1; letter-spacing: .28em; }
}

.wordmark {
    margin: 0;
    font-family: var(--display);
    font-weight: 400;
    line-height: .95;
}

.wordmark__the {
    display: block;
    font-size: 1.15rem;
    font-style: italic;
    font-variation-settings: 'SOFT' 60, 'WONK' 1;
    color: var(--terracotta);
    letter-spacing: .04em;
    margin-bottom: .1em;
    animation: rise .8s .2s cubic-bezier(.2,.7,.3,1) both;
}

.wordmark__name {
    display: block;
    font-size: clamp(3rem, 17vw, 4.6rem);
    font-weight: 500;
    font-variation-settings: 'SOFT' 80, 'WONK' 1, 'opsz' 120;
    letter-spacing: -.015em;
}

.wordmark__name .w { display: inline-block; white-space: nowrap; }

.wordmark__name .l {
    display: inline-block;
    animation: letter .8s cubic-bezier(.2,.75,.3,1) both;
}

.wordmark__name .w:nth-child(1) .l:nth-child(1) { animation-delay: .30s; }
.wordmark__name .w:nth-child(1) .l:nth-child(2) { animation-delay: .39s; }
.wordmark__name .w:nth-child(1) .l:nth-child(3) { animation-delay: .48s; }
.wordmark__name .w:nth-child(1) .l:nth-child(4) { animation-delay: .57s; }
.wordmark__name .w:nth-child(1) .l:nth-child(5) { animation-delay: .66s; }
.wordmark__name .w:nth-child(2) .l:nth-child(1) { animation-delay: .78s; }
.wordmark__name .w:nth-child(2) .l:nth-child(2) { animation-delay: .87s; }
.wordmark__name .w:nth-child(2) .l:nth-child(3) { animation-delay: .96s; }
.wordmark__name .w:nth-child(2) .l:nth-child(4) { animation-delay: 1.05s; }

@keyframes letter {
    0%   { opacity: 0; transform: translateY(.55em) rotate(-8deg) scale(.9); }
    60%  { opacity: 1; }
    80%  { transform: translateY(-.06em) rotate(1.5deg) scale(1.01); }
    100% { opacity: 1; transform: none; }
}

/* the swash is drawn on, like a brush stroke */
.swash {
    display: block;
    width: min(240px, 66%);
    height: auto;
    margin: 14px auto 0;
    color: var(--terracotta);
    opacity: .9;
}

.swash path {
    stroke-dasharray: 330;
    stroke-dashoffset: 330;
    animation: draw 1.4s 1.15s cubic-bezier(.45,.55,.2,1) forwards;
}

.tagline {
    margin: 14px auto 0;
    max-width: 20rem;
    font-size: 1rem;
    font-style: italic;
    color: var(--ink-soft);
    animation: rise .9s 1.5s cubic-bezier(.2,.7,.3,1) both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------------- card */

.card {
    position: relative;
    padding: 26px 20px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 1px 0 rgba(255,255,255,.7) inset,
        0 18px 44px -24px rgba(36,31,28,.4);
    animation: rise 1s 1.25s cubic-bezier(.2,.7,.3,1) both;
}

/* thrown-clay ring in the corner */
.card::before {
    content: '';
    position: absolute;
    top: -1px; right: -1px;
    width: 72px; height: 72px;
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-radius: 0 var(--radius) 0 100%;
    pointer-events: none;
}

.panel.is-hidden { display: none; }

.card__title {
    margin: 0 0 10px;
    font-family: var(--display);
    font-size: 1.45rem;
    font-weight: 500;
    font-variation-settings: 'SOFT' 70, 'WONK' 1;
    line-height: 1.15;
    letter-spacing: -.01em;
}

.card__lead {
    margin: 0 0 22px;
    color: var(--ink-soft);
    font-size: .97rem;
}

.alert {
    margin: 0 0 18px;
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(192,96,59,.1);
    border: 1px solid rgba(192,96,59,.28);
    color: var(--terracotta-d);
    font-size: .9rem;
}

/* ------------------------------------------------------------------ fields */

.field { margin-bottom: 18px; }

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.field label .opt {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    font-style: italic;
    color: var(--ink-faint);
}

.field input,
.field textarea {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.72);
    color: var(--ink);
    font-family: var(--body);
    font-size: 16px;              /* stops iOS zooming on focus */
    line-height: 1.5;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
    appearance: none;
}

.field textarea { resize: vertical; min-height: 96px; }

.field input::placeholder,
.field textarea::placeholder { color: rgba(139,125,114,.7); }

.field input:focus,
.field textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--terracotta);
    box-shadow: 0 0 0 4px rgba(192,96,59,.14);
}

.field__error {
    margin: 0;
    max-height: 0;
    overflow: hidden;
    font-size: .82rem;
    color: var(--terracotta-d);
    transition: max-height .2s, padding-top .2s;
}

.field.has-error input,
.field.has-error textarea { border-color: var(--terracotta); }

.field.has-error .field__error { max-height: 4em; padding-top: 6px; }

/* honeypot */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ------------------------------------------------------------------ button */

.btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    margin-top: 4px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: var(--terracotta);
    color: #fff9f4;
    font-family: var(--body);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    box-shadow: 0 10px 22px -12px rgba(162,74,41,.9);
    transition: transform .15s, background .2s, box-shadow .2s;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover  { background: var(--terracotta-d); }
.btn:active { transform: translateY(1px) scale(.995); }

.btn:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.btn__spinner {
    position: absolute;
    width: 19px; height: 19px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: spin .7s linear infinite;
}

.btn.is-busy { pointer-events: none; }
.btn.is-busy .btn__label   { opacity: 0; }
.btn.is-busy .btn__spinner { opacity: 1; }

/* ----------------------------------------------------------------- privacy */

.privacy {
    display: flex;
    gap: 9px;
    margin: 18px 0 0;
    font-size: .8rem;
    line-height: 1.5;
    color: var(--ink-faint);
}

.privacy svg {
    flex: none;
    width: 16px; height: 16px;
    margin-top: 2px;
    color: var(--sage);
}

/* --------------------------------------------------------------- thank you */

.panel--thanks { text-align: center; padding: 6px 0 4px; }

.thanks__mark {
    width: 84px;
    margin: 0 auto 18px;
    color: var(--sage);
}

.thanks__mark svg { display: block; width: 100%; height: auto; }

.thanks__ring {
    transform-origin: 48px 48px;
    animation: ring-in .9s cubic-bezier(.2,.7,.3,1) both;
}
.thanks__ring--2 { animation-delay: .12s; }

.thanks__tick {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: draw .7s .35s cubic-bezier(.4,.6,.2,1) forwards;
}

@keyframes ring-in {
    from { opacity: 0; transform: scale(.6) rotate(-30deg); }
    to   { opacity: 1; transform: none; }
}

.thanks__sign {
    margin: 20px 0 0;
    font-family: var(--display);
    font-size: 1rem;
    font-style: italic;
    color: var(--ink-faint);
}

/* -------------------------------------------------------------------- foot */

.foot {
    text-align: center;
    color: var(--ink-faint);
    font-size: .74rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    animation: rise .9s 1.8s cubic-bezier(.2,.7,.3,1) both;
}

.foot p { margin: 0; }

.foot__dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-bottom: 12px;
}

.foot__dots i {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--terracotta);
    opacity: .45;
}
.foot__dots i:nth-child(2) { background: var(--sage); }
.foot__dots i:nth-child(3) { background: var(--ink-faint); }

/* ------------------------------------------------------------ bigger screens */

@media (min-width: 600px) {

    :root { --gutter: 34px; --radius: 24px; }

    body { font-size: 17px; }

    .stage { gap: 38px; max-width: 36rem; }

    .mark { width: 96px; }

    .card { padding: 34px 32px 30px; }

    .card__title { font-size: 1.85rem; }

    .field { margin-bottom: 20px; }
}

@media (min-width: 900px) {
    .wordmark__name { font-size: 5rem; }
    .stage { max-width: 38rem; }
}

/* ---------------------------------------------------------- accessibility */

@media (prefers-reduced-motion: reduce) {

    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .mark__hare path,
    .mark__hare ellipse,
    .swash path,
    .thanks__tick { stroke-dashoffset: 0; }
}
