/* plungeline.com, the landing page (scripts/build-site.ts). Brand: ink, steel, and the wordmark's blue edge. */
:root {
  --steel: #e9ecef;
  --paper: #ffffff;
  --ink: #15181c;
  --muted: #4d545c;
  --rule: #c9cfd6;
  --blue: #2b5bd7;
  --blue-dark: #234cb8;
  --blue-on-ink: #7fa3ff;
  --light: #f5f6f7;
  --display: 'Outfit', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --measure: 34rem;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--steel);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
}
a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h1 {
  font-size: clamp(2.4rem, 5.4vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 11em;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1.1;
}
p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

.button {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font: 600 1rem/1 var(--body);
  text-decoration: none;
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
}
.button:hover {
  background: var(--blue-dark);
}
.button.big {
  font-size: 1.0625rem;
  padding: 1rem 1.4rem;
}

/* Top bar */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
}
.brand img {
  display: block;
  height: 36px;
  width: auto;
}
.top nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.top nav a:not(.button) {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.top nav a:not(.button):hover {
  color: var(--blue);
}

main > section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 24px;
}

/* Hero: the words, then the knife as a template, full width. */
.hero {
  padding-top: 24px;
}
.hero-text {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  align-items: end;
}
.hero-text h1 {
  margin: 0;
}
.hero-side > :last-child {
  margin-bottom: 0;
}
.lede {
  font-size: 1.0625rem;
  color: var(--muted);
}
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0 12px;
}
.quiet {
  font-weight: 600;
  text-decoration: none;
}
.quiet:hover {
  text-decoration: underline;
}
.small {
  font-size: 0.9375rem;
  color: var(--muted);
}
.hero-figure {
  margin: 36px 0 0;
  padding: 28px;
  background: var(--paper);
  border-radius: 4px;
  /* Template paper: a 10 mm grid, faint. */
  background-image: linear-gradient(var(--steel) 1px, transparent 1px), linear-gradient(90deg, var(--steel) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}
.hero-knife {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
}
.hero-knife .part,
.hero-knife .swing {
  fill: none;
  stroke: var(--ink);
  stroke-width: 0.45;
  stroke-linejoin: round;
}
.hero-knife .swing {
  stroke: var(--blue);
  stroke-width: 0.6;
  transform-box: view-box;
  animation: swing-open 2.4s cubic-bezier(0.6, 0, 0.2, 1) 0.5s both;
}
.hero-knife .ghost {
  fill: none;
  stroke: var(--blue);
  stroke-width: 0.3;
  opacity: 0.22;
  /* Each appears as the blade passes it: --at is how far through the swing that is. */
  animation: appear 0.3s ease-out calc(0.5s + var(--at) * 2.2s) both;
}
.hero-knife .pivot-mark {
  fill: var(--blue);
}
.hero-knife .dim path {
  fill: none;
  stroke: var(--muted);
  stroke-width: 0.25;
}
.hero-knife .dim text {
  fill: var(--muted);
  font: 500 3.4px var(--body);
}
.hero-knife .dim.open {
  animation: appear 0.4s ease-out 2.8s both;
}
@keyframes swing-open {
  from {
    transform: rotate(var(--closed));
  }
  to {
    transform: rotate(0deg);
  }
}
@keyframes appear {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-knife .swing,
  .hero-knife .ghost,
  .hero-knife .dim.open {
    animation: none;
  }
}

/* Feature rows: words beside a screenshot, alternating sides. */
.row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: center;
}
.row.flip .copy {
  order: 2;
}
.shot {
  margin: 0;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow:
    0 1px 0 var(--rule),
    0 24px 48px -24px rgb(21 24 28 / 0.35);
}

/* Tracing, in three steps that play in turn: the drawing, Auto trace's preview, the finished design. */
.frames {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 1px 0 var(--rule),
    0 24px 48px -24px rgb(21 24 28 / 0.35);
}
.trace-steps .frames img {
  border-radius: 0;
  box-shadow: none;
}
.frames img + img {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.frames img:nth-child(2) {
  animation: trace-2 12s infinite;
}
.frames img:nth-child(3) {
  animation: trace-3 12s infinite;
}
.trace-steps ol {
  display: flex;
  gap: 8px 28px;
  flex-wrap: wrap;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  font-weight: 500;
}
.trace-steps li {
  counter-increment: step;
  color: var(--muted);
  opacity: 0.55;
}
.trace-steps li::before {
  content: counter(step) '  ';
  color: var(--blue);
  font-weight: 600;
  white-space: pre;
}
.trace-steps li:nth-child(1) {
  animation: step-1 12s infinite;
}
.trace-steps li:nth-child(2) {
  animation: step-2 12s infinite;
}
.trace-steps li:nth-child(3) {
  animation: step-3 12s infinite;
}
@keyframes trace-2 {
  0%,
  30% {
    opacity: 0;
  }
  34%,
  70% {
    opacity: 1;
  }
  71%,
  100% {
    opacity: 0;
  }
}
@keyframes trace-3 {
  0%,
  63% {
    opacity: 0;
  }
  67%,
  94% {
    opacity: 1;
  }
  98%,
  100% {
    opacity: 0;
  }
}
@keyframes step-1 {
  0%,
  31%,
  96%,
  100% {
    opacity: 1;
    color: var(--ink);
  }
  34%,
  94% {
    opacity: 0.55;
    color: var(--muted);
  }
}
@keyframes step-2 {
  0%,
  31%,
  67%,
  100% {
    opacity: 0.55;
    color: var(--muted);
  }
  34%,
  64% {
    opacity: 1;
    color: var(--ink);
  }
}
@keyframes step-3 {
  0%,
  64%,
  96%,
  100% {
    opacity: 0.55;
    color: var(--muted);
  }
  67%,
  94% {
    opacity: 1;
    color: var(--ink);
  }
}
/* Without motion: the finished design, and the steps as a plain list. */
@media (prefers-reduced-motion: reduce) {
  .frames img:nth-child(n),
  .trace-steps li:nth-child(n) {
    animation: none;
  }
  .frames img:nth-child(3) {
    opacity: 1;
  }
  .trace-steps li {
    opacity: 1;
    color: var(--ink);
  }
}

/* Export: the app and the paper it prints. */
.export-pair {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px;
  align-items: center;
  margin: 32px 0 16px;
}
.paper {
  margin: 0;
}
.paper img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  box-shadow:
    0 1px 2px rgb(21 24 28 / 0.12),
    0 18px 36px -18px rgb(21 24 28 / 0.4);
  transform: rotate(-1.2deg);
}

/* The details: a definition list on a rule, not cards. */
.kit dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
  margin: 24px 0 0;
}
.kit dl > div {
  border-top: 2px solid var(--ink);
  padding: 16px 0 28px;
}
.kit dt {
  font: 600 1.25rem/1.3 var(--display);
  margin-bottom: 6px;
}
.kit dd {
  margin: 0;
  color: var(--muted);
  max-width: var(--measure);
}

/* The one dark band: night mode on a phone. */
main > .pocket {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 56px;
  align-items: center;
  background: var(--ink);
  color: var(--light);
  border-radius: 6px;
  max-width: 1152px;
  padding: 64px 56px 0;
  margin-top: 24px;
  overflow: hidden;
}
.pocket p {
  color: #c4c9cf;
}
.phone {
  margin: 0;
  align-self: end;
}
.phone img {
  display: block;
  width: 300px;
  height: auto;
  border: 10px solid #2a2f36;
  border-bottom: 0;
  border-radius: 40px 40px 0 0;
  /* Just the top of the phone, rising out of the band. */
  aspect-ratio: 390 / 560;
  object-fit: cover;
  object-position: top;
}

/* Files */
.files table {
  width: 100%;
  max-width: 900px;
  border-collapse: collapse;
  margin-top: 16px;
}
.files th,
.files td {
  text-align: left;
  vertical-align: top;
  padding: 14px 24px 14px 0;
  border-top: 1px solid var(--rule);
}
.files thead th {
  border-top: 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}
.files tbody th {
  font-weight: 600;
  white-space: nowrap;
}

footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9375rem;
}
footer p {
  margin: 0;
}

@media (max-width: 820px) {
  main > section {
    padding: 48px 16px;
  }
  .top {
    padding: 16px;
  }
  .top nav {
    gap: 14px;
  }
  .brand img {
    height: 30px;
  }
  /* The knife is drawn smaller here, so its dimensions need bigger type to stay readable. */
  .hero-knife .dim text {
    font-size: 7px;
  }
  .hero-figure {
    margin-top: 32px;
    padding: 12px 8px 12px;
    margin-left: -8px;
    margin-right: -8px;
  }
  .hero-text,
  .row,
  main > .pocket {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .row.flip .copy {
    order: 0;
  }
  .kit dl,
  .export-pair {
    grid-template-columns: minmax(0, 1fr);
  }
  main > .pocket {
    padding: 40px 24px 0;
    margin: 0 16px;
  }
  .phone {
    justify-self: center;
  }
  .phone img {
    width: 240px;
  }
  .files th,
  .files td {
    display: block;
    padding: 0;
    border: 0;
  }
  .files thead {
    display: none;
  }
  .files tr {
    display: block;
    border-top: 1px solid var(--rule);
    padding: 12px 0;
  }
  footer {
    padding: 24px 16px 40px;
  }
}
