/* ==========================================================================
   SAMLAR — samlar.net
   Hand-painted folk-art look. Plain CSS, no build step.
   Motion lives in alive.css.
   ========================================================================== */

:root {
  /* Palette */
  --sky:        #1d52ba;
  --sky-deep:   #153e9e;
  --sky-light:  #3272d6;
  --cream:      #fcf5e3;
  --paper:      #fefaf0;
  --paper-deep: #f8f0dc;
  --ink:        #16130f;
  --orange:     #ee7d2b;
  --rust:       #b5562a;
  --rust-deep:  #8c3d1f;

  /* Type */
  --font-name:  "Nothing You Could Do", "Segoe Script", "Bradley Hand", cursive;   /* signatures */
  --font-hand:  "Patrick Hand", "Comic Sans MS", "Segoe Print", cursive;           /* links, cat names */
  --font-quiet: "Quicksand", "Trebuchet MS", "Segoe UI", sans-serif;               /* title, bios, footer */

  /* How tall the strip of ground under the cats is: the cats' name row plus the footer */
  --caption-h: 2.6rem;
  --footer-h:  5rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

/* Everything is sized in rem, so this one number scales the whole page.
   75% matches "browser zoomed out to 75%" on a desktop screen. */
html {
  -webkit-text-size-adjust: 100%;
  font-size: 75%;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--cream);
  font-family: var(--font-hand);
  font-size: 1.25rem;
  line-height: 1.35;
  /* A smooth evening sky: light pooling at the top, deepening toward the ground.
     Clean colour only, no grain or texture. */
  background-color: var(--sky);
  background-image:
    radial-gradient(ellipse 120% 55% at 50% 0%, rgba(110, 175, 255, .5), transparent 70%),
    linear-gradient(var(--sky-light), var(--sky) 40%, var(--sky-deep));
}

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

.svg-defs { position: absolute; }

/* --------------------------------------------------------------------------
   Sky doodles: a few hand-drawn stars and curls scattered behind everything
   -------------------------------------------------------------------------- */

.sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.doodle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s, 2rem);
  height: var(--s, 2rem);
  fill: none;
  stroke: #dcebff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .55;
  rotate: var(--r, 0deg);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.page {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: min(100% - 2rem, 68rem);
  margin-inline: auto;
  padding-top: clamp(1rem, 3vh, 1.75rem);
}

/* The site name is a quiet label, not a headline */
.site-title {
  margin: 0;
  text-align: center;
  font-family: var(--font-quiet);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .7em;
  margin-right: -.7em; /* cancel the trailing letter-space so it centres */
  text-transform: uppercase;
  color: #dcebff;
  opacity: .6;
}

/* --------------------------------------------------------------------------
   The two paper signs
   -------------------------------------------------------------------------- */

.people {
  --peek: clamp(6.5rem, 5rem + 7vw, 9rem);   /* room above each sign for the character */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: clamp(.6rem, 2vw, 1.75rem);
  margin-block: auto;          /* centres the pair in the space between title and ground */
  padding-block: .5rem;
}

.card {
  position: relative;
  isolation: isolate;
  margin-top: var(--peek);
  padding: clamp(1.4rem, 1rem + 2vw, 2.25rem);
  padding-right: clamp(5.5rem, 22%, 9rem);   /* keeps text clear of the decoration */
  color: var(--ink);
}
.card--samantha { rotate: -.8deg; }
.card--larry    { rotate: .9deg; }

/* The sheet of paper. It lives on a pseudo-element so the wobble filter
   roughs up its inked edge without blurring the text on top of it. */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  border: 4px solid var(--ink);
  border-radius: 26px 34px 28px 38px / 34px 26px 38px 28px;
  background: linear-gradient(170deg, var(--paper), var(--paper-deep));
  box-shadow: 7px 9px 0 rgba(9, 24, 86, .4);
  filter: url(#wobble);
}

.card__peeker {
  --peeker-w: clamp(12.5rem, 62%, 17rem);
  position: absolute;
  bottom: 100%;
  width: var(--peeker-w);
  /* The art's hands sit in its bottom 9%, so sink that much over the paper's edge.
     (A margin, not a transform: a transform would trap the figure in its own
     layer and stop it from tucking behind the sign.) */
  margin-bottom: calc(var(--peeker-w) * -0.0534);
}
.card--samantha .card__peeker { left: 14%; }
.card--larry    .card__peeker { right: 14%; }

.card__deco {
  position: absolute;
  z-index: -1;
  right: clamp(.9rem, 4%, 1.8rem);
  bottom: 8%;
  width: clamp(3.75rem, 18%, 7.5rem);   /* sized by width so it always fits the right padding */
  height: auto;
  pointer-events: none;
}

.card__name {
  position: relative;
  display: inline-block;
  margin: .4rem 0 1.1rem;
  font-family: var(--font-name);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.6rem + 3.4vw, 4.25rem);
  line-height: 1.15;
  color: var(--ink);
  transform: rotate(-3deg);
  transform-origin: left bottom;
}

/* Hand-drawn swoosh under the name */
.card__name::after {
  content: "";
  position: absolute;
  left: 4%;
  right: -6%;
  bottom: -.3em;
  height: .26em;
  background: url("../img/swoosh-orange.svg") center / 100% 100% no-repeat;
}

/* The bio is a quiet aside; the links are the point */
.card__bio {
  margin: 0 0 .9rem;
  max-width: 36ch;
  font-family: var(--font-quiet);
  font-weight: 500;
  font-size: 1.12rem;
  line-height: 1.5;
  color: rgba(22, 19, 15, .72);
}

/* --------------------------------------------------------------------------
   The + between the two of us
   -------------------------------------------------------------------------- */

.plus {
  align-self: center;
  margin-top: var(--peek);
  width: clamp(2.4rem, 4.5vw, 3.6rem);
  height: auto;
  overflow: visible;
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .1rem;
  justify-items: start;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  min-height: 2.75rem;            /* comfortable tap target */
  padding: .2rem .5rem .2rem .25rem;
  margin-left: -.25rem;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(1.35rem, 1.2rem + .6vw, 1.65rem);
  letter-spacing: .05em;
  border-radius: 12px;
  transition: transform .2s ease, color .2s ease;
}

.links a span {
  padding-bottom: .05em;
  background: url("../img/underline.svg") left bottom / 100% .32em no-repeat;
}

.links a:hover { color: #a8430f; transform: translateX(4px) rotate(-1deg); }

.links a:focus-visible {
  outline: 3px dashed var(--ink);
  outline-offset: 2px;
}

.icon {
  flex: none;
  width: 1.7em;
  height: 1.7em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   The yard: cats sitting on a strip of warm ground, footer underneath
   -------------------------------------------------------------------------- */

.yard {
  position: relative;
  z-index: 1;
  flex: none;
  margin-top: clamp(1.75rem, 5vh, 3.5rem);
}

/* The ground. Its hand-drawn top edge sits just above the cats' feet. */
.yard::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* The ink line inside ground-edge.svg wanders between 12px and 28px from its
     top. 28px keeps even the deepest dip at the cats' feet; the extra .7rem
     tucks their feet into the grass. */
  height: calc(var(--caption-h) + var(--footer-h) + .7rem + 28px);
  background:
    url("../img/ground-edge.svg") left top / 480px 40px repeat-x,
    linear-gradient(transparent 39px, var(--rust) 39px, var(--rust-deep));
}

.cats {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(.5rem, 5vw, 4.5rem);
  width: min(100% - 2rem, 68rem);
  margin-inline: auto;
}

.cat {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}

.cat figcaption {
  height: var(--caption-h);
  padding-top: .4rem;
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
  letter-spacing: .1em;
  line-height: 1.1;
  text-shadow: 0 2px 0 rgba(70, 25, 8, .5);
}

.site-footer {
  position: relative;
  height: var(--footer-h);
  display: grid;
  place-items: end center;      /* sits low, leaving air under the cats' names */
  padding: 0 1rem 1.3rem;
  text-align: center;
  font-family: var(--font-quiet);
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .04em;
  color: rgba(246, 231, 193, .8);
}
.site-footer p { margin: 0; }

/* --------------------------------------------------------------------------
   Small screens: stack the signs
   -------------------------------------------------------------------------- */

@media (max-width: 47.5rem) {
  html { font-size: 87.5%; }   /* phones keep things a little bigger for thumbs */

  .people {
    grid-template-columns: minmax(0, 30rem);
    justify-content: center;
    gap: 1.25rem;
    padding-top: 1.5rem;
  }
  .card__bio { max-width: none; font-size: 1rem; }
  .site-footer { font-size: .8rem; }

  /* The + tucks into the gap beside Larry, between the two signs */
  .plus {
    justify-self: start;
    width: 2.6rem;
    height: 2.6rem;
    margin: 0 0 -2.6rem 6%;     /* takes up no room of its own */
    position: relative;
    top: calc(1.25rem + var(--peek) / 2 - 1.3rem);
  }
}

@media (max-width: 23rem) {
  .card { padding-right: 4.25rem; }
  .card__deco { width: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
