/* tko.box — a parts cabinet for small tools */

:root {
  --steel: #E3E7EA;      /* page: powder-coated steel */
  --frame: #24384F;      /* cabinet frame */
  --frame-edge: #18283A;
  --drawer: #F5F7F9;     /* drawer face */
  --drawer-shade: #D3DAE0;
  --label: #FFF1B8;      /* label card */
  --holder: #9AA7B3;     /* metal label holder */
  --ink: #18212B;
  --ink-soft: #4A5663;
  --focus: #2B6CF0;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --measure: 34rem;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--steel);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
}

.page {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2.5rem) 2.5rem;
}

/* Hero: the wordmark is the image */

.hero { margin-bottom: clamp(3rem, 9vw, 6rem); }

.wordmark {
  margin: 0;
  font-size: clamp(4.25rem, 19vw, 13.5rem);
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  line-height: 0.82;
  letter-spacing: -0.035em;
  color: var(--frame);
}

/* the dot in tko.box is a closed box */
.wordmark .dot {
  display: inline-block;
  width: 0.2em;
  height: 0.2em;
  margin: 0 0.05em 0 0.06em;
  background: var(--label);
  border: 0.035em solid var(--frame);
  border-radius: 0.025em;
  box-shadow: inset 0 0.045em 0 var(--frame); /* the lid line */
  vertical-align: baseline;
}

.intro {
  max-width: var(--measure);
  margin: clamp(1.25rem, 3vw, 2rem) 0 0;
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  line-height: 1.4;
  color: var(--ink-soft);
}

.intro a {
  color: var(--frame);
  font-weight: 600;
  text-underline-offset: 3px;
}

.intro a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Cabinet */

.contents h2 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  font-variation-settings: "wdth" 112;
  color: var(--ink);
}

.cabinet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--frame);
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 1px var(--frame-edge),
    0 1.25rem 2.5rem -1.5rem rgba(24, 40, 58, 0.55);
}

.drawer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 15rem;
  padding: 1.1rem 1.1rem 0.9rem;
  background: var(--drawer);
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -3px 0 var(--drawer-shade);
  color: inherit;
  text-decoration: none;
}

.label-holder {
  align-self: flex-start;
  padding: 3px;
  border: 2px solid var(--holder);
  border-radius: 3px;
  background: #E9EDF0;
}

.label {
  display: block;
  padding: 0.2rem 0.6rem 0.25rem;
  background: var(--label);
  font-size: 1.05rem;
  font-weight: 700;
  font-variation-settings: "wdth" 88;
  line-height: 1.25;
}

.drawer-text {
  max-width: 30ch;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.drawer-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.handle {
  width: 42%;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--drawer-shade);
  box-shadow: inset 0 2px 2px rgba(24, 33, 43, 0.22);
}

.drawer-url {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--frame);
}

/* A drawer pulls out toward you when you reach for it */

.drawer--live {
  transition: transform 160ms ease-out, box-shadow 160ms ease-out;
}

.drawer--live:hover,
.drawer--live:focus-visible {
  transform: translateY(4px);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -3px 0 var(--drawer-shade),
    0 -4px 0 0 var(--frame-edge);
}

.drawer--live:hover .drawer-url,
.drawer--live:focus-visible .drawer-url {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.drawer--live:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.drawer--empty {
  background: #E8ECEF;
  box-shadow: inset 0 2px 6px rgba(24, 33, 43, 0.12);
}

.drawer--empty .label {
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
}

.drawer--empty .label-holder { border-style: dashed; background: transparent; }
.drawer--empty .drawer-text { color: #6B7682; }
.drawer--empty .handle { opacity: 0.6; }

/* Footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  margin-top: clamp(3rem, 8vw, 5rem);
  padding-top: 1.25rem;
  border-top: 2px solid var(--frame);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.foot p { margin: 0; }

@media (max-width: 36rem) {
  .wordmark { font-size: 21vw; }
  .drawer { min-height: 0; }
  .drawer--empty { min-height: 8.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer--live { transition: none; }
}
