/* splash.css: the pearlheinley.com landing card (index.html).
   Colours and type follow Pearl's business card. The shell is already in
   place, its outline and band sewn (.sewn); the pearl and the rays are
   sewn by the needle (js/splash.js). The CSS timings here are only the
   no-script fallback. The info fades in over the first second. */

:root {
  --red: #d31c1c;
  --pink: #ff8383;
  --pink-text: #ff9797;
  --white: #fff;
}

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

html, body { height: 100%; }

body {
  background: var(--red);
  color: var(--white);
  font-family: Futura, "Futura PT", Jost, "Century Gothic", sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.splash {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 72px);
  padding: 40px 24px;
  font-size: clamp(15px, 1.55vw, 21px);
}

/* ---- Fabric ---- */

.fabric {
  width: clamp(200px, 27vw, 360px);
  height: auto;
  flex: none;
  overflow: visible;
}

.cloth { fill: var(--pink); }

/* Stitches: style sits on the groups (inherited), because the shine
   line re-draws the same paths with <use>. */
.stitches { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.thread {
  stroke: url(#twist);
  stroke-width: 2.4px;
  stroke-dasharray: 5.47;
}
.shine {
  stroke: #fff;
  stroke-width: .7px;
  stroke-dasharray: 3.4 7.54;    /* a shorter dash centred on each stitch */
  stroke-dashoffset: -1.03;
  opacity: .9;
}

/* The mask line that grows along each stitch; steps() lays it down
   one stitch at a time, like a machine. */
.sew {
  fill: none;
  stroke: var(--white);
  stroke-width: 8px;
  stroke-dasharray: 100 102;
  stroke-dashoffset: 101;
  animation: sew var(--d) var(--t) steps(var(--n), end) forwards;
}
.sew.sewn { animation: none; stroke-dashoffset: 0; }   /* already sewn at load */

/* The needle (placed by js/splash.js). Hidden until the sewing starts. */
.needle, .live-thread { opacity: 0; pointer-events: none; }
.knot { fill: url(#twist); filter: url(#raised); }
.knot-tail {
  fill: none;
  stroke: url(#twist);
  stroke-width: 2.4px;
  stroke-linecap: round;
  filter: url(#raised);
}
.cut-line {
  fill: none;
  stroke: #fff;
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-dasharray: 0 3.8;          /* dots */
  pointer-events: none;
}
.needle.on, .live-thread.on { opacity: 1; }
.live-thread {
  fill: none;
  stroke: url(#twist);
  stroke-width: 2.4px;
  stroke-linecap: round;
  filter: url(#raised);
}
.needle .steel { fill: url(#steel); stroke: #6d757e; stroke-width: .3px; }
.needle .eye { fill: var(--pink); }
.needle .tail {
  fill: none;
  stroke: #f4eee7;
  stroke-width: 1.5px;
  stroke-linecap: round;
}

@keyframes sew { to { stroke-dashoffset: 0; } }

/* ---- Info ---- */

.info > * {
  opacity: 0;
  animation: rise .9s ease-out forwards;
}
.info h1             { animation-delay: .2s; }
.info .role          { animation-delay: .35s; }
.info .contact       { animation: none; opacity: 1; }
.contact li          { opacity: 0; animation: rise .9s ease-out forwards; }
.contact li:nth-child(1) { animation-delay: .55s; }
.contact li:nth-child(2) { animation-delay: .65s; }
.contact li:nth-child(3) { animation-delay: .75s; }
.contact li:nth-child(4) { animation-delay: .85s; }
.info .links         { animation-delay: 1.1s; }

@keyframes rise {
  from { opacity: 0; transform: translateX(-.6em); }
  to   { opacity: 1; transform: none; }
}

.info h1 {
  font-size: 1.25em;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.2;
}

.role {
  color: var(--pink-text);
  margin-top: .2em;
  line-height: 1.3;
}

.contact {
  list-style: none;
  margin-top: 2.6em;
  display: grid;
  gap: .45em;
}

.contact a {
  display: inline-flex;
  align-items: center;
  gap: .8em;
  color: var(--white);
  text-decoration: none;
}

.contact svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex: none;
}

.info a:hover { color: var(--pink-text); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: .4em 1.6em;
  margin-top: 2em;
}

.links a {
  color: var(--white);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5em;
}
.links .lbl {
  border-bottom: 1.5px dashed currentColor;
  padding-bottom: .15em;
}
/* the small "PDF" tag after a link to a file */
.links .pdf {
  font-size: .58em;
  letter-spacing: .08em;
  line-height: 1;
  color: var(--pink-text);
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: .3em .4em .25em;
}

.info a:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

/* ---- Phone: fabric on top, info underneath ---- */

@media (max-width: 699px) {
  .splash {
    flex-direction: column;
    gap: 36px;
    font-size: 16px;
  }
  .fabric { width: min(62vw, 260px); }
}

/* ---- No motion: everything simply there ---- */

@media (prefers-reduced-motion: reduce) {
  .sew, .info > *, .contact li { animation: none; }
  .needle, .live-thread, .cut-line { display: none; }
  .sew { stroke-dashoffset: 0; }
  .info > *, .contact li { opacity: 1; }
}
