/* ==========================================================================
   /hello - the card page
   ==========================================================================

   Loaded only on this page, via the head section. Everything is namespaced
   .hello-* and nothing here touches the rest of the site.

   It deliberately does NOT reuse .prose. That class is defined twice in
   style.css - once at line 213 for article bodies and again at line 538 for
   long-form pages - and the later block wins, dragging in a max-width and
   88px of bottom padding that have nothing to do with this layout.

   Tokens come from style.css. Gold appears in exactly two places: the
   hairline under the name, and the selected state of an answer chip.
   ========================================================================== */

.hello {
    max-width: var(--xs-width);
    margin: 0 auto;
    padding: 40px 24px 56px;
}

/* --------------------------------------------------------------- header -- */

.hello-portrait {
    width: 130px;
    height: 130px;
    margin: 0 auto 18px;
}

.hello-portrait img {
    width: 100%;
    height: auto;
    display: block;

    /* Both portraits get the same fade, so neither has a hard edge against
       the cream and neither looks patched to match the other. */
    -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 58%, transparent 80%);
            mask-image: radial-gradient(circle at 50% 45%, #000 58%, transparent 80%);
}

.hello-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 2.25rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--color-text);
    text-align: center;
    margin: 0;
}

.hello-rule {
    width: 48px;
    height: 0;
    border: 0;
    border-top: 1px solid var(--color-gold);
    margin: 20px auto;
}

.hello-lines {
    font-family: var(--font-display);
    font-weight: 500;
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
    text-align: center;
    margin: 0 0 28px;
}

/* -------------------------------------------------------------- contact -- */

.hello-contact {
    background: var(--color-white);
    border-radius: 6px;
    box-shadow: var(--shadow);
    padding: 6px;
    display: flex;
    flex-direction: column;
}

.hello-contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 14px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-accent);
    text-align: center;
}

.hello-contact-item + .hello-contact-item {
    border-top: 1px solid var(--color-border);
}

.hello-contact-item:hover { color: var(--color-accent-hover); }

.hello-contact-email a { color: inherit; font-weight: 600; }

/* Which address is which. Quiet - it labels, it does not compete with the
   address it labels. */
.hello-contact-tag {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.hello-copy {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 3px 8px;
}

.hello-copy:hover { color: var(--color-accent); border-color: var(--color-accent); }
.hello-copy.is-done { color: var(--color-gold); border-color: var(--color-gold); }

/* ------------------------------------------------------------- the ask -- */

.hello-ask { margin: 44px 0 0; text-align: center; }

.hello-question {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.5rem;
    color: var(--color-text);
    margin: 0 0 20px;
}

.hello-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.hello-chip {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--color-text-secondary);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 12px 20px;
    transition: border-color 0.2s, color 0.2s;
}

.hello-chip:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* The one other place gold appears. Outlined, never filled. */
.hello-chip.is-selected {
    border-color: var(--color-gold);
    color: var(--color-gold);
}

.hello-just-looking {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    background: none;
    border: 0;
    padding: 14px 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hello-just-looking:hover { color: var(--color-accent); }

.hello-answered {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin: 44px 0 0;
}

.hello-change {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    background: none;
    border: 0;
    padding: 0 0 0 8px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hello-change:hover { color: var(--color-accent); }

/* ------------------------------------------------------------ sections -- */

/*
 * Closed until asked for - but only where a script can open them.
 *
 * .is-scripted is added inline by the page itself, so with JavaScript off
 * this rule never applies and every section is simply visible. That is the
 * whole page minus the sorting, which is a fine version of it; what is not
 * fine is hiding content from somebody who has no way to reveal it.
 */
.hello.is-scripted .hello-section[hidden] { display: none; }

.hello-section { margin-top: 36px; }

/* One transition, ease-out, no bounce and no stagger. */
.hello-section.is-entering {
    animation: hello-fade 250ms ease-out;
}

@keyframes hello-fade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.hello-response {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
    margin: 0 0 20px;
}

.hello-block { margin-bottom: 28px; }

.hello-block h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--color-text);
    margin: 0 0 8px;
}

.hello-block p {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--color-text-secondary);
    margin: 0 0 12px;
}

.hello-block-links a {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-accent);
}

.hello-block-links a + a { margin-left: 18px; }
.hello-block-links a:hover { color: var(--color-accent-hover); }

/* -------------------------------------------------------------- opt-in -- */

/*
 * A PANEL, not a rule.
 *
 * It used to be the last thing in the section, where a line above it was
 * enough to separate it from everything. It now sits BETWEEN blocks - after
 * the writing, before Domus Formation - and a rule that only draws above
 * leaves the block beneath crashing into the "read this week's" link with
 * nothing between them.
 *
 * Shaded rather than merely spaced, because the ask is a different KIND of
 * thing from the paragraphs either side of it: everything else on this page
 * is something to read, and this is the one place a visitor is asked to do
 * something. Its own surface says so without a heading having to.
 */
.hello-optin {
    background: var(--color-cream-deep, #f3ede1);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 20px;
    margin: 32px 0 36px;
}

.hello-optin-name {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin: 0 0 12px;
}

.hello-optin-name strong { color: var(--color-text); }

/* Two fields and a button. The first name is not decorative - the subscribe
   handler requires one and bounces the submission without it. Wraps rather
   than squeezing, so none of the three gets too narrow to use. */
.hello-optin-form { display: flex; flex-direction: column; gap: 14px; }

/* The row of two fields and a button, which is its own flex line now that a
   form can also hold a pair of checkboxes above it. */
.hello-optin-fields { display: flex; flex-wrap: wrap; gap: 8px; }

.hello-optin-fields input[type="text"],
.hello-optin-fields input[type="email"] {
    flex: 1;
    min-width: 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 10px 12px;
}

.hello-optin-fields input[type="text"] { flex: 1 1 38%; }
.hello-optin-fields input[type="email"] { flex: 2 1 50%; }

.hello-optin-fields button,
.hello-note button {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-white);
    background: var(--color-accent);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 10px 20px;
    white-space: nowrap;
}

.hello-optin-fields button:hover,
.hello-note button:hover { background: var(--color-accent-hover); }

/* ---------------------------------------------------- two lists at once -- */

/*
 * A choice, not a wall of text.
 *
 * The two letters come from different properties and are genuinely different
 * things, so each gets its name and a line of its own rather than being run
 * together into a sentence with an "and". The checkbox is the only control on
 * the page that is pre-set, and only for his own letter.
 */
/* The result, at the top of the box that produced it. Above the form rather
   than below it, so it is read before the fields it refers to. */
.hello-optin-alert { margin: 0 0 16px; }

.hello-optin-choices { display: flex; flex-direction: column; gap: 12px; }

.hello-optin-choice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
}

/* Lined up with the first line of the label rather than the middle of the
   block, which is where the eye expects it when the text runs to two lines. */
.hello-optin-choice input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--color-accent);
}

.hello-optin-choice strong { display: block; }

.hello-optin-blurb {
    display: block;
    margin-top: 2px;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.hello-optin-free {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* The proof, after the ask. Quieter than the button and on its own line, so
   it reads as an offer rather than as a second call to action. */
.hello-optin-read { margin: 14px 0 0; font-size: 0.9rem; }

/* White fields on the shaded panel, so the inputs still read as inputs. */
.hello-optin input[type="text"],
.hello-optin input[type="email"] { background: var(--color-white); }

/* ------------------------------------------------- everything else, footer */

.hello-else {
    border-top: 1px solid var(--color-border);
    margin-top: 40px;
    padding-top: 24px;
}

.hello-else h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--color-text);
    margin: 0 0 12px;
}

.hello-else ul { list-style: none; margin: 0; padding: 0; }
.hello-else li { margin-bottom: 8px; }

.hello-else a {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-accent);
}

.hello-footer {
    border-top: 1px solid var(--color-border);
    margin-top: 44px;
    padding-top: 28px;
}

.hello-about {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin: 0 0 18px;
}

/*
 * The marks live in the identity block now, under the contact panel - so on
 * desktop they travel with the sticky column and on mobile they sit directly
 * above the question.
 *
 * Each anchor is a 44px square. That is the tap target, and it is why the
 * icons end up 24px apart rather than the 20px specified: the hit areas are
 * touching at 24px and the choice is between a reachable link and four
 * pixels. The negative margin pulls the first one back so the row still
 * lines up with the text above it rather than looking indented.
 */
.hello-social {
    display: flex;
    margin: 20px 0 0 -12px;
}

.hello-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--color-text-muted);
}

.hello-social a:hover,
.hello-social a:focus-visible { color: var(--color-accent); }

.hello-social svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* The mark takes its colour from the link, which is what keeps brand colours
   off this page. */
.hello-social svg path { fill: currentColor; }

@media (max-width: 768px) {
    /* Centred with everything else in the identity block on a phone. */
    .hello-social { justify-content: center; margin-left: 0; }
}

.hello-note-toggle {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-accent);
    background: none;
    border: 0;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hello-note { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.hello-note input,
.hello-note textarea {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 10px 12px;
}

.hello-note button { align-self: flex-start; }

.hello-address,
.hello-home {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 18px 0 0;
}

.hello-home a { color: var(--color-text-muted); text-decoration: underline; text-underline-offset: 2px; }
.hello-home a:hover { color: var(--color-accent); }

/* Never rendered. A form filled in by something that fills in everything is
   a form filled in by a robot. */
.hello-trap {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.hello-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ------------------------------------------------------------- desktop -- */

@media (min-width: 769px) {
    .hello {
        max-width: 920px;
        display: grid;
        grid-template-columns: 300px minmax(0, 1fr);
        gap: 56px;
        align-items: start;
        padding: 64px 24px 72px;
    }

    /* The card half stays put while the answer scrolls beside it. */
    .hello-aside {
        position: sticky;
        top: 48px;
    }

    .hello-portrait { width: 150px; height: 150px; margin-left: 0; }
    .hello-name { text-align: left; font-size: 2.75rem; }
    .hello-rule { margin-left: 0; }
    .hello-lines { text-align: left; }

    .hello-ask { text-align: left; margin-top: 0; }
    .hello-answered { text-align: left; margin-top: 0; }

    .hello-chips { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .hello { padding: 32px 20px 48px; }
    .hello-name { font-size: 2rem; }
    .hello-chips { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .hello-section.is-entering { animation: none; }
}
