/* Digital Cowboy — site styles
   One neutral ramp, one accent. Product cards carry their own colours. */

@font-face {
  font-family: 'Archivo';
  src: url('../assets/fonts/archivo-var.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibm-plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #0e0d0c;
  --surface: #161513;
  --raised: #1f1d1a;
  --line: rgba(243, 239, 232, 0.1);
  --line-strong: rgba(243, 239, 232, 0.2);
  --text: #f3efe8;
  --text-2: #b3ada3;
  --text-3: #8c867c;
  --accent: #ff6a2b;

  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 4vw, 48px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ol, ul, figure, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

h1, h2, h3, .logo__name {
  font-stretch: 125%;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

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

.wrap {
  max-width: 1328px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 50;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
}
.skip:focus { top: 16px; }

/* Header */

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 80px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.logo__mark {
  width: 36px;
  height: 36px;
  fill: var(--accent);
}
.logo__name {
  font-size: 18px;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  gap: 4px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding-inline: 14px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 15px;
  transition: color 200ms var(--ease), background-color 200ms var(--ease);
}
.site-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding-inline: 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease), color 200ms var(--ease);
}
.btn .icon { transition: transform 200ms var(--ease); }
.btn:hover .icon { transform: translate(2px, -2px); }
.btn--primary:hover .icon { transform: translateY(2px); }

.btn--primary {
  background: var(--text);
  color: var(--bg);
}
.btn--primary:hover { background: #fff; }

/* Hero */

.hero {
  padding-block: clamp(48px, 9vw, 120px) clamp(56px, 7vw, 96px);
}

.hero__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 56px 80px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(40px, 6.3vw, 92px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero__lede {
  max-width: 32em;
  margin-top: clamp(24px, 3vw, 40px);
  color: var(--text-2);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.5;
}
.hero__text .btn { margin-top: 32px; }

/* The shelf: a home screen with our icons on it and room for more */

.shelf {
  padding: clamp(20px, 2.6vw, 36px);
  border: 1px solid var(--line);
  border-radius: 44px;
  background: var(--surface);
}
.shelf ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 32px) clamp(16px, 2vw, 28px);
}
.shelf li,
.shelf a {
  display: grid;
  justify-items: center;
  gap: 10px;
}
.shelf img,
.shelf i {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 23%;
}
.shelf img {
  box-shadow: 0 0 0 1px var(--line), 0 12px 24px rgba(0, 0, 0, 0.4);
  transition: transform 300ms var(--ease);
}
.shelf a:hover img { transform: translateY(-4px); }
.shelf i { border: 1px dashed var(--line-strong); }
.shelf span {
  min-height: 20px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  transition: color 200ms var(--ease);
}
.shelf a:hover span { color: var(--text); }
.shelf__empty span { color: var(--text-3); }
.shelf__empty:not(:has(span))::after {
  content: '';
  height: 20px;
}

/* Section heads */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
}
.section-head h2,
.studio h2 {
  font-size: clamp(28px, 3.2vw, 44px);
  letter-spacing: -0.03em;
}
.section-head p {
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 13px;
}

/* Work grid and cards */

.work__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.card {
  --c-bg: var(--surface);
  --c-fg: var(--text);
  --c-fg2: var(--text-2);
  --c-line: var(--line);
  --c-btn: var(--text);
  --c-btn-fg: var(--bg);
  --c-btn-hover: #fff;

  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--c-line);
  border-radius: 24px;
  background: var(--c-bg);
  color: var(--c-fg);
  scroll-margin-top: 24px;
}

.card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(24px, 3.2vw, 44px);
}

.card__tag {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--c-fg2);
}
.card__tag span + span::before {
  content: '/';
  margin-right: 8px;
  opacity: 0.5;
}
.card__tag span:first-child { color: var(--c-fg); }

.card h3 {
  margin-top: 20px;
  font-size: clamp(34px, 4vw, 56px);
  letter-spacing: -0.035em;
}

.card__lede {
  max-width: 34em;
  margin-top: 16px;
  color: var(--c-fg2);
}

.card__facts {
  align-self: stretch;
  margin-top: 24px;
  border-top: 1px solid var(--c-line);
  font-size: 15px;
}
.card__facts li {
  padding-block: 10px;
  border-bottom: 1px solid var(--c-line);
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.btn--card {
  background: var(--c-btn);
  color: var(--c-btn-fg);
}
.btn--card:hover { background: var(--c-btn-hover); }
.btn--ghost {
  border-color: var(--c-line);
  color: var(--c-fg);
}
.btn--ghost:hover { border-color: var(--c-fg); }

.card__visual { margin-top: auto; }

/* Vowel Thief */

.card--vowel {
  --c-bg: #14102b;
  --c-fg: #f6f1e4;
  --c-fg2: #b4adc6;
  --c-line: rgba(246, 241, 228, 0.12);
  --c-btn: #e8a832;
  --c-btn-fg: #1a1205;
  --c-btn-hover: #f4bb4e;
}

.card--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.vowels { margin-top: 28px; }
.vowels__phrase {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  /* Two words to a line, so the short last word never sits alone */
  max-width: 330px;
}
.vowels__word {
  display: flex;
  gap: 4px;
}
.tile {
  display: grid;
  place-items: center;
  width: 34px;
  height: 42px;
  border: 1px solid rgba(246, 241, 228, 0.18);
  border-radius: 8px;
  background: rgba(246, 241, 228, 0.05);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 18px;
}
.tile--gap {
  border-style: dashed;
  border-color: rgba(232, 168, 50, 0.55);
  background: transparent;
  color: #e8a832;
}
.tile--gap b {
  font-weight: 500;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
  transition-delay: calc(var(--i, 0) * 50ms);
}
.is-restored .tile--gap {
  border-style: solid;
  background: rgba(232, 168, 50, 0.12);
}
.is-restored .tile--gap b {
  opacity: 1;
  transform: none;
}
.vowels__btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: #e8a832;
  font-size: 15px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}
.vowels__btn:hover { color: #f4bb4e; }
/* Without scripts the button does nothing, so show the answer instead */
html:not(.js) .vowels__btn { display: none; }
html:not(.js) .tile--gap b { opacity: 1; transform: none; }

.phones {
  position: relative;
  align-self: stretch;
  min-height: 520px;
  margin-top: 0;
}
.phone {
  position: absolute;
  width: min(46%, 270px);
  padding: 6px;
  border: 1px solid rgba(246, 241, 228, 0.16);
  border-radius: 36px;
  background: #07060d;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}
.phone img { border-radius: 30px; }
.phone--back {
  top: 120px;
  right: 6%;
}
.phone--front {
  top: 48px;
  right: calc(6% + min(40%, 236px));
}

/* Blocksmith */

.card--blocksmith {
  --c-bg: #101231;
  --c-fg: #f4f3ff;
  --c-fg2: #b1b3d6;
  --c-line: rgba(244, 243, 255, 0.12);
  --c-btn: #ffc94d;
  --c-btn-fg: #1c1503;
  --c-btn-hover: #ffd772;
}
.card__visual--art img { width: 100%; }

/* Semble */

.card--semble {
  --c-bg: #f1ede4;
  --c-fg: #1c1915;
  --c-fg2: #5c554b;
  --c-line: rgba(28, 25, 21, 0.14);
  --c-btn: #1c1915;
  --c-btn-fg: #f6f3ec;
  --c-btn-hover: #3a352e;
  border-color: transparent;
}

.semble-stage {
  position: relative;
  flex: 1;
  min-height: 400px;
  overflow: hidden;
  background: #e5dfd2;
}
.sheet {
  position: absolute;
  left: 8%;
  top: 40px;
  width: 44%;
  transform: rotate(-4deg);
  box-shadow: 0 12px 28px rgba(28, 25, 21, 0.16);
}
.guide {
  position: absolute;
  right: 7%;
  top: 72px;
  width: 52%;
  overflow: hidden;
  border-radius: 14px;
  background: #fdfbf7;
  box-shadow: 0 16px 36px rgba(28, 25, 21, 0.2);
}
.guide figcaption {
  display: grid;
  gap: 4px;
  padding: 14px 16px 16px;
  color: #1c1915;
}
.guide__step {
  font-family: var(--mono);
  font-size: 12px;
  color: #5c554b;
}
.guide__title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

/* Next up */

.next {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 16px 48px;
  padding: 28px clamp(24px, 3.2vw, 44px);
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
}
.next__tag {
  flex: none;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
}
.next__text { color: var(--text-2); }

/* Studio */

.studio {
  margin-top: clamp(72px, 10vw, 144px);
  padding-block: clamp(56px, 7vw, 96px);
  border-top: 1px solid var(--line);
}
.studio__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px 96px;
}
.studio__intro p {
  max-width: 30em;
  margin-top: 20px;
  color: var(--text-2);
}

.rules { border-top: 1px solid var(--line); }
.rules li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px 0;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}
.rules__no {
  grid-row: span 2;
  padding-top: 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
}
.rules h3 {
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.rules p {
  max-width: 36em;
  color: var(--text-2);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 56px 32px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px 200px;
  gap: 40px;
}
.site-footer__brand p {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 15px;
}
.site-footer__links {
  display: grid;
  align-content: start;
  justify-items: start;
}
.site-footer__links p {
  padding-bottom: 8px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 13px;
}
.site-footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--text-2);
  transition: color 200ms var(--ease);
}
.site-footer__links a:hover { color: var(--text); }
.site-footer__links .icon {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}
.site-footer__legal {
  margin-top: 56px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 13px;
}

/* 404 */

.lost {
  display: grid;
  align-content: center;
  min-height: calc(100vh - 80px);
  padding-block: 64px 120px;
}
.lost h1 {
  max-width: 12ch;
  font-size: clamp(40px, 7vw, 96px);
  letter-spacing: -0.035em;
}
.lost p {
  margin-top: 24px;
  color: var(--text-2);
}
.lost .btn { margin-top: 32px; justify-self: start; }

/* Responsive */

@media (max-width: 1080px) {
  .hero__row { gap: 48px 40px; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); }
  .studio__grid { gap: 48px 56px; }
  .phone--back { right: 4%; }
  .phone--front { right: calc(4% + min(40%, 236px)); }
}

@media (max-width: 860px) {
  body { font-size: 16px; }
  .hero__row,
  .studio__grid,
  .work__grid,
  .card--wide { grid-template-columns: minmax(0, 1fr); }
  .shelf { max-width: 440px; border-radius: 36px; }
  .section-head p { display: none; }
  .phones {
    min-height: 0;
    height: 380px;
  }
  .phone { width: 210px; }
  .phone--front {
    top: 8px;
    right: auto;
    left: calc(50% - 190px);
  }
  .phone--back {
    top: 56px;
    right: auto;
    left: calc(50% - 10px);
  }
  .semble-stage {
    flex: none;
    min-height: 0;
    aspect-ratio: 3 / 2;
  }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .site-header__row { height: 64px; }
  .logo__mark { width: 32px; height: 32px; }
  .logo__name { font-size: 16px; }
  .site-nav a { padding-inline: 10px; }
  .card { border-radius: 20px; }
  .tile { width: 30px; height: 38px; font-size: 16px; }
  .vowels__phrase { gap: 8px 14px; }
  .phones { height: 330px; }
  .phone { width: 168px; border-radius: 30px; }
  .phone img { border-radius: 24px; }
  .phone--front { left: calc(50% - 156px); }
  .phone--back { left: calc(50% - 12px); }
  .semble-stage { aspect-ratio: 5 / 4; }
  .sheet { top: 28px; left: 6%; }
  .guide { top: 48px; right: 5%; width: 56%; }
  .guide figcaption { padding: 10px 12px 12px; }
  .guide__title { font-size: 13px; }
  .next {
    flex-direction: column;
    border-radius: 20px;
  }
  .rules li { grid-template-columns: 40px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
