/* The Submit application button at the end of a job application, alone on white, with the attached CV beside it.
   The sheet that folds, the envelope drawn in lines and the thread of light live in the air above the row; the
   envelope's flap is a separate SVG so the letter can pass in front of it while it is open and behind it once it
   closes. A GSAP element never has a transform in the CSS: the hover lift sits on the parent of the moving parts. */
:root {
  --page: #ffffff;            /* the page */
  --ink: #15161b;             /* the words and the envelope's lines */
  --muted: #8a8c96;           /* the small words */
  --line: rgba(21, 22, 27, 0.1); /* the hairlines */
  --btn-top: #2a2b33;         /* the top of the button */
  --btn-bottom: #0e0f13;      /* the bottom of the button */
  --btn-ink: #f5f5f8;         /* the words on the button */
  --accent: #4f6bff;          /* the check, the light, the CV's lines */
  --paper: #ffffff;           /* the sheet */
  --paper-back: #f3f4f7;      /* the back of the sheet */
}

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

html, body { height: 100%; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.wrap {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: min(150px, 30vh);
}

/* ---- the air above the row ---- */
.air {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
}

.sheet {
  position: absolute;
  left: 0;
  top: 0;
  width: 60px;
  height: 78px;
  visibility: hidden;
  z-index: 2;
}
.sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  height: 26px;
}
.sheet__top { top: 0; z-index: 3; }
.sheet__mid { top: 26px; z-index: 1; }
.sheet__bot { top: 52px; z-index: 2; }

.sheet__face {
  position: absolute;
  inset: 0;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(21, 22, 27, 0.08), 0 1px 1px rgba(21, 22, 27, 0.05), 0 6px 14px -4px rgba(21, 22, 27, 0.16);
}
.sheet__top .sheet__face { border-radius: 4px 4px 0 0; }
.sheet__bot .sheet__face { border-radius: 0 0 4px 4px; }
.sheet__mid .sheet__face { box-shadow: 0 0 0 1px rgba(21, 22, 27, 0.08), 0 6px 14px -4px rgba(21, 22, 27, 0.16); }
/* the shade a fold throws on the paper */
.sheet__face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(21, 22, 27, 0.16), rgba(21, 22, 27, 0.03));
  opacity: var(--shade, 0);
}
.sheet__back {
  opacity: 0;
  background: linear-gradient(180deg, #f7f8fa, var(--paper-back));
}
/* the crease lines on the paper */
.sheet__mid .sheet__front::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: rgba(21, 22, 27, 0.05);
}

.sheet__name, .sheet__role, .sheet__rule, .sheet__head, .sheet__line {
  position: absolute;
  left: 8px;
  height: 2px;
  border-radius: 2px;
}
.sheet__name { top: 8px; width: 24px; height: 3px; background: var(--ink); }
.sheet__role { top: 14px; width: 16px; background: var(--accent); opacity: 0.8; }
.sheet__rule { top: 21px; right: 8px; height: 1px; background: rgba(21, 22, 27, 0.08); }
.sheet__head { top: 6px; width: 14px; background: rgba(21, 22, 27, 0.55); }
.sheet__line { top: 12px; right: 8px; background: rgba(21, 22, 27, 0.13); }
.sheet__line--short { top: 17px; right: 20px; }
.sheet__line--mid { top: 17px; right: 14px; }

/* the envelope, drawn in lines */
.env__body, .env__flap {
  position: absolute;
  left: 0;
  top: 0;
  width: 76px;
  height: 52px;
  overflow: visible;
  visibility: hidden;
}
.env__body { z-index: 3; }
.env__flap { z-index: 1; }
.env__flap.is-front { z-index: 4; }
.env__paper { fill: #ffffff; }
.env__line, .env__flap path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.env__flap path { fill: #ffffff; }
.env__line--thin { stroke-width: 1.1; opacity: 0.55; }

/* the thread of light the envelope leaves as it goes */
.trail {
  position: absolute;
  left: 0;
  top: 0;
  width: 130px;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(79, 107, 255, 0), var(--accent) 70%, #ffffff);
  box-shadow: 0 0 10px 1px rgba(79, 107, 255, 0.5), 0 0 2px rgba(79, 107, 255, 0.8);
  visibility: hidden;
}

/* ---- the row: the CV card and the button ---- */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file {
  position: relative;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 0 10px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(21, 22, 27, 0.05), 0 8px 20px -10px rgba(21, 22, 27, 0.18);
}
.file__ic {
  position: relative;
  width: 38px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f6f7fa, #eef0f4);
  box-shadow: inset 0 0 0 1px rgba(21, 22, 27, 0.05);
  display: grid;
  place-items: center;
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.file__sheet, .file__empty {
  grid-area: 1 / 1;
  width: 20px;
  height: 24px;
  overflow: visible;
}
.file__sheet path {
  fill: #ffffff;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.file__sheet .file__corner { fill: none; }
.file__sheet .file__lines { stroke: var(--accent); stroke-linecap: round; fill: none; }
.file__empty path {
  fill: none;
  stroke: rgba(21, 22, 27, 0.28);
  stroke-width: 1.3;
  stroke-dasharray: 2.4 2.6;
}
.file__empty { opacity: 0; }

.file__txt { display: grid; gap: 3px; }
.file__name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.file__meta {
  display: block;
  height: 16px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.file__metain { display: block; white-space: nowrap; }

/* ---- the button ---- */
.send {
  position: relative;
  height: 60px;
  border: 0;
  border-radius: 30px;
  padding: 0;
  background: none;
  color: var(--btn-ink);
  font: inherit;
  cursor: pointer;
  outline: none;
}
.send__floor {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 1px 1px rgba(14, 15, 19, 0.2), 0 6px 12px -4px rgba(14, 15, 19, 0.3), 0 16px 30px -12px rgba(14, 15, 19, 0.4);
}
.send__clip {
  position: relative;
  display: block;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom));
}
.send__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  pointer-events: none;
}
.send:focus-visible .send__edge { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 3px #ffffff, 0 0 0 5px var(--accent); }
.send__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 70px;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  opacity: 0;
}
.send__label {
  position: relative;
  display: grid;
  height: 100%;
  padding: 0 28px;
}
.send__state {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  white-space: nowrap;
}
.send__word {
  font-size: 15.5px;
  font-weight: 600;
  font-stretch: 104%;
  letter-spacing: -0.01em;
  transition: font-stretch 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.send__arrow, .send__check {
  width: 18px;
  height: 18px;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.send__arrow { stroke: currentColor; stroke-width: 1.8; }
.send__check { width: 20px; height: 20px; }
.send__check circle { stroke: rgba(255, 255, 255, 0.22); stroke-width: 1.6; }
.send__check path { stroke: #9fb0ff; stroke-width: 2; }
.send__busy, .send__done { opacity: 0; visibility: hidden; }

/* the thin light that runs along the bottom while it sends */
.send__track {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 9px;
  height: 1px;
  overflow: hidden;
  border-radius: 1px;
}
.send__run {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, #9fb0ff, transparent);
  opacity: 0;
}

.note {
  margin-top: 14px;
  height: 18px;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
}
.note__in { display: block; white-space: nowrap; }

@media (hover: hover) {
  .wrap.is-hot .file__ic { transform: translateY(-1px); }
  .wrap.is-hot .send__word { font-stretch: 112%; }
}

/* the drawn pointer of the autopilot */
.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -4px;
  fill: #15161b;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
  pointer-events: none;
  visibility: hidden;
  z-index: 10;
}

/* on a narrow screen the CV card sits above the button */
@media (max-width: 440px) {
  .row { flex-direction: column; gap: 10px; }
  .wrap { padding-top: min(140px, 26vh); }
}
