/* ==========================================================================
   sly-the-fox.com — shared styles
   Palette: a fox at dusk. Deep plum ground, warm cream type, and one bright
   accent per area of the site.
   ========================================================================== */

:root{
  --night:#241a33;
  --night-deep:#170e21;
  --panel:#31234a;
  --cream:#fff4e4;
  --cream-soft:#e3d2d9;

  --fox:#f4772f;
  --gold:#ffc24b;
  --teal:#17a08f;
  --pink:#ff5d8f;
  --lime:#a9d94b;

  --accent:var(--gold);

  --display:"Fraunces",Georgia,"Iowan Old Style",serif;
  --body:"Rubik","Segoe UI",system-ui,sans-serif;
  --label:"Space Mono",ui-monospace,Consolas,monospace;

  --gutter:clamp(1.25rem,4vw,3rem);
}

/* One accent per area, set by the body class on each page. */
body.area-lair    { --accent:var(--gold); }
body.area-helpers { --accent:var(--teal); }
body.area-fun     { --accent:var(--pink); }
body.area-faves   { --accent:var(--lime); }

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
  margin:0;
  min-height:100vh;
  background-color:var(--night-deep);
  background:
    radial-gradient(60rem 40rem at 78% 12%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 65%),
    radial-gradient(50rem 36rem at 5% 90%, rgba(244,119,47,.14), transparent 60%),
    linear-gradient(178deg, var(--night) 0%, var(--night-deep) 100%);
  background-attachment:fixed;
  color:var(--cream);
  font-family:var(--body);
  font-size:clamp(1rem,.96rem + .2vw,1.09rem);
  line-height:1.65;
  display:flex;
  flex-direction:column;
}

.shell{width:100%;max-width:1080px;margin:0 auto;padding:0 var(--gutter)}

a{color:var(--accent)}
img{max-width:100%;height:auto;display:block}

/* --------------------------------------------------------------- masthead */

.masthead{padding:clamp(1.1rem,3vw,2rem) 0 .6rem}
.masthead .shell{display:flex;flex-wrap:wrap;align-items:center;gap:1rem 1.5rem}

.wordmark{
  font-family:var(--display);
  font-variation-settings:"SOFT" 100,"WONK" 1;
  font-weight:900;
  font-size:1.5rem;
  letter-spacing:-.02em;
  text-decoration:none;
  color:var(--cream);
  white-space:nowrap;
}
.wordmark .join{color:var(--fox)}
.wordmark:hover .join{color:var(--accent)}

/* ------------------------------------------------------- fingerpost nav --
   Four signs pointing off to the four dens. The pointed right edge is a
   clip-path, so the shape survives any label length.                       */

.posts{display:flex;flex-wrap:wrap;gap:.5rem;margin-left:auto}

.post{
  --sign:rgba(255,244,228,.09);
  position:relative;
  display:inline-block;
  padding:.5rem 1.9rem .5rem 1rem;
  font-family:var(--label);
  font-size:.74rem;
  letter-spacing:.11em;
  text-transform:uppercase;
  text-decoration:none;
  color:var(--cream);
  background:var(--sign);
  border:1px solid rgba(255,244,228,.16);
  clip-path:polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%);
  transform:rotate(-1deg);
  transition:transform .18s ease, background .18s ease, color .18s ease;
}
.post:nth-child(even){transform:rotate(1.2deg)}
.post:hover,.post:focus-visible{
  transform:rotate(0deg) translateX(3px);
  background:rgba(255,244,228,.18);
}
.post[aria-current="page"]{
  background:var(--accent);
  color:var(--night-deep);
  border-color:var(--accent);
  font-weight:700;
}

/* ------------------------------------------------------------------ hero */

.hero{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  align-items:center;
  gap:clamp(1rem,4vw,3rem);
  padding:clamp(1.5rem,5vw,3.5rem) 0 clamp(1rem,3vw,2rem);
}

.eyebrow{
  font-family:var(--label);
  font-size:.78rem;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--accent);
  margin:0 0 .9rem;
}

h1{
  font-family:var(--display);
  font-variation-settings:"SOFT" 100,"WONK" 1;
  font-weight:900;
  font-size:clamp(2.9rem,9vw,6rem);
  line-height:.92;
  letter-spacing:-.025em;
  margin:0;
  text-wrap:balance;
}
h1 .tint{color:var(--accent)}

.tagline{
  font-size:1.15rem;
  color:var(--cream-soft);
  max-width:34ch;
  margin:1.1rem 0 0;
}

/* The fox stands on a lopsided blob of his area's colour and overlaps it. */
.hero-fox{position:relative;display:flex;justify-content:center;align-items:flex-end}
.hero-fox::before{
  content:"";
  position:absolute;
  inset:12% -4% 4% -4%;
  background:var(--accent);
  opacity:.17;
  border-radius:46% 54% 62% 38% / 48% 42% 58% 52%;
  transform:rotate(-6deg);
}
.hero-fox img{
  position:relative;
  width:clamp(200px,30vw,360px);
  filter:drop-shadow(0 18px 26px rgba(0,0,0,.45));
  animation:bob 5.5s ease-in-out infinite alternate;
}
@keyframes bob{from{transform:translateY(0)}to{transform:translateY(-11px)}}

/* --------------------------------------------------------------- content */

.explain{
  padding:clamp(1rem,3vw,2rem) 0 clamp(1.5rem,4vw,2.5rem);
  max-width:62ch;
}
.explain h2{
  font-family:var(--display);
  font-variation-settings:"SOFT" 100,"WONK" 1;
  font-weight:900;
  font-size:clamp(1.5rem,3.4vw,2.1rem);
  line-height:1.1;
  margin:2rem 0 .6rem;
}
.explain h2:first-child{margin-top:0}
.explain h3{
  font-family:var(--display);
  font-weight:700;
  font-size:1.2rem;
  margin:1.6rem 0 .4rem;
}
.explain p{margin:0 0 1rem;color:var(--cream-soft)}
.explain ul,.explain ol{color:var(--cream-soft);padding-left:1.3rem}
.explain li{margin:.3rem 0}
.explain a{text-decoration-thickness:2px;text-underline-offset:3px}

.section-label{
  font-family:var(--label);
  font-size:.74rem;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--cream-soft);
  display:flex;
  align-items:center;
  gap:.9rem;
  margin:0 0 1.1rem;
}
.section-label::after{
  content:"";
  flex:1;
  height:1px;
  background:linear-gradient(90deg, rgba(255,244,228,.35), transparent);
}

/* ----------------------------------------------------------------- tiles */

.tiles{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:1.1rem;
  padding-bottom:clamp(2rem,6vw,4rem);
  list-style:none;
  margin:0;
}

/* A single tile shouldn't stretch the full width of the page. */
.tiles.single{grid-template-columns:minmax(240px,26rem)}

.tile{
  --tile:var(--accent);
  position:relative;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  gap:.4rem;
  height:100%;
  padding:1.5rem 1.6rem 1.6rem;
  background:var(--tile);
  color:var(--night-deep);
  text-decoration:none;
  /* Lopsided corners: every tile is cut a little differently. */
  border-radius:34px 12px 30px 14px / 22px 34px 18px 28px;
  transform:rotate(-1.1deg);
  box-shadow:0 11px 0 -2px rgba(0,0,0,.42);
  box-shadow:0 11px 0 -2px color-mix(in srgb, var(--tile) 42%, var(--night-deep));
  transition:transform .22s ease, box-shadow .22s ease, border-radius .22s ease;
}

/* A paw print pressed into the corner. */
.tile::after{
  content:"";
  position:absolute;
  right:-14px;
  bottom:-12px;
  width:104px;
  height:104px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23170e21' fill-opacity='0.13'%3E%3Cellipse cx='32' cy='44' rx='16' ry='13'/%3E%3Cellipse cx='12' cy='27' rx='7' ry='9'/%3E%3Cellipse cx='26' cy='17' rx='7' ry='10'/%3E%3Cellipse cx='43' cy='19' rx='7' ry='10'/%3E%3Cellipse cx='55' cy='32' rx='6.5' ry='8.5'/%3E%3C/g%3E%3C/svg%3E") no-repeat center/contain;
  pointer-events:none;
}

.tiles li:nth-child(2) .tile{
  border-radius:14px 32px 12px 30px / 30px 18px 32px 20px;
  transform:rotate(1.4deg);
}
.tiles li:nth-child(3) .tile{
  border-radius:28px 16px 34px 10px / 34px 22px 20px 30px;
  transform:rotate(-.6deg);
}
.tiles li:nth-child(4) .tile{
  border-radius:12px 30px 16px 32px / 20px 30px 34px 18px;
  transform:rotate(1deg);
}

.tile:hover,.tile:focus-visible{
  transform:rotate(0) translateY(-6px);
  border-radius:22px;
  box-shadow:0 20px 0 -2px rgba(0,0,0,.5);
  box-shadow:0 20px 0 -2px color-mix(in srgb, var(--tile) 30%, var(--night-deep));
}

/* Colour carries the wayfinding: a tile wears the colour of where it leads. */
.tile.to-lair{--tile:var(--gold)}
.tile.to-helpers{--tile:var(--teal)}
.tile.to-games{--tile:var(--pink)}
.tile.to-faves{--tile:var(--lime)}

.tile-name{
  position:relative;
  font-family:var(--display);
  font-variation-settings:"SOFT" 100,"WONK" 1;
  font-weight:900;
  font-size:1.5rem;
  line-height:1.08;
  letter-spacing:-.015em;
}
.tile-note{position:relative;font-size:.97rem;line-height:1.5;color:rgba(23,14,33,.8)}
.tile-go{
  position:relative;
  margin-top:auto;
  padding-top:.8rem;
  font-family:var(--label);
  font-size:.7rem;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:rgba(23,14,33,.62);
}
.tile-go::after{content:"\2192";margin-left:.3rem;transition:margin .2s ease}
.tile:hover .tile-go::after{margin-left:.6rem}

/* Quieter tile, for pointing back rather than onward. */
.tile.ghost{
  background:transparent;
  color:var(--cream);
  border:2px dashed rgba(255,244,228,.32);
  box-shadow:none;
}
.tile.ghost::after{filter:invert(1);opacity:.45}
.tile.ghost .tile-note{color:var(--cream-soft)}
.tile.ghost .tile-go{color:var(--accent)}
.tile.ghost:hover,.tile.ghost:focus-visible{box-shadow:none;border-color:var(--accent)}

/* ------------------------------------------------------------ favourites --
   One entry per person. Deliberately plainer than the tiles: these are
   things to read rather than places to go, so they get a quiet card and
   let the links do the pointing.                                          */

.faves{
  display:grid;
  gap:1.1rem;
  padding-bottom:clamp(1.5rem,4vw,2.5rem);
  list-style:none;
  margin:0;
}

.fave{
  position:relative;
  padding:1.3rem 1.5rem 1.4rem;
  background:rgba(255,244,228,.04);
  border:1px solid rgba(255,244,228,.14);
  border-left:4px solid var(--accent);
  border-radius:6px 20px 8px 18px / 16px 8px 20px 10px;
}

.fave-cat{
  font-family:var(--label);
  font-size:.68rem;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--accent);
  margin:0 0 .35rem;
}

.fave-name{
  font-family:var(--display);
  font-variation-settings:"SOFT" 100,"WONK" 1;
  font-weight:900;
  font-size:1.45rem;
  line-height:1.1;
  letter-spacing:-.015em;
  margin:0;
  color:var(--cream);
}

.fave-who{
  font-family:var(--label);
  font-size:.72rem;
  letter-spacing:.05em;
  color:var(--cream-soft);
  opacity:.75;
  margin:.15rem 0 0;
}

.fave-why{margin:.7rem 0 0;color:var(--cream-soft);max-width:56ch}

.fave-links{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0 0}
.fave-links a{
  font-family:var(--label);
  font-size:.68rem;
  letter-spacing:.11em;
  text-transform:uppercase;
  text-decoration:none;
  color:var(--cream);
  padding:.4rem .8rem;
  border:1px solid rgba(255,244,228,.24);
  border-radius:4px;
  transition:background .18s ease, border-color .18s ease, color .18s ease;
}
.fave-links a:hover,.fave-links a:focus-visible{
  background:var(--accent);
  border-color:var(--accent);
  color:var(--night-deep);
}
/* Off-site links wear a small mark, so it is clear you are leaving. */
.fave-links a[rel~="external"]::after{content:"\2197";margin-left:.4rem;opacity:.7}

/* ---------------------------------------------------------------- footer */

footer{
  margin-top:auto;
  padding:1.6rem 0 2.2rem;
  border-top:1px solid rgba(255,244,228,.12);
  font-family:var(--label);
  font-size:.74rem;
  letter-spacing:.06em;
  color:var(--cream-soft);
}
footer .shell{display:flex;flex-wrap:wrap;gap:.6rem 1.4rem;align-items:baseline}
footer p{margin:0}
footer .paw{color:var(--fox)}

/* ------------------------------------------------------------- behaviour */

:focus-visible{outline:3px solid var(--accent);outline-offset:3px;border-radius:3px}

@media (max-width:760px){
  .hero{grid-template-columns:1fr;text-align:left}
  .hero-fox{order:-1;justify-content:flex-start}
  .hero-fox img{width:min(56vw,240px)}
  .posts{margin-left:0}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{animation:none !important;transition:none !important}
}
