/* Contact: the hero, then two columns on the ground: the ways to reach us as hairline rows, and the form as underlined fields.
   On success the form gives way to the seeds blooming into the home tree's apple above "Message sent." (contact.js). Tokens from site.css only. */
.contact [hidden] { display: none !important; } /* the form, its success and its error toggle with the hidden attribute */

/* ---------- Hero: the headline and lead, and on desktop a leafy branch reaching in from the top right with the seed apple hanging from it (the owner's pick) ---------- */
.contact-hero > .wrap { padding-block: calc(var(--nav-h) + clamp(56px, 8vw, 120px)) clamp(56px, 7vw, 96px); }
.contact-hero h1 { max-width: 13ch; }
.contact-hero .lead { max-width: 50ch; margin-top: 32px; }
.apple-branch { display: none; }
@media (min-width: 981px) {
  .contact-hero > .wrap { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 64px; align-items: stretch; }
  .apple-branch { display: block; position: relative; min-height: 440px; } /* room under the apple for its words */
}
/* contact.js draws it: the branch in deep leaf with the stem's leaves along it; at its end the hang, a zero-size box holding the halo and the apple's own svg
   (the twig down its middle, site.css's fruit on the twig's end) — their own layers, so the swing and the breathing are composited, never redrawn */
.apple-branch .branch { stroke: var(--leaf-deep); stroke-width: 3; stroke-linecap: round; }
.apple-branch .twig { stroke: var(--leaf-deep); stroke-width: 1.4; }
.apple-branch .flutter { transform-box: view-box; transform-origin: 0 0; } /* the leaf's base, in its own placed space */
.apple-branch .hang { position: absolute; width: 0; height: 0; transform-origin: 0 0; }
.apple-branch .apple { position: absolute; top: 0; max-width: none; overflow: visible; } /* the reset's max-width: 100% would collapse it in the zero-size hang */
.apple-branch .halo { position: absolute; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--seed) 35%, white) 0%, color-mix(in srgb, var(--seed) 45%, transparent) 42%, transparent 70%); }
/* the apple waits unlit with "Click me" beside it (the button covers the apple and rides its swing); picked, contact.js adds .lit: the glow comes on,
   the tag goes and the words beneath show. With motion the apple swings from the twig's root, the lit halo fades in then breathes, each leaf flutters
   on its own and the words rise into place; still pages hold still */
.apple-branch .pick { position: absolute; border-radius: 50%; cursor: pointer; }
.apple-branch .pick:focus-visible { outline: 2px solid var(--leaf-deep); outline-offset: 6px; }
.pick-tag { position: absolute; left: calc(100% + 10px); top: 50%; translate: 0 -50%; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--hair); border-radius: 999px; background: var(--bg); font: 600 .8125rem/1 var(--sans); color: var(--ink); white-space: nowrap; transition: opacity .3s; }
.pick-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--seed); }
html.anim .pick-tag i { animation: beat 2.4s ease-in-out infinite; }
.apple-branch .hang:not(.on) .pick-tag, .apple-branch.lit .pick-tag { opacity: 0; } /* no tag before the apple is there, none once it is picked */
.apple-branch:not(.lit) .halo { opacity: 0; }
.apple-words { position: absolute; left: 0; right: 0; bottom: 0; display: grid; justify-items: center; gap: 12px; text-align: center; }
.apple-words p { max-width: 34ch; font: 500 clamp(1.125rem, 1.5vw, 1.375rem)/1.35 var(--display); font-variation-settings: 'SOFT' 100; color: var(--ink); text-wrap: pretty; }
.apple-words p i { font-style: italic; color: var(--leaf-deep); }
.apple-words a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 600 .9375rem/1 var(--sans); color: var(--leaf-deep); text-decoration: underline; text-underline-offset: 4px; }
.apple-branch:not(.lit) .apple-words { visibility: hidden; }
html.anim .apple-branch .hang { animation: swing 6s ease-in-out infinite; will-change: transform; }
html.anim .apple-branch.lit .hang.on .halo { animation: halo-in .9s var(--ease) both, halo 3.8s ease-in-out .9s infinite; will-change: transform, opacity; }
html.anim .apple-words > * { translate: 0 14px; transition: translate .6s var(--ease); }
html.anim .apple-words a { transition-delay: .25s; }
html.anim .apple-branch.lit .apple-words > * { translate: 0 0; }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }
html.anim .apple-branch .leaves.open .flutter { animation: flutter 3.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes swing { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
@keyframes halo-in { from { opacity: 0; transform: scale(.6); } to { opacity: .75; transform: scale(.92); } }
@keyframes halo { 0%, 100% { transform: scale(.92); opacity: .75; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes flutter { 0%, 100% { rotate: 0deg; } 50% { rotate: var(--f, 4deg); } }

/* ---------- Two columns: reach us, the form ---------- */
.contact-body > .wrap { padding-block: clamp(72px, 9vw, 128px); border-top: 1px solid var(--hair); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 96px; align-items: start; }
.contact-title, .form-title, .form-success h2 { font-size: clamp(1.75rem, 3.2vw, 2.75rem); line-height: 1.05; }
.reach-intro { max-width: 40ch; margin-top: 20px; }

.reach { margin-top: 40px; border-top: 1px solid var(--hair); }
.reach .row { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: 4px 24px; align-items: baseline; padding-block: 18px; border-bottom: 1px solid var(--hair); }
.reach dt { font: 600 .8125rem/1.5 var(--sans); color: var(--muted); }
.reach dd { margin: 0; color: var(--ink); }
.reach address { font-style: normal; }
.reach a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -10px; overflow-wrap: anywhere; } /* a 44px target inside a text-height row */

/* the form: the shell's underlined fields, two to a line where they pair */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 40px; align-items: start; margin-top: 40px; } /* an error under one field leaves its neighbour's underline in place */
.field-wide { grid-column: 1 / -1; }
.field textarea { resize: vertical; min-height: 9.5rem; }
.field-hint { font-size: .8125rem; color: var(--muted); }
.contact-form .btn { margin-top: 40px; }
.contact-form .btn:disabled { opacity: .6; cursor: progress; }
.form-error { margin-top: 24px; }
/* the quick check: its question comes from send.php, so it needs JS; without JS a note with the email address stands in */
.check-nojs { margin: 0; font-size: .875rem; color: var(--muted); }
html.js .check-nojs, html:not(.js) .field-check { display: none; }
.field-check input { max-width: 8rem; }
.field.field-check .field-error { top: 100%; bottom: auto; margin: 6px 0 0; text-align: left; } /* its message under the hint, not above the question */
.form-landed { display: none; } /* without JS the browser posts the form itself and send.php sends it back to #sent or #not-sent */
.form-landed:target { display: block; margin-top: 24px; font-weight: 600; }
.form-note { max-width: 62ch; margin-top: 32px; font-size: .8125rem; line-height: 1.6; color: var(--muted); }
.form-note strong { font-weight: 700; color: var(--ink); }

/* success: one centred block, the apple the seeds form under its warm glow, then the heading, like the home page's closing */
.form-success { --bloom-h: clamp(180px, 22vw, 260px); position: relative; isolation: isolate; text-align: center; }
.form-success:focus { outline: none; } /* it takes focus only so the message is read; it is not a control */
.form-success canvas { position: relative; z-index: 1; display: block; width: 100%; height: var(--bloom-h); }
/* the glow behind the apple (the apple is 46% of the canvas tall, its heart a little below the middle), breathing like the home's fruit */
.fruit-glow { position: absolute; top: calc(var(--bloom-h) * .53); left: 50%; width: calc(var(--bloom-h) * 1.1); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--seed) 55%, transparent), color-mix(in oklab, var(--seed) 22%, transparent) 50%, transparent); filter: opacity(.8); }
.form-success canvas[hidden] + .fruit-glow { display: none; } /* no engine: no apple, no glow */
html.anim .fruit-glow { animation: fruit-glow-in .8s ease-out .5s backwards, fruit-glow-breathe 3.6s ease-in-out 1.3s infinite; }
@keyframes fruit-glow-in { from { opacity: 0; } }
@keyframes fruit-glow-breathe { 0%, 100% { filter: opacity(.8); scale: 1; } 50% { filter: opacity(1); scale: 1.12; } }
.form-success h2 { margin-top: 24px; }
.form-success p { max-width: 46ch; margin: 16px auto 0; }

/* ---------- Narrow desktops and tablets on their side (981–1199): the rows' value column is too narrow for the email beside its label ---------- */
@media (min-width: 981px) and (max-width: 1199px) {
  .reach .row { grid-template-columns: minmax(0, 1fr); }
}
/* ---------- Tablets and phones: one column, the form below the rows ---------- */
@media (max-width: 980px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 72px; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .reach .row { grid-template-columns: minmax(0, 1fr); }
  .contact-form .btn { width: 100%; justify-content: center; }
}
