/* ═══════════════════════════════════════════
   chancery — thechancery.co
   two colours. one serif. restraint is the brief.
   ═══════════════════════════════════════════ */

:root {
  --ink:   #0a0a0a;   /* text */
  --cream: #faf9f6;   /* page */
  --line:  #e5e5e5;   /* hairline only */
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.55;
  font-size: 18px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

::selection { background: var(--ink); color: var(--cream); }

em { font-style: italic; font-weight: 400; }

/* ═══════ HERO ═══════ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--ink);
  overflow: hidden;
}

/* the grayscale painting; it simply scrolls away with the hero — never fades to black */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
/* GPU canvas that animates the brushstrokes; sits over the static base painting */
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero__layer {
  position: absolute;
  inset: 0;
  background-image: url("assets/starry-night-bw.jpg");
  background-size: cover;
  background-position: center;
  filter: grayscale(100%);
}
/* no-WebGL fallback: a second copy of the painting, warped by an SVG
   displacement filter, masked to the sky (injected by main.js).
   NOTE: must come after .hero__layer so its filter wins the cascade. */
.hero__layer--fallback {
  z-index: 1;
  filter: grayscale(100%) url(#windf);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 70%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 70%);
}
.hero__layer--fallback.is-hidden { display: none; }

.hero__center {
  position: relative;
  z-index: 1;
  color: var(--cream);
  padding: 24px;
}

/* the mark + entrance ("the halves close") */
.mark { width: 64px; height: 64px; margin: 0 auto 30px; display: block; }
.mark__left  { animation: slideLeft  1.4s cubic-bezier(.16,1,.3,1) both, markFade 1s ease both; }
.mark__right { animation: slideRight 1.4s cubic-bezier(.16,1,.3,1) both, markFade 1s ease both; }
@keyframes slideLeft  { from { transform: translateX(-70px); } to { transform: translateX(0); } }
@keyframes slideRight { from { transform: translateX( 70px); } to { transform: translateX(0); } }
@keyframes markFade   { from { opacity: 0; } to { opacity: 1; } }

.wordmark {
  font-weight: 400;
  font-size: clamp(44px, 9vw, 88px);
  letter-spacing: 1px;
  line-height: 1;
  animation: riseIn 1.2s ease 0.4s both;
}
.hero__sub {
  margin-top: 22px;
  font-size: 14px;
  letter-spacing: 3px;
  opacity: 0.82;
  animation: riseIn 1.2s ease 0.6s both;
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════ SECTIONS ═══════ */
main { padding-block: 40px; }

.section {
  max-width: 720px;
  margin-inline: auto;
  padding: 60px 24px;
}

.heading {
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  margin-bottom: 34px;
}

.prose p {
  font-size: clamp(19px, 2.2vw, 23px);
  line-height: 1.6;
  margin-bottom: 1.1em;
  max-width: 60ch;
}
.prose p:last-child { margin-bottom: 0; }

/* three-line treatments (the idea) */
.lines { list-style: none; }
.lines li {
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.5;
  padding-block: 22px;
  text-wrap: balance;   /* if a line must wrap, break it evenly — no orphan words */
}
.lines li em { display: inline; margin-right: 0.4em; }

/* the teacher's pen circle around "the idea" — one continuous stroke that
   loops the block three times, drawn on when the section scrolls into view */
.circled {
  position: relative;
  /* enough room that the loops clear the text — but not so much horizontal
     padding that the longest line is forced to wrap on desktop */
  padding: clamp(48px, 9vw, 72px) clamp(44px, 6vw, 50px);
}
.circled__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.circled__svg path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;   /* pen width stays true when stretched */
  stroke-dasharray: 1;
  stroke-dashoffset: 1;                /* hidden until drawn */
}
.circled.is-in .circled__svg path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.7s cubic-bezier(0.45, 0.05, 0.55, 0.95) 0.15s;
}

/* testimonials — quiet hairline boxes, square corners, one voice per box */
.quotes { display: grid; gap: 26px; }
.quote {
  margin: 0;
  border: 1px solid var(--line);
  padding: 34px 32px 30px;
}
.quote blockquote {
  margin: 0 0 28px;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.6;
}
.quote__who { display: flex; align-items: center; gap: 16px; }
.quote__who img {
  width: 52px;
  height: 52px;
  border-radius: 50%;        /* the photos are cropped to their circles */
  object-fit: cover;
  filter: grayscale(100%);   /* two colours only, like everything else */
  flex: 0 0 auto;
}
.quote__id { display: flex; flex-direction: column; }
.quote__name { font-weight: 500; font-size: 17px; }
.quote__title { font-size: 15px; opacity: 0.6; margin-top: 2px; }

/* founder */
.founder { max-width: 340px; }
.founder img {
  width: 100%;
  filter: grayscale(100%);   /* insurance — the file is already b&w */
}
.founder figcaption { margin-top: 22px; }
.founder__name { display: block; font-size: 22px; }
.founder__role { display: block; font-size: 18px; opacity: 0.6; margin-top: 4px; }
.founder__link {
  display: inline-block;
  margin-top: 16px;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: opacity 0.3s ease;
}
.founder__link:hover { opacity: 0.55; }

/* join CTA — underlined text only, no fill, no colour */
.apply {
  display: inline-block;
  font-size: 21px;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  transition: opacity 0.3s ease;
}
.apply:hover { opacity: 0.55; }

/* the arrow swarm: ten pen arrows pointing at "apply", drawn one at a time.
   The wrapper is centered with generous margins so the arrows have room. */
.apply-wrap {
  position: relative;
  width: max-content;
  margin: 110px auto 96px;
}
.apply-arrows {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, 94vw);
  height: auto;
  aspect-ratio: 460 / 240;
  overflow: visible;
  pointer-events: none;
}
.apply-arrows .arr {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;                /* hidden until drawn */
}
.apply-wrap.is-in .arr {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.45s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}
.apply-wrap.is-in .arr:nth-child(1)  { transition-delay: 0.10s; }
.apply-wrap.is-in .arr:nth-child(2)  { transition-delay: 0.28s; }
.apply-wrap.is-in .arr:nth-child(3)  { transition-delay: 0.46s; }
.apply-wrap.is-in .arr:nth-child(4)  { transition-delay: 0.64s; }
.apply-wrap.is-in .arr:nth-child(5)  { transition-delay: 0.82s; }
.apply-wrap.is-in .arr:nth-child(6)  { transition-delay: 1.00s; }
.apply-wrap.is-in .arr:nth-child(7)  { transition-delay: 1.18s; }
.apply-wrap.is-in .arr:nth-child(8)  { transition-delay: 1.36s; }
.apply-wrap.is-in .arr:nth-child(9)  { transition-delay: 1.54s; }
.apply-wrap.is-in .arr:nth-child(10) { transition-delay: 1.72s; }

/* a dinner — two instagram posts, shoulder to shoulder */
.section--wide { max-width: 900px; }
.ig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* always shoulder to shoulder, never stacked */
  gap: 26px;
  justify-items: center;
  align-items: start;
  min-height: 300px;   /* reserve space so the layout doesn't jump as they load */
  overflow-x: auto;    /* embeds have a hard min-width; scroll inside, not the page */
}
.ig-grid .instagram-media {
  margin: 0 !important;
  width: 100%;
  max-width: 400px;
  min-width: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
@media (max-width: 760px) {
  .ig-grid { gap: 14px; }
}

/* embedded tweet (an unusual event) — centered, sized to the column */
.tweet {
  display: flex;
  justify-content: center;
  min-height: 300px;   /* reserve space so the layout doesn't jump as it loads */
}
.tweet .twitter-tweet { margin: 0 auto !important; }

/* ═══════ FOOTER ═══════ */
.footer {
  max-width: 720px;
  margin: 40px auto 0;
  padding: 70px 24px 90px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.footer__place { margin-bottom: 18px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-bottom: 26px; }
.footer__links a { text-decoration: none; transition: opacity 0.3s ease; }
.footer__links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer__links .sep { opacity: 0.4; }
.footer__copy { font-size: 12px; opacity: 0.5; letter-spacing: 0.5px; }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 640px) {
  .section { padding: 40px 22px; }
  .footer { padding: 56px 22px 72px; }
}

/* ═══════ MOTION DISCIPLINE ═══════ */
/* Owner's explicit decision (2026-07-15): the hero sky animates for every
   user — no reduced-motion opt-out. Only the one-shot logo entrance is
   stilled here. */
@media (prefers-reduced-motion: reduce) {
  .mark__left, .mark__right { animation: none; opacity: 1; transform: none; }
  .wordmark, .hero__sub { animation: none; opacity: 1; transform: none; }
}
