/* Odd Sock Games. Colours are taken from the logo. */
@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito-400-1000.woff2") format("woff2");
  font-weight: 400 1000;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("fonts/caveat-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --navy: #0e1c4e;
  --yellow: #fbb81b;
  --sky: #54c2ff;
  --cream: #fbf4e6;
  --paper: #fffdf8;
  --sock: #5b96e4;
  --coral: #ef636c;
  --wobble: 18px 30px 20px 34px / 30px 18px 34px 20px;
  --wobble-2: 34px 18px 30px 20px / 20px 32px 18px 30px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font: 500 18px/1.6 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:focus-visible, [tabindex]:focus-visible { outline: 4px solid var(--coral); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-weight: 1000; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0 0 14px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.scribble { font: 700 1.5em/1.15 "Caveat", "Segoe Print", cursive; }

/* The rope everything hangs from */
.rope {
  position: absolute;
  height: 14px;
  background: url("img/rope.svg") repeat-x left center / 120px 14px;
}
.peg::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -16px;
  left: 50%;
  width: 14px;
  height: 25px;
  margin-left: -7px;
  background: var(--yellow);
  border: 3px solid var(--navy);
  border-radius: 6px 6px 4px 4px;
}

/* Header */
.top { position: relative; background: var(--sky); padding: 0 var(--gutter); }
.top > .rope { top: 12px; left: 0; right: 0; }
.top-inner {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 0 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 20px;
}
.brand { display: block; width: 190px; }
.top--home .top-inner { justify-content: center; }
.tags { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; }
.tags a {
  position: relative;
  display: block;
  padding: 14px 14px 7px;
  background: var(--paper);
  border: 3px solid var(--navy);
  border-radius: var(--wobble);
  box-shadow: 3px 4px 0 var(--navy);
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transform-origin: 50% 0;
  transition: transform .15s;
}
.tags li:nth-child(1) a { transform: rotate(-2deg); }
.tags li:nth-child(2) a { transform: rotate(1.5deg); }
.tags li:nth-child(3) a { transform: rotate(-1deg); }
.tags a:hover { transform: rotate(4deg); }
.tags a[aria-current] { background: var(--yellow); }

/* Sky to cream */
.wave {
  height: 40px;
  margin-top: -1px;
  background:
    url("img/wave.svg") repeat-x center bottom / 600px 40px,
    linear-gradient(transparent calc(100% - 4px), var(--cream) 0),
    var(--sky);
}

/* Hero */
.hero { position: relative; background: var(--sky); overflow: clip; }
.cloud { position: absolute; width: clamp(110px, 18vw, 230px); }
.cloud--a { top: 5%; left: -3%; }
.cloud--b { top: 40%; right: -4%; transform: scaleX(-1); }
.hero-logo { position: relative; width: min(100%, 680px); margin: 0 auto; padding: 18px 0 30px; }
.hero-logo h1 { font-size: 1em; }

/* Mascot says hello */
.hello {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  max-width: 860px;
  margin: 18px auto 0;
}
.hello img { flex: none; width: clamp(92px, 22vw, 190px); transform: scaleX(-1) rotate(-4deg); }
.bubble {
  position: relative;
  margin: 0;
  padding: clamp(14px, 3vw, 26px) clamp(16px, 3.4vw, 32px);
  background: var(--paper);
  border: 4px solid var(--navy);
  border-radius: var(--wobble-2);
  box-shadow: 5px 6px 0 var(--navy);
  font-size: clamp(19px, 3vw, 29px);
  font-weight: 900;
  line-height: 1.25;
}
.bubble::before {
  content: "";
  position: absolute;
  top: 42%;
  left: -17px;
  width: 26px;
  height: 26px;
  background: var(--paper);
  border-left: 4px solid var(--navy);
  border-bottom: 4px solid var(--navy);
  transform: rotate(38deg) skew(12deg);
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 14px; margin-top: 20px; }
.btn, .soon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60px;
  padding: 8px 20px;
  border-radius: var(--wobble);
  line-height: 1.15;
  text-decoration: none;
}
.btn {
  background: var(--paper);
  border: 4px solid var(--navy);
  box-shadow: 4px 5px 0 var(--navy);
  font-size: 21px;
  font-weight: 1000;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(2px, 3px); box-shadow: 2px 2px 0 var(--navy); }
.soon { border: 4px dashed var(--navy); cursor: default; }
.soon small { font-size: 15px; font-weight: 800; }
.soon b { font-size: 21px; font-weight: 1000; }

/* Featured game on the home page */
.feature {
  display: grid;
  gap: clamp(22px, 4vw, 44px);
  align-items: center;
  margin: clamp(44px, 7vw, 76px) 0;
  padding: clamp(18px, 3.5vw, 38px);
  background: var(--yellow);
  border: 4px solid var(--navy);
  border-radius: var(--wobble);
  box-shadow: 8px 9px 0 var(--navy);
}
.feature h2 { font-size: clamp(38px, 6vw, 60px); margin: 2px 0 10px; }
.feature .scribble { margin: 0; }
.snap { display: block; border: 4px solid var(--navy); border-radius: var(--wobble-2); overflow: hidden; background: var(--paper); }
.hung { position: relative; transform: rotate(-1.5deg); transform-origin: 50% 0; }

.all-games { margin-top: 22px; font-weight: 900; }

/* Games page */
.page-title { font-size: clamp(38px, 6vw, 60px); padding-top: 14px; }
.games-wrap { position: relative; overflow: clip; margin-top: 18px; padding-bottom: 10px; }
.games-wrap > .rope { top: 16px; left: 0; right: 0; }
.games {
  position: relative;
  display: grid;
  gap: 34px;
  margin-block: 0;
  padding-block: 40px 10px;
  list-style: none;
}
.game {
  position: relative;
  padding: 18px;
  background: var(--yellow);
  border: 4px solid var(--navy);
  border-radius: var(--wobble);
  box-shadow: 6px 7px 0 var(--navy);
}
.game h2 { font-size: clamp(30px, 4.6vw, 42px); margin: 16px 0 8px; }
.game .fine { margin: 16px 0 2px; font-weight: 800; }
.slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 240px;
  padding: 24px;
  border: 4px dashed var(--navy);
  border-radius: var(--wobble-2);
  text-align: center;
}
.slot.peg::before { display: none; }
.slot img { width: 80px; transform: rotate(8deg); }
.slot .scribble { margin: 0; max-width: 300px; }

/* Contact page */
.say-hi { font-size: clamp(30px, 5vw, 46px); margin-bottom: 6px; }
.mailbox {
  margin: clamp(30px, 5vw, 48px) 0;
  padding: clamp(18px, 3.5vw, 34px);
  background: var(--yellow);
  border: 4px solid var(--navy);
  border-radius: var(--wobble);
  box-shadow: 8px 9px 0 var(--navy);
  text-align: center;
}
.mailbox .scribble { margin: 0; }
.address { margin: 4px 0 0; font-size: clamp(21px, 5.2vw, 44px); font-weight: 1000; line-height: 1.2; overflow-wrap: anywhere; }
.mailbox .actions { justify-content: center; }
button.btn { color: inherit; font-family: inherit; cursor: pointer; align-items: center; }
button.btn[hidden] { display: none; }
.notes .card h2 { font-size: 25px; margin-bottom: 10px; }

.crumb { max-width: 760px; margin: 18px auto -8px; font-weight: 800; }

/* Mr. Swing page */
.game-hero { position: relative; background: var(--sky); overflow: clip; padding: 14px 0 26px; }
.game-hero .wrap { position: relative; display: grid; gap: 30px; align-items: center; }
.game-title {
  font-size: clamp(56px, 11vw, 104px);
  color: var(--yellow);
  -webkit-text-stroke: 10px var(--navy);
  paint-order: stroke fill;
  letter-spacing: .01em;
  transform: rotate(-2deg);
  transform-origin: 0 100%;
}
.tagline { margin: 14px 0 0; font-size: clamp(22px, 3.4vw, 30px); font-weight: 900; line-height: 1.2; }
.game-hero .cloud--a { top: auto; left: auto; bottom: 4%; right: -3%; }
.section { padding-top: clamp(36px, 6vw, 64px); }
.section h2 { font-size: clamp(30px, 4.6vw, 44px); margin-bottom: 12px; }
.two-up { display: grid; gap: 22px 56px; padding-top: 14px; }
.two-up h2 { font-size: clamp(30px, 4.6vw, 44px); margin-bottom: 12px; }
.socks { list-style: none; margin: 0; padding: 0; }
.socks li {
  min-height: 40px;
  margin-bottom: 12px;
  padding-left: 44px;
  background: url("img/sock-a.svg") no-repeat left 2px / 30px 36px;
}
.socks li:nth-child(even) { background-image: url("img/sock-b.svg"); }

/* Screenshots on the washing line */
.line-wrap { overflow: clip; padding-top: 6px; }
.line {
  --gap: 26px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(82vw, 340px);
  gap: var(--gap);
  margin: 0;
  padding: 18px var(--gutter) 22px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding: 0 var(--gutter);
  /* One rope that scrolls with the pictures */
  background: url("img/rope.svg") repeat-x left 26px / 120px 14px local;
}
.line li { position: relative; scroll-snap-align: start; }
.line li > .rope { display: none; }
.line figure {
  position: relative;
  margin: 18px 0 0;
  padding: 8px 8px 4px;
  background: var(--paper);
  border: 4px solid var(--navy);
  border-radius: 10px 14px 12px 16px / 14px 10px 16px 12px;
  box-shadow: 4px 5px 0 var(--navy);
  transform-origin: 50% -10px;
}
.line li:nth-child(4n+1) figure { transform: rotate(-1.2deg); }
.line li:nth-child(4n+2) figure { transform: rotate(.9deg); }
.line li:nth-child(4n+3) figure { transform: rotate(-.6deg); }
.line li:nth-child(4n) figure { transform: rotate(1.3deg); }
.line img { width: 100%; border-radius: 4px; }
.line figcaption { padding: 6px 4px 2px; font: 700 23px/1.1 "Caveat", "Segoe Print", cursive; }
.swipe { margin: 0; padding: 0 var(--gutter); }

/* Three cards */
.trio { display: grid; gap: 26px; }
.card {
  padding: 22px 24px 12px;
  border: 4px solid var(--navy);
  border-radius: var(--wobble);
  box-shadow: 5px 6px 0 var(--navy);
}
.card h3 { font-size: 25px; margin-bottom: 10px; }
.card--sky { background: var(--sky); }
.card--paper { background: var(--paper); border-radius: var(--wobble-2); }
.card--yellow { background: var(--yellow); }
.fine { font-size: 16px; margin-top: 22px; }

/* Reading pages */
.policy {
  max-width: 760px;
  margin: 26px auto 60px;
  padding: clamp(22px, 5vw, 48px);
  background: var(--paper);
  border: 4px solid var(--navy);
  border-radius: var(--wobble);
  box-shadow: 6px 7px 0 var(--navy);
  overflow-wrap: anywhere;
}
.policy h1 { font-size: clamp(30px, 5vw, 42px); margin-bottom: 8px; }
.policy h2 { font-size: 22px; margin: 30px 0 8px; }
.policy ul { margin: 0 0 14px; padding-left: 24px; }
.policy li { margin-bottom: 6px; }
.meta { font-weight: 700; }

.lost { max-width: 620px; margin: 30px auto 70px; text-align: center; }
.lost img { width: 150px; margin: 0 auto 18px; transform: rotate(6deg); }
.lost h1 { font-size: clamp(30px, 5vw, 42px); margin-bottom: 10px; }

/* Footer */
.stripes {
  height: 30px;
  margin-top: clamp(50px, 8vw, 84px);
  border-top: 4px solid var(--navy);
  background: repeating-linear-gradient(90deg, var(--sock) 0 34px, var(--cream) 34px 68px);
}
.policy-page .stripes { margin-top: 0; }
.foot { background: var(--navy); color: var(--cream); padding: 30px 0 34px; }
.foot h2 { font: 700 34px/1.1 "Caveat", "Segoe Print", cursive; color: var(--yellow); margin-bottom: 4px; }
.foot p { margin-bottom: 10px; }
.foot .mail { color: var(--yellow); font-weight: 900; overflow-wrap: anywhere; }
.foot small { display: block; font-size: 15px; margin-top: 14px; }
.foot a:focus-visible { outline-color: var(--yellow); }

/* Tablet and up */
@media (min-width: 760px) {
  .tags { gap: 14px; }
  .tags a { padding-inline: 18px; }
  .hello img { transform: scaleX(-1) rotate(-6deg); }
  .feature { grid-template-columns: 1.15fr 1fr; }
  .game-hero .wrap { grid-template-columns: 1fr 1.1fr; }
  .two-up { grid-template-columns: 1fr 1fr; }
  .trio { grid-template-columns: repeat(3, 1fr); }
  .games { grid-template-columns: 1fr 1fr; }
  .slot.peg::before { display: block; }
  .swipe { display: none; }
  .line {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(2, 1fr);
    row-gap: 30px;
    max-width: 1120px;
    margin: 0 auto;
    overflow: visible;
    background: none;
  }
  .line li:nth-child(odd) > .rope { display: block; top: 8px; left: -100vw; right: -100vw; }
}

/* Smallest phones */
@media (max-width: 374px) {
  .tags { gap: 6px; }
  .tags a { padding-inline: 10px; font-size: 16px; }
}

/* Each one swings when you point at it */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .line figure:hover, .hung:hover { animation: swing 1.1s ease-in-out; }
  @keyframes swing {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(2.4deg); }
    60% { transform: rotate(-1.6deg); }
    85% { transform: rotate(.6deg); }
  }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
