/* Close (id contact, with id studio inside; 2026-11-16). Where the page lands: the one ask, made easy for an owner
   or CEO who has read this far. In order: Jeet's own line, the one action (the hero's words, the same Cal.com link),
   Jeet himself (his photo and his words, set in the layout, never a card), the email with Copy, the calendar in
   place on laptops, then who the studio is.
   Layout, in one word: statement. The line runs across the page like the hero's (the same two-tone setting, the
   second line plum), and the ask sits under its first words; on laptops the calendar stands beside the ask (from
   1240 px), on small laptops and tablets lying down it comes under it (from 900 px).
   The one moment: wherever the calendar shows, the line of light that drew the fo at the start comes back once and
   goes round it (the work section's loop, shared from work.js), so the light lands on the time you pick. On phones the
   action lands instead: the bottom bar's button docks into its place in the close and scrolls on with the page,
   so two wine buttons are never on screen together (js/close.js).
   References: memory/references/website-2026-11/close-refs/notes.md. Ground: the page colour questions ends on,
   so there is no seam above; the close ends on the same plain colour for the footer to turn to sky. */

.close {
  position: relative;
  padding: clamp(24px, 3vw, 48px) var(--pad) clamp(112px, 9.6vw, 148px);
  background: var(--cold);
  color: var(--ink);
  overflow-x: clip;                           /* the loop's glow may reach past the edge; never a sideways scroll */
  scroll-margin-top: var(--s5);
}

/* ---------- Jeet's line: set like the hero's headline, one step smaller ---------- */
.close-title {
  margin: 0;
  font: 500 clamp(40px, min(5vw, 9.4svh), 84px)/0.98 var(--sans);
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.close-title span { display: block; }
.close-second { color: var(--plum); }

.close-body {
  display: grid; grid-template-columns: minmax(0, 1fr);
  margin-top: clamp(36px, 4.4vw, 72px);
}

/* ---------- the ask: the action, the person, the other way in ---------- */
.close-act { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); }
.close-meta { font-size: var(--t-ui); line-height: 1.4; color: var(--plum); }

/* Jeet: his photo and his words in the layout (no box, no background); the words run from the photo's top edge to
   its bottom edge */
.close-jeet {
  display: flex; gap: var(--s4); align-items: stretch;
  margin: clamp(32px, 3.2vw, 48px) 0 0;
}
.close-jeet img {
  flex: none; width: 104px; height: 130px; object-fit: cover;
  border-radius: 12px; background: #3B3634;   /* the photo's own dark, while it loads */
}
.close-jeet figcaption {
  display: flex; flex-direction: column; justify-content: center; gap: var(--s3);   /* one group beside the photo (Jeet 11-16: the gap read wrong) */
  padding: 1px 0 0;
  font-size: var(--t-body); line-height: 1.4; color: var(--plum);
}
.close-jeet b { font-weight: 500; color: var(--ink); }
.close-jeet b, .close-role { display: block; }
.close-you { color: var(--ink); }

/* the other way in: the address as a link (it opens the mail app) and a quiet Copy beside it */
.close-mail {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s3);
  margin-top: clamp(24px, 2.4vw, 32px);
  font-size: var(--t-body); line-height: 1.4; color: var(--plum);
}
.close-addr { display: inline-flex; align-items: center; white-space: nowrap; }   /* the address keeps its Copy */
.close-mail a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 500; color: var(--ink);
  transition: color 150ms ease;
}
.close-mail button {
  min-height: 44px; margin-left: var(--s1); padding: 0 var(--s3);
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: 500 var(--t-ui)/1 var(--sans); color: var(--plum);
  transition: color 150ms ease, background-color 150ms ease;
}
.close-mail button:active { background: rgba(42, 14, 22, 0.08); }
@media (hover: hover) and (pointer: fine) {
  .close-mail a:hover { color: var(--plum); }
  .close-mail button:hover { color: var(--ink); background: rgba(42, 14, 22, 0.05); }
}

.close-vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- who the studio is: the last words before the footer ---------- */
.close-studio {
  max-width: 34em; margin-top: clamp(40px, 4vw, 64px);
  font-size: var(--t-lead); line-height: 1.5; color: var(--plum);
  text-wrap: pretty;
  scroll-margin-top: 36svh;                   /* the Studio link lands with Jeet's photo still in view above */
}

/* ---------- the calendar: from 900 px wide, loaded once the close is near (js/close.js) ----------
   Cal.com lays its month and its times side by side only in a frame wider than 768 px (narrower, it stacks them and
   lists every slot, 3,500 px tall); its card is 718 px wide and centred in the frame, its own name 80 px under it.
   So the calendar needs a column of 780 px: beside the words from 1240 px wide, under them from 900 px; narrower
   (phones, tablets upright) the button opens Cal.com's own page. */
.close-cal { display: none; }
@media (min-width: 900px) {
  .js .close-cal { display: block; position: relative; width: min(100%, 820px); margin-top: clamp(88px, 8vw, 104px); }
  .js .close-studio { margin-top: clamp(96px, 9vw, 120px); }   /* clear of the loop's foot and Open it on Cal.com */
  /* the ask in two columns above the calendar: the action and the email on the left, Jeet on the right */
  .js .close-ask { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "act jeet" "mail jeet"; column-gap: var(--s7); align-items: start; }
  .js .close-act { grid-area: act; }
  .js .close-jeet { grid-area: jeet; margin-top: 0; }
  .js .close-mail { grid-area: mail; }
}
@media (min-width: 1240px) {
  .js .close-body {
    grid-template-columns: minmax(0, 1fr) clamp(780px, 54vw, 820px);
    grid-template-rows: auto 1fr;
    grid-template-areas: "ask cal" "studio cal";
    column-gap: clamp(48px, 4.6vw, 88px);
    margin-top: clamp(72px, 6vw, 96px);       /* the loop of light runs 20 px above the calendar: clear of the line */
  }
  .js .close-ask { display: block; grid-area: ask; }
  .js .close-jeet { margin-top: clamp(32px, 3.2vw, 48px); }
  .js .close-studio { grid-area: studio; align-self: start; margin-top: clamp(48px, 4.4vw, 64px); }
  .js .close-cal { grid-area: cal; width: auto; margin-top: 0; }
}
.close-cal-box { position: relative; min-height: var(--close-cal-h, 570px); }
.close-cal-frame {
  position: relative; z-index: 1;
  display: block; width: 100%; height: var(--close-cal-h, 570px); border: 0;
  background: transparent; color-scheme: light;
  visibility: hidden;                         /* shown only once Cal.com says its calendar is ready */
}
.close-cal.is-ready .close-cal-frame { visibility: visible; }
/* the still state: an empty card exactly where Cal.com's will be (same size and place), never a blank box or a jump */
.close-cal-still {
  position: absolute; z-index: 2; top: 0; left: 0; right: 0; margin: 0 auto;
  width: min(100%, 718px); height: var(--close-card-h, 490px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2);
  border-radius: 6px; background: #FFFFFF;
  box-shadow: 0 0 0 1px rgba(42, 14, 22, 0.1);
  font-size: var(--t-ui); color: var(--plum);
  transition: opacity 350ms var(--ease-out), visibility 0s linear 350ms;
}
.close-cal-open {
  display: none; align-items: center; min-height: 44px;
  font-weight: 500; color: var(--ink); transition: color 150ms ease;
}
.close-cal.is-slow .close-cal-open { display: inline-flex; }
.close-cal.is-ready .close-cal-still { opacity: 0; visibility: hidden; }
.close-cal-alt {
  position: absolute; right: calc(50% - min(50%, 359px)); top: 100%; margin-top: 36px;   /* under the loop */
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: var(--t-ui); color: var(--plum); transition: color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .close-cal-alt:hover, .close-cal-open:hover { color: var(--ink); }
}
/* where the light lands: a soft daylight comes up behind the calendar as the loop goes round (js/close.js sets
   --close-lit from 0 to 1), so the loop's white core reads as light on the page's pale ground */
.close-glow {
  position: absolute; z-index: 0; left: -14%; right: -14%; top: -22%; bottom: -16%;
  pointer-events: none; opacity: var(--close-lit, 0);
  background: radial-gradient(closest-side, rgba(191, 217, 238, 0.9), rgba(191, 217, 238, 0.66) 50%, rgba(191, 217, 238, 0.3) 76%, rgba(191, 217, 238, 0) 100%);
}
.close-loop { position: absolute; z-index: 0; overflow: visible; pointer-events: none; }

/* ---------- tablet and phone ---------- */
@media (max-width: 1099px) {
  .close-title { font-size: clamp(32px, 6.6vw, 60px); line-height: 1.02; }
}
@media (max-width: 720px) {
  .close { padding-bottom: 120px; }           /* clear of the bottom bar once it comes back */
  .close-title { font-size: clamp(30px, 9.6vw, 48px); line-height: 1.04; letter-spacing: -0.03em; }
  .close-body { margin-top: var(--s6); }
  /* the action is the bottom bar's button, in its place in the page: same width, height and insets, so the bar
     can hand over to it without a jump (js/close.js) */
  .close-act { align-items: stretch; }
  .close-cta {
    width: calc(100% + 2 * var(--pad) - 24px); margin-inline: calc(12px - var(--pad));
    height: 56px; padding-left: var(--s2); justify-content: flex-start;
  }
  .close-cta span { flex: 1; text-align: center; margin-right: 40px; }
  @media (max-width: 370px) {                 /* the bottom bar's narrow-phone label (styles.css), for the hand-over */
    .close-cta { padding-right: var(--s4); font-size: var(--t-ui); }
    .close-cta span { margin-right: 0; }
  }
  .js .close-cta { opacity: 0; }             /* waits under the bar until it reaches the bar's place */
  .close-docked .close-cta, .close-cta:focus-visible { opacity: 1; }
  .close-docked .footbar { visibility: hidden; }
  .close-jeet img { width: 88px; height: 110px; border-radius: 10px; }
  .close-studio { font-size: var(--t-body); scroll-margin-top: 28svh; }
}

/* ---------- reduced motion: nothing moves; the loop is simply there ---------- */
@media (prefers-reduced-motion: reduce) {
  .close-cal-still, .close-mail a, .close-mail button, .close-cal-alt { transition: none; }
}
