/* ABOUTME: Styles for the content pages: the custom AI software page and policies, on top of style.css */
/* ABOUTME: A lime hero, steps, a testimonial, a closing band, the custom AI software page's window-card hero and desk of windows */

/* Hero: a lime band with a mono trail, the title and what the page is about */

.page-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 28px;
  min-height: 520px;
  padding: 96px var(--gutter) 72px;
  background-color: var(--lime);
}

.page-trail {
  font-family: var(--mono);
  font-size: 13px;
}

.page-trail a {
  text-decoration: none;
}

.page-trail a:hover {
  text-decoration: underline;
}

.page-hero h1 {
  max-width: 1100px;
  font-size: clamp(44px, 6.4vw, 96px);
  line-height: 0.96;
  font-weight: 600;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.page-lede {
  max-width: 760px;
  font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  font-size: 15px;
}

/* A small mono note, such as "Draft for review" */
.page-note {
  font-family: var(--mono);
  font-size: 13px;
  padding: 6px 10px;
  border: 1px dashed var(--black);
}

/* Sections */

.page-section {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: 96px var(--gutter);
}

.page-section-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
}

.page-section-head p {
  font-size: 18px;
  line-height: 1.5;
}

.page-band {
  background-color: var(--orange);
}

/* Steps */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--black);
}

.steps h3 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.steps p {
  font-size: 17px;
  line-height: 1.5;
}

/* The testimonial's section ends where the closing band starts, so the mascot stands on it */
.page-testimonial {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  align-items: end;
  gap: 64px;
  padding: 48px var(--gutter) 0;
}

/* The line beside the sign, not the quote on it */
.page-testimonial > p {
  max-width: 560px;
  padding-bottom: 140px;
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.4;
  letter-spacing: -0.015em;
}

/* Service page (custom AI software): the home page's parts on a lime page. The hero has the title on
   the left and what the service does in a window card on the right, like the Factors card */

.service-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
  min-height: calc(100svh - var(--header-height));
  padding: 64px var(--gutter);
  background-color: var(--lime);
}

.service-hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
}

.service-hero h1 {
  font-size: clamp(52px, 7vw, 120px);
  line-height: 0.94;
  font-weight: 600;
  letter-spacing: -0.055em;
}

.service-panel {
  border: 1.5px solid var(--black);
  background: var(--white);
  box-shadow: 10px 10px 0 var(--black);
}

.service-panel-bar {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  background: var(--black);
  color: var(--white);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.service-panel ul {
  padding: 8px 32px;
  list-style: none;
}

.service-panel li {
  padding: 22px 0;
  border-bottom: 1px solid var(--black);
}

.service-panel li:last-child {
  border-bottom: 0;
}

.service-panel h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.service-panel li p {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.5;
}

/* How we work with dotted boxes instead of rules */
.steps.dotted li {
  gap: 14px;
  padding: 28px;
  border: 2px dotted var(--black);
}

.steps.dotted h3 {
  font-size: 26px;
  line-height: 1.08;
}

.steps.dotted p {
  font-size: 16px;
}

/* The first step is a dotted speech bubble: the people talking. The bottom border is redrawn in two
   pieces so it opens where the tail drops from the bottom left */
.steps.dotted li:nth-child(1) {
  position: relative;
  border-bottom-color: transparent;
}

.steps.dotted li:nth-child(1)::before {
  content: "";
  position: absolute;
  top: 100%;
  left: -2px;
  width: 74px;
  height: 32px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 74 32'%3E%3Cpath d='M0 1 H36 L22 31 L70 1' fill='none' stroke='%231E1E1E' stroke-width='2' stroke-dasharray='2 2' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat;
}

.steps.dotted li:nth-child(1)::after {
  content: "";
  position: absolute;
  left: 68px;
  right: -2px;
  bottom: -2px;
  border-top: 2px dotted var(--black);
}

/* Each step is drawn more firmly than the last: a dotted sketch, then dashed, then finished with a hard shadow */
/* The browser's own dashes are barely longer than dots, so the dashes are drawn: 12px on, 8px off */
.steps.dotted li:nth-child(2) {
  border-color: transparent;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' fill='none' stroke='%231E1E1E' stroke-width='4' stroke-dasharray='12 8'/%3E%3C/svg%3E") border-box;
}

.steps.dotted li:nth-child(3) {
  border-style: solid;
  background-color: var(--white);
  box-shadow: 10px 10px 0 var(--black);
}

.page-cta.pink {
  background-color: var(--pink);
}

/* We love to build: a desk of windows, one per thing we build, in a loose overlapping cluster.
   built-windows.js lets them be dragged by their bars, brought forward and closed for a moment, and
   brings one forward in turn while nobody's touching them. The one in front has a black bar and a deeper shadow */
.built {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 96px var(--gutter) 104px;
  overflow: hidden;
  background-color: var(--lime);
}

.built-desk {
  position: relative;
  height: 720px;
  list-style: none;
}

.built-win {
  position: absolute;
  left: var(--x);
  top: var(--y);
  border: 2px solid var(--black);
  background: var(--white);
  color: var(--black);
  box-shadow: 6px 6px 0 var(--black);
  transition: box-shadow 0.2s ease;
}

.built-win.l { width: 26%; }
.built-win.m { width: 25%; }
.built-win.s { width: 21%; }

.built-win.active {
  box-shadow: 12px 12px 0 var(--black);
}

.built-win.closed {
  display: none;
}

.built-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 12px;
  border-bottom: 2px solid var(--black);
  background: var(--lime);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.built-bar:active {
  cursor: grabbing;
}

.built-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.built-win.active .built-bar {
  background: var(--black);
  color: var(--white);
}

.built-close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: -6px;
  border: 2px solid var(--black);
  background: var(--white);
  box-shadow: inset -2px -2px 0 rgba(30, 30, 30, 0.35);
  cursor: pointer;
  line-height: 0;
}

.built-close svg {
  fill: none;
  stroke: var(--black);
  stroke-width: 2;
}

.built-close:hover {
  box-shadow: inset -2px -2px 0 rgba(30, 30, 30, 0.6);
}

.built-close:active {
  padding: 2px 0 0 2px;
  box-shadow: inset 2px 2px 0 rgba(30, 30, 30, 0.6);
}

.built-body {
  display: block;
  width: 100%;
  padding: 20px 20px 22px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  line-height: 1.05;
  text-align: center;
  cursor: pointer;
}

.built-win.l .built-body { font-size: clamp(30px, 3vw, 44px); letter-spacing: -0.045em; }
.built-win.m .built-body { font-size: clamp(22px, 2.1vw, 30px); letter-spacing: -0.03em; }
.built-win.s .built-body { font-size: clamp(19px, 1.6vw, 22px); letter-spacing: -0.03em; }

.built-close:focus-visible,
.built-body:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 3px;
}

/* The windows pop up one after another when the desk first comes into view */
.built-desk.will-pop .built-win {
  opacity: 0;
}

.built-desk.will-pop.popped .built-win {
  animation: built-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) calc(var(--i) * 70ms) both;
}

@keyframes built-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

/* On phones the windows stack, and can't be dragged */
@media (max-width: 768px) {
  .built-desk {
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: auto;
  }

  .built-win,
  .built-win.l,
  .built-win.m,
  .built-win.s {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
  }

  .built-bar {
    cursor: auto;
    touch-action: auto;
  }

  /* These five lead the stack, popping up first; the rest follow in markup order */
  .built-win:nth-child(2) { order: -5; }
  .built-win:nth-child(12) { order: -4; }
  .built-win:nth-child(16) { order: -3; }
  .built-win:nth-child(3) { order: -2; }
  .built-win:nth-child(4) { order: -1; }

  .built-desk.will-pop.popped .built-win {
    animation-delay: calc(350ms + var(--i) * 70ms);
  }

  .built-desk.will-pop.popped .built-win:nth-child(2) { animation-delay: 0ms; }
  .built-desk.will-pop.popped .built-win:nth-child(12) { animation-delay: 70ms; }
  .built-desk.will-pop.popped .built-win:nth-child(16) { animation-delay: 140ms; }
  .built-desk.will-pop.popped .built-win:nth-child(3) { animation-delay: 210ms; }
  .built-desk.will-pop.popped .built-win:nth-child(4) { animation-delay: 280ms; }
}

/* Prose: policies and other reading pages */

.prose {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 760px;
  padding: 96px var(--gutter) 120px;
  font-size: 19px;
  line-height: 1.6;
}

.prose h2 {
  margin-top: 24px;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* Closing band */

.page-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  min-height: 480px;
  padding: 120px var(--gutter) 96px;
  background-color: var(--lime);
  text-align: center;
}

.page-cta h2 {
  font-size: clamp(44px, 5.6vw, 80px);
  line-height: 0.96;
  font-weight: 600;
  letter-spacing: -0.055em;
}

.page-cta p {
  max-width: 620px;
  font-size: 22px;
  line-height: 1.45;
}

.page-cta .page-actions {
  justify-content: center;
}

/* Tablet */

@media (max-width: 1100px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  /* Room for the speech bubble's tail when the steps stack */
  .steps.dotted li:nth-child(1) {
    margin-bottom: 16px;
  }

  /* The window drops under the title */
  .service-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .service-hero {
    min-height: 0;
    padding-top: 96px;
    padding-bottom: 96px;
  }

  .page-testimonial {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .page-testimonial > p {
    padding-bottom: 0;
  }

  .page-testimonial .testimonial {
    order: 1;
  }
}

/* Mobile */

@media (max-width: 768px) {
  .page-hero {
    min-height: 0;
    padding-top: 64px;
    padding-bottom: 56px;
    gap: 20px;
  }

  .page-section {
    gap: 32px;
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .service-hero {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .service-panel ul {
    padding: 4px 20px;
  }

  .prose {
    padding-top: 64px;
    padding-bottom: 80px;
    font-size: 17px;
  }

  .prose h2 {
    font-size: 26px;
  }

  .page-cta {
    min-height: 0;
    padding-top: 112px;
    padding-bottom: 80px;
  }

  .page-cta p {
    font-size: 19px;
  }
}
