/* bagsy.dev
   ------------------------------------------------------------------
   one stylesheet. no framework. sorry in advance.                    */

:root {
  --bg:      #f4f2ed;
  --bg-2:    #eceae3;
  --fg:      #171613;
  --muted:   #6b6862;
  --faint:   #a29e95;
  --rule:    #e0dcd3;
  --rule-2:  #cfcabf;
  --accent:  #c8380f;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
          Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono",
          "Cascadia Mono", Menlo, Consolas, monospace;

  --pad:  1.5rem;
  --max:  62rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}

a { color: inherit; }

::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 0.5rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  z-index: 60;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------ header */

.head {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem var(--pad);
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.head__id {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.head__name {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.head__role { color: var(--muted); }

.head__nav {
  display: flex;
  align-items: baseline;
  gap: 1.125rem;
}

.head__nav a {
  text-decoration: none;
  color: var(--muted);
  transition: color 100ms linear;
}

.head__nav a:hover,
.head__nav a:focus-visible { color: var(--fg); }

.head__x {
  color: var(--fg) !important;
  padding-left: 0.5rem;
  border-left: 1px solid var(--rule-2);
}
.head__x:hover { color: var(--accent) !important; }

/* -------------------------------------------------------------- main */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.section { padding: 3.75rem 0 0; }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--rule);
}

.section__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.section__path {
  color: var(--faint);
  white-space: nowrap;
}

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

.hero { padding: 7rem 0 1.5rem; }

.hero__line {
  margin: 0;
  font-size: clamp(2.5rem, 9vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.hero__sub {
  margin: 1.1rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.hero__links {
  margin: 2.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.hero__links a {
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule-2);
  transition: border-color 120ms linear, color 120ms linear;
}

.hero__links a:hover,
.hero__links a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ------------------------------------------------------------ builds */

.builds {
  list-style: none;
  margin: 0;
  padding: 0;
}

.build + .build { border-top: 1px solid var(--rule); }

.build__row {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem minmax(8rem, 11rem) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0 1rem;
  padding: 0.95rem 0.5rem 0.95rem 0;
  text-decoration: none;
  transition: padding-left 140ms cubic-bezier(.4,0,.2,1),
              background-color 140ms linear;
}

.build__row:hover,
.build__row:focus-visible {
  padding-left: 0.6rem;
  background: var(--bg-2);
}

.build__n {
  color: var(--faint);
  transition: color 120ms linear;
}
.build__row:hover .build__n { color: var(--accent); }
.build__n::before { content: ""; }
.build__row:hover .build__n::before,
.build__row:focus-visible .build__n::before { content: "./"; }

.build__name {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.build__desc { color: var(--muted); }

.build__links {
  justify-self: end;
  display: flex;
  gap: 1.25rem;
  white-space: nowrap;
}

.build__links a {
  position: relative;
  z-index: 1;
  color: var(--muted);
  text-decoration: none;
  transition: color 120ms linear;
}

.build__row:hover .build__links a { color: var(--fg); }

.build__links a:hover,
.build__links a:focus-visible { color: var(--accent); }

/* one link per row covers the whole row */
.build__stretch::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

.build__read { color: var(--fg); }
.build__row:hover .build__read { color: var(--accent); }

/* ------------------------------------------------------------- links */

.links {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0;
}

.links li {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.4rem 0;
}

.links__k { color: var(--faint); }

.links a {
  justify-self: start;
  text-decoration: none;
  border-bottom: 1px solid var(--rule-2);
  padding-bottom: 1px;
  transition: color 120ms linear, border-color 120ms linear;
}

.links a:hover,
.links a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------------------------------------------------------- terminal */

.term {
  margin: 4.5rem 0 0;
  border: 1px solid var(--rule-2);
  background: var(--bg-2);
}

.term__bar {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--rule-2);
  color: var(--muted);
}

.term__dim { color: var(--faint); }

.term__hint { color: var(--faint); }
.term__hint b { color: var(--muted); font-weight: 500; }

.term__out {
  min-height: 5.5rem;
  max-height: 15rem;
  overflow-y: auto;
  padding: 0.75rem;
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.65;
}

.term__out .t-cmd { color: var(--fg); }
.term__out .t-acc { color: var(--accent); }
.term__out .t-dim { color: var(--faint); }

.term__form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--rule-2);
}

.term__ps1 {
  color: var(--accent);
  white-space: nowrap;
}

.term__in {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0;
}
.term__in:focus { outline: none; }

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

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 4.5rem auto 0;
  padding: 1rem var(--pad) 2rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
}

.foot__c { color: var(--muted); }

.foot__r {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.foot__dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  background: none;
  border: 0;
  cursor: help;
}

.sq {
  width: 6px;
  height: 6px;
  background: var(--accent);
  transition: background-color 120ms linear;
}

.foot__dot:hover .sq { background: var(--fg); }

.foot__dot::after {
  content: "still here";
  position: absolute;
  bottom: 130%;
  right: 0;
  padding: 0.25rem 0.4rem;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.6875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 110ms linear;
}
.foot__dot:hover::after,
.foot__dot:focus-visible::after { opacity: 1; }

/* ------------------------------------------------------------ reveal */

.rise {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 520ms cubic-bezier(.22,.61,.36,1),
              transform 520ms cubic-bezier(.22,.61,.36,1);
}

.rise.is-in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------ trivia */

.coords {
  position: fixed;
  right: 0.6rem;
  bottom: 0.5rem;
  z-index: 30;
  color: var(--faint);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms linear;
}
.coords--on { opacity: 0.7; }

.bags {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 65;
  transform: translate(-50%, -50%) scale(0.96);
  font-family: var(--mono);
  font-size: clamp(3rem, 14vw, 7rem);
  letter-spacing: -0.04em;
  color: var(--accent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms linear, transform 140ms cubic-bezier(.4,0,.2,1);
}
.bags--on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ----------------------------------------------------------- narrow */

@media (max-width: 46rem) {
  .head { padding-top: 0.9rem; padding-bottom: 0.9rem; }
  .head__role { display: none; }
  .head__nav { gap: 0.9rem; width: 100%; }

  .hero { padding: 4rem 0 1rem; }

  .build__row {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    grid-template-areas:
      "n name"
      ". desc"
      ". links";
    gap: 0.15rem 0.75rem;
    padding-bottom: 1.1rem;
  }
  .build__n     { grid-area: n; }
  .build__name  { grid-area: name; }
  .build__desc  { grid-area: desc; }
  .build__links { grid-area: links; justify-self: start; margin-top: 0.35rem; }

  .links li { grid-template-columns: 4.5rem minmax(0, 1fr); }

  .foot { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .foot__c { order: 3; width: 100%; }

  .coords { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
